Skip to content

fix(setup): validate Go version and install from go.dev if too old#367

Merged
DorianZheng merged 1 commit intomainfrom
fix/setup-go-version-check
Mar 12, 2026
Merged

fix(setup): validate Go version and install from go.dev if too old#367
DorianZheng merged 1 commit intomainfrom
fix/setup-go-version-check

Conversation

@DorianZheng
Copy link
Copy Markdown
Member

Summary

  • Distro Go packages (e.g., Ubuntu golang-go = Go 1.18) are too old for libgvproxy-sys's go.mod which requires Go 1.24+ (toolchain directive)
  • make setup now validates Go version >= 1.24 and offers to install from go.dev if too old
  • Removes distro Go packages from apt/yum/apk lists; installs latest stable Go from official tarball instead

Changes

  • setup-common.sh: New check_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: Removed golang-go from apt, added setup_go call
  • setup-manylinux.sh: Removed golang from yum, added setup_go call
  • setup-musllinux.sh: Removed go from apk, added setup_go call
  • setup-macos.sh: Updated setup_go() to validate version, brew upgrade if too old

Behavior

Scenario Action
Go >= 1.24 installed No-op
Go missing Auto-install from go.dev
Go too old (e.g., 1.18) Interactive prompt: "Upgrade? [y/N]"
CI=true + too old Auto-install (no prompt)
SKIP_INSTALL_GO=1 Skip entirely

Test plan

  • Run bash scripts/setup/setup-ubuntu.sh on machine with Go 1.18 — should prompt to upgrade
  • Run with CI=true — should auto-install without prompt
  • Run with SKIP_INSTALL_GO=1 — should skip
  • Run on machine with Go >= 1.24 — should print "Found" and continue
  • Verify cargo build -p libgvproxy-sys succeeds after setup

…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)
@DorianZheng DorianZheng merged commit 164847e into main Mar 12, 2026
@DorianZheng DorianZheng deleted the fix/setup-go-version-check branch March 12, 2026 06:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant