From 037950ff09e672c9e5796b3b945e0a6b8dc418b0 Mon Sep 17 00:00:00 2001 From: Landon Cox Date: Wed, 1 Jul 2026 17:31:20 -0700 Subject: [PATCH 1/2] fix: redirect DOTNET_INSTALL_DIR and GOPATH for ARC/DinD topology On ARC/DinD runners, setup-dotnet installs to /usr/share/dotnet by default which requires root permissions. Similarly, GOPATH defaults to a path that may not be writable or visible to the DinD daemon. Extend the existing 'Redirect tool cache for ARC/DinD' step to also set: - DOTNET_INSTALL_DIR -> ${RUNNER_TEMP}/gh-aw/tool-cache/dotnet - GOPATH -> ${RUNNER_TEMP}/gh-aw/tool-cache/go This ensures all runtime setup actions install to daemon-visible, writable paths. Fixes the 'mkdir: cannot create directory /usr/share/dotnet: Permission denied' error seen in ARC/DinD canary workflows. Related: #42807 --- pkg/workflow/compiler_yaml_main_job.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/workflow/compiler_yaml_main_job.go b/pkg/workflow/compiler_yaml_main_job.go index 4ec0356ae8f..383dbe20ae1 100644 --- a/pkg/workflow/compiler_yaml_main_job.go +++ b/pkg/workflow/compiler_yaml_main_job.go @@ -233,10 +233,12 @@ func (c *Compiler) generateRuntimeAndWorkspaceSetupSteps(yaml *strings.Builder, // This step must run before any runtime setup steps (setup-go, setup-node, etc.) so that // those actions pick up the redirected path when they write into RUNNER_TOOL_CACHE. if isArcDindTopology(data) { - yaml.WriteString(" - name: Redirect tool cache for ARC/DinD\n") + yaml.WriteString(" - name: Redirect tool cache and install paths for ARC/DinD\n") yaml.WriteString(" run: |\n") yaml.WriteString(" mkdir -p \"${RUNNER_TEMP}/gh-aw/tool-cache\"\n") yaml.WriteString(" echo \"RUNNER_TOOL_CACHE=${RUNNER_TEMP}/gh-aw/tool-cache\" >> \"$GITHUB_ENV\"\n") + yaml.WriteString(" echo \"DOTNET_INSTALL_DIR=${RUNNER_TEMP}/gh-aw/tool-cache/dotnet\" >> \"$GITHUB_ENV\"\n") + yaml.WriteString(" echo \"GOPATH=${RUNNER_TEMP}/gh-aw/tool-cache/go\" >> \"$GITHUB_ENV\"\n") } if needsCheckout || !customStepsContainCheckout { From 6b4fb79f80aac48254e381866a8d171f85758871 Mon Sep 17 00:00:00 2001 From: Landon Cox Date: Wed, 1 Jul 2026 17:31:27 -0700 Subject: [PATCH 2/2] test: add assertions for DOTNET_INSTALL_DIR and GOPATH redirects --- pkg/workflow/compiler_yaml_main_job_test.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/workflow/compiler_yaml_main_job_test.go b/pkg/workflow/compiler_yaml_main_job_test.go index 09bad73717f..ee037edd322 100644 --- a/pkg/workflow/compiler_yaml_main_job_test.go +++ b/pkg/workflow/compiler_yaml_main_job_test.go @@ -748,9 +748,11 @@ func TestGenerateMainJobStepsArcDindRedirectsToolCacheToRunnerTemp(t *testing.T) require.NoError(t, err) result := yaml.String() - assert.Contains(t, result, "- name: Redirect tool cache for ARC/DinD") + assert.Contains(t, result, "- name: Redirect tool cache and install paths for ARC/DinD") assert.Contains(t, result, `mkdir -p "${RUNNER_TEMP}/gh-aw/tool-cache"`) assert.Contains(t, result, `echo "RUNNER_TOOL_CACHE=${RUNNER_TEMP}/gh-aw/tool-cache" >> "$GITHUB_ENV"`) + assert.Contains(t, result, `echo "DOTNET_INSTALL_DIR=${RUNNER_TEMP}/gh-aw/tool-cache/dotnet" >> "$GITHUB_ENV"`) + assert.Contains(t, result, `echo "GOPATH=${RUNNER_TEMP}/gh-aw/tool-cache/go" >> "$GITHUB_ENV"`) assert.NotContains(t, result, "/tmp/gh-aw/tool-cache") }