Repository navigation
fix(sandbox): let go install cached toolchains without a download - #30
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a repository's
go.modasks for a newer Go than the installed one,godownloads that toolchain. proxy.golang.org redirects toolchain downloads tostorage.googleapis.com, which the sandbox proxy does not allow, so the checks fail. This parked shift #81 ("checks failed twice":go: download go1.24.0 ... storage.googleapis.com).Allowing
storage.googleapis.comwould open a general upload host, so this fix does not.Change
<GOMODCACHE>/cache/download/golang.org/toolchain) read-only. Only that directory is exposed; other cached modules stay hidden.GOPROXYin the sandbox isfile://<download cache>,https://proxy.golang.org,direct, sogoinstalls a cached toolchain from the local file proxy. Go still verifies it against the checksum database. A toolchain that is not cached falls through to proxy.golang.org as before.GOPROXYis now always set by the sandbox, soenv:cannot override it.Verification
go test) passes through the sandbox on the host where it failed, including the switch to Go 1.24.GOPROXYis not set, and when the whole module cache is exposed instead of the toolchains.