Skip to content

Use local Go cache on self-hosted Linux - #1273

Merged
wesm merged 9 commits into
mainfrom
fix/self-hosted-go-cache
Jul 26, 2026
Merged

Use local Go cache on self-hosted Linux#1273
wesm merged 9 commits into
mainfrom
fix/self-hosted-go-cache

Conversation

@wesm

@wesm wesm commented Jul 26, 2026

Copy link
Copy Markdown
Member

Managed Linux jobs pass setup-go the literal cache value false using the same pre-dispatch repository and matrix facts that select the managed runner. They continue using the runner-provided GOMODCACHE and GOCACHE directories, so module and build caches remain local to each machine without archive restore or upload collisions.

Hosted fork builds and non-Linux jobs receive the literal value true and keep GitHub Actions caching. The main-pinned reusable workflow boundary remains unchanged.

The canonical-main routing arm now requires an explicit push event because pull_request_target also exposes the base branch ref. Only main pushes and same-repository pull requests can select the managed runner.

Self-hosted Linux jobs already receive machine-local module and build cache paths. Letting setup-go restore its archive into those live directories can collide with concurrent jobs and fail on existing files.\n\nDisable setup-go's remote cache layer only on self-hosted Linux. GitHub-hosted jobs and native jobs on other operating systems retain their existing cache behavior.

Generated with Codex
Co-authored-by: Codex <noreply@openai.com>
@roborev-ci

roborev-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown

roborev: Combined Review (43e3d17)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 42s

wesm and others added 2 commits July 26, 2026 16:08
ARC jobs did not expose runner.environment when setup-go inputs were evaluated, so the first condition incorrectly enabled archive caching on managed Linux and still extracted into the live local cache.\n\nUse the same repository and event identities that select trusted runner admission. Same-repository PRs and main pushes now reliably use only the machine-local cache, while external fork jobs retain hosted cache behavior.

Generated with Codex
Co-authored-by: Codex <noreply@openai.com>
The managed-cache exception is specific to Linux runners with host-mounted Go cache paths. Keep setup-go's archive caching enabled on macOS and Windows while the repository/event predicate continues to distinguish trusted Linux routes from hosted fork jobs.

Generated with Codex
Co-authored-by: Codex <noreply@openai.com>
@roborev-ci

roborev-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown

roborev: Combined Review (0c53c8e)

Medium

  • .github/actions/build-desktop-artifact/action.yml:21 — The desktop Linux artifact job routes trusted builds to kenn-linux-x64-public, but its composite action leaves setup-go caching enabled. This can restore archives into the shared machine-local Go cache, preserving the collision this change aims to prevent. Add the same cache-routing condition to the composite action, ideally through an explicit input derived from the workflow’s runner-routing predicate.

Reviewers: 2 done | Synthesis: codex, 10s | Total: 1m50s

The desktop artifact composite action owns a separate setup-go invocation, so changing only the top-level workflows left its managed Linux jobs restoring archives into the shared local cache.\n\nApply the same repository, event, and operating-system predicate inside the composite action. Trusted Linux builds use the machine-local cache while hosted fork and native platform builds retain setup-go caching.

Generated with Codex
Co-authored-by: Codex <noreply@openai.com>
@roborev-ci

roborev-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown

roborev: Combined Review (923a4da)

Code is clean with no Medium, High, or Critical findings.


Reviewers: 2 done | Synthesis: codex, 5s | Total: 1m40s

The runner context is not populated reliably when setup action inputs are evaluated on ARC jobs. Mirror runs-on routing with GitHub and matrix inputs so managed Linux keeps its host-local cache while hosted and native jobs retain setup-go caching.

Generated with Codex

Co-Authored-By: Codex <codex@openai.com>
@roborev-ci

roborev-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown

roborev: Combined Review (3dade0d)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 4m13s

Composite action inputs are strings, and GitHub omitted a boolean false value at the action boundary. Pass literal true and false strings so setup-go receives a valid cache mode on every desktop platform.

Generated with Codex

Co-Authored-By: Codex <codex@openai.com>
@roborev-ci

roborev-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown

roborev: Combined Review (e90ef39)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 1m28s

wesm and others added 2 commits July 26, 2026 16:39
GitHub omits a false boolean expression at the action input boundary, causing setup-go to fall back to cache=true. Return literal false and true strings so managed Linux never archives its shared host cache while hosted jobs keep Actions caching.

Generated with Codex

Co-Authored-By: Codex <codex@openai.com>
PR validation invokes the main-pinned reusable workflow, which cannot pass a new action input introduced by the PR. Derive the managed Linux x64 cache mode from the composite action's existing bundle and target inputs so both the pinned caller and future main caller work.

Generated with Codex

Co-Authored-By: Codex <codex@openai.com>
@roborev-ci

roborev-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown

roborev: Combined Review (2960941)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 5m51s

A main branch ref is not sufficient evidence of a trusted push because pull_request_target events expose the base branch ref. Bind the canonical main path to push events so only same-repository pull requests and main pushes select the managed runner and its local-cache mode.

Generated with Codex

Co-Authored-By: Codex <codex@openai.com>
@roborev-ci

roborev-ci Bot commented Jul 26, 2026

Copy link
Copy Markdown

roborev: Combined Review (b0d5bea)

No issues found.


Reviewers: 2 done | Synthesis: codex | Total: 2m21s

@wesm
wesm merged commit 627a8af into main Jul 26, 2026
23 checks passed
@wesm
wesm deleted the fix/self-hosted-go-cache branch July 26, 2026 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant