From 3b09de311bc701ef6cd88d2f45da2703643dc558 Mon Sep 17 00:00:00 2001 From: StanPonomarev Date: Mon, 20 Jul 2026 21:12:41 +0200 Subject: [PATCH] fix: make dotnet runnable. --- install-scripts/README.md | 5 +++++ install-scripts/dotnet | 7 +++++++ tests/test_install_scripts.py | 10 ++++++++++ 3 files changed, 22 insertions(+) create mode 100644 tests/test_install_scripts.py diff --git a/install-scripts/README.md b/install-scripts/README.md index 5cf17dc..b451c44 100644 --- a/install-scripts/README.md +++ b/install-scripts/README.md @@ -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 diff --git a/install-scripts/dotnet b/install-scripts/dotnet index 9fe78d7..2db526a 100644 --- a/install-scripts/dotnet +++ b/install-scripts/dotnet @@ -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" diff --git a/tests/test_install_scripts.py b/tests/test_install_scripts.py new file mode 100644 index 0000000..b1de10d --- /dev/null +++ b/tests/test_install_scripts.py @@ -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