fix: make dotnet runnable.
This commit is contained in:
@@ -18,6 +18,11 @@ files beneath it and install command wrappers or symlinks into `$DEV_TOOLS_DIR/b
|
||||
directory is prepended to implementation agents' `PATH`. Environment changes made by a script do
|
||||
not persist into implementation turns.
|
||||
|
||||
The supplied `dotnet` wrapper keeps the SDK itself in `DEV_TOOLS_DIR`, but places the writable
|
||||
.NET CLI home and NuGet package cache under `/tmp`. Codex implementation sandboxes do not expose a
|
||||
normal user home and receive read-only access to installed tools, so runtime caches cannot live
|
||||
beside the SDK.
|
||||
|
||||
The configured scripts run in list order after the repository is cloned (or an existing agent PR
|
||||
branch is synchronized) and before the first implementation turn for `implement`, `iterate`, and
|
||||
`fix`. They do not rerun between implementation and review-revision turns within one job. Scripts
|
||||
|
||||
@@ -25,6 +25,13 @@ PYTHON
|
||||
printf '%s\n' \
|
||||
'#!/bin/sh' \
|
||||
"export DOTNET_ROOT='$install_dir'" \
|
||||
'export DOTNET_CLI_HOME="${DOTNET_CLI_HOME:-/tmp/agentci-dotnet}"' \
|
||||
'export NUGET_PACKAGES="${NUGET_PACKAGES:-/tmp/agentci-nuget/packages}"' \
|
||||
'export DOTNET_CLI_TELEMETRY_OPTOUT=1' \
|
||||
'export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1' \
|
||||
'export DOTNET_NOLOGO=1' \
|
||||
'export DOTNET_CLI_WORKLOAD_UPDATE_NOTIFY_DISABLE=1' \
|
||||
'mkdir -p "$DOTNET_CLI_HOME" "$NUGET_PACKAGES"' \
|
||||
"exec '$install_dir/dotnet' \"\$@\"" \
|
||||
> "$bin_dir/dotnet"
|
||||
chmod 0755 "$bin_dir/dotnet"
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
def test_dotnet_wrapper_uses_sandbox_writable_runtime_directories() -> None:
|
||||
root = Path(__file__).parents[1]
|
||||
script = (root / "install-scripts" / "dotnet").read_text()
|
||||
|
||||
assert 'DOTNET_CLI_HOME="${DOTNET_CLI_HOME:-/tmp/agentci-dotnet}"' in script
|
||||
assert 'NUGET_PACKAGES="${NUGET_PACKAGES:-/tmp/agentci-nuget/packages}"' in script
|
||||
assert 'mkdir -p "$DOTNET_CLI_HOME" "$NUGET_PACKAGES"' in script
|
||||
Reference in New Issue
Block a user