Repository navigation
refactor(features): port golang.sh to luggage (binary-tarball) - #1347
Merged
Merged
Conversation
golang.sh no longer downloads, verifies, or extracts Go itself. It
delegates to `luggage install go@${GO_VERSION}` against the vendored
containers-db catalog, which now carries go (1.22.0..1.27.3, mirrored
verbatim from containers-db 67f04700). Partial versions ("1.26") resolve
via `luggage resolve go` to the newest catalog patch, as rust.sh does.
Partials are read from luggage's JSON with an anchored sed, not jq (no
base image installs jq), and a failed resolve surfaces luggage's own
stderr. Go < 1.22 is refused up front (the catalog floor). Scope is
amd64/arm64, matching docs/reference/supported-platforms.md: the old
armhf/i386 arms covered platforms this project never built.
luggage picks the per-arch artifact via the {arch} URL placeholder,
verifies it at tier 3 against dl.google.com's published .sha256,
extracts under /usr/local, creates + chowns GOPATH/GOCACHE/GOMODCACHE
from the catalog's cache_dirs, links go/gofmt into /usr/local/bin, and
validates with `go version` (the catalog's version_args; `go --version`
exits 2). Removed from bash: arch detection, curl, the 4-tier
verify_download_or_fail flow, tar -xzf, the symlink loop, and the
version-resolution/download-verify/checksum-fetch/checksum-verification
sources. `git` stays an apt_install: a runtime need of `go get`, not an
install dependency.
Also:
- tests/integration/builds/test_luggage_golang.sh + fixture: exact-pin
and partial (1.26 -> newest vendored 1.26.x) builds.
- Both luggage integration fixtures now build on rust:1.99 (the MSRV).
They were on rust:1.98.0 and failed `cargo build` on rust-version
since the MSRV moved — the existing rust fixture was silently broken.
tests/unit/rust-version-sync.sh now checks fixture builder images too.
- updaters.sh Go arm keeps the vendored catalog in lockstep with the pin,
with a propagation test twin of the Rust arm's.
- golang unit tests run the real version block against a stub luggage
(partial/exact/failure/no-version/pre-floor), each mutation-killed.
- Memory (incidental, learned on this issue): harness-placeholder-args-
fake-review warns that omitting `diff` for a cross-repo PR reviews the
cwd branch; assertions-must-discriminate gains the missing-decoy case.
Closes #811
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 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
PR C of 3 for #811 — the port itself.
lib/features/golang.shno longer downloads, verifies, or extracts Go; it runsluggage install go@${GO_VERSION}against the vendored catalog.{arch}URL placeholder + catalog-declaredTool.version_args, needed becausego --versionexits 2) and feat(tools): add go catalog entry with binary-tarball install method containers-db#456 (the go catalog: 70 stable versions 1.22.0–1.27.3, onebinary-tarballmethod each, tier-3 against dl.google.com's.sha256).crates/luggage/testdata/catalog/tools/go/is a byte-identical mirror of containers-db67f04700;just db-validate-vendoredcompares all 71 go entries, 0 drift.curl, the 4-tierverify_download_or_failflow,tar -xzf, the symlink loop, and four sourced helpers. Partial versions (1.26) resolve vialuggage resolve go, read with an anchoredsed(nojq— no base image installs it) and surfacing luggage's own stderr on failure.gitstays anapt_install(runtime need ofgo get).docs/reference/supported-platforms.md. The old armhf (armv6l) / i386 (386) arms covered platforms this project never built; luggage refuses them by name (no install method for go@X matches debian/armhf).update_luggage_catalog "go"so auto-patch keeps the vendored catalog in lockstep with the pin.Also in this PR (disclosed scope)
rust:1.98.0; the workspace MSRV is 1.99, socargo buildrefused. The existing rust fixture was silently broken (weekly tier, unnoticed); the new go fixture can't build without the fix.tests/unit/rust-version-sync.shnow checks fixture builder images too (including--platform=/ registry-prefixed spellings), so the next MSRV bump names them.difffor a cross-repo review reviews the cwd branch instead; and two new "test passes/fails for the wrong reason" cases (a fixture with no real decoy; a$(...) || rc=$?harness that disablesset -ein the code under test).Test plan
just test-integration-one luggage_golang— 2/2 PASS on a real build:go1.27.2 linux/arm64;go/gofmt→/usr/local/go/bin;GOROOT=/usr/local/go;/cache/go,/cache/go-build,/cache/go-modall owned byvscode; luggage log showsverify (tier 3);GO_VERSION=1.26resolves to1.26.10. Fixture installs nojqand passes golang.sh's real install flags.just test-integration-one luggage_rust— 1/1 PASS (confirms the MSRV fix)."version"decoy), exact pin skips luggage, failed resolve surfaces luggage's error, no-version fails closed, <1.22 refused, bare"1"rejected by validation,2.0reaches resolve, a failing install aborts the script, exact install argv.|| true/|| :/|| echo, dropped--user/--cache-root, wrong catalog, Go updater"rust"/$current, respelled stale builder).cargo test --workspace,just test(0 failures),just db-validate-vendored(0 drift), shellcheck clean.workflow.jsharness): 5 cycles; cycle 1's five blocking findings fixed; final full-scope cycle clean, its in-scope test gaps fixed in this commit.Follow-ups
ToolVersionCloses #811
🤖 Generated with Claude Code