fix(setup): validate Go version and install from go.dev if too old#367
Merged
DorianZheng merged 1 commit intomainfrom Mar 12, 2026
Merged
fix(setup): validate Go version and install from go.dev if too old#367DorianZheng merged 1 commit intomainfrom
DorianZheng merged 1 commit intomainfrom
Conversation
…o old Distro Go packages (e.g., Ubuntu golang-go) ship versions as old as 1.18, which cannot parse the go.mod toolchain directive (Go 1.21+) required by libgvproxy-sys. This causes confusing build failures. - Add version-aware check_go() returning 0/1/2 (ok/missing/too old) - Add install_go_from_official() fetching latest stable from go.dev - Add setup_go() with interactive upgrade prompt (auto in CI) - Remove distro Go packages from apt/yum/apk package lists - Support SKIP_INSTALL_GO=1 opt-out (matches SKIP_INSTALL_NODEJS pattern)
3 tasks
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.
Summary
golang-go= Go 1.18) are too old forlibgvproxy-sys'sgo.modwhich requires Go 1.24+ (toolchaindirective)make setupnow validates Go version >= 1.24 and offers to install fromgo.devif too oldChanges
setup-common.sh: Newcheck_go()(returns ok/missing/too old),install_go_from_official()(fetches latest from go.dev),setup_go()(interactive prompt, auto in CI)setup-ubuntu.sh: Removedgolang-gofrom apt, addedsetup_gocallsetup-manylinux.sh: Removedgolangfrom yum, addedsetup_gocallsetup-musllinux.sh: Removedgofrom apk, addedsetup_gocallsetup-macos.sh: Updatedsetup_go()to validate version,brew upgradeif too oldBehavior
Test plan
bash scripts/setup/setup-ubuntu.shon machine with Go 1.18 — should prompt to upgradeCI=true— should auto-install without promptSKIP_INSTALL_GO=1— should skipcargo build -p libgvproxy-syssucceeds after setup