Skip to content

ci: build with Go 1.27.3; gitignore dist/ so release binaries are not +dirty - #1316

Merged
scttfrdmn merged 1 commit into
mainfrom
ci/go-1.27.3-dirty
Oct 26, 2026
Merged

scttfrdmn merged 1 commit into
mainfrom
ci/go-1.27.3-dirty

Conversation

@scttfrdmn

Copy link
Copy Markdown
Contributor

Moves spawn's CI and release Go pin from 1.26.10 to 1.27.3, and fixes the +dirty stamp on release binaries.

Fixes #1266
Refs spore-host/spore-host#609

Go 1.27.3

  • actions/setup-go go-version 1.26.10 -> 1.27.3 everywhere it is pinned: ci.yml (Test, Lint, Test (Windows), E2E Tier 0), release.yaml, security.yml. No other place pins a toolchain (no Dockerfile, no toolchain directive, nothing in the Makefile or scripts).
  • go 1.26.0 in every go.mod is unchanged, so downstream importers are not forced onto 1.27.

Pinned tools, checked under GOTOOLCHAIN=go1.27.3 (nothing needed a bump):

Tool Pin Built with Result
staticcheck 2026.2.2 (the sha256 in ci.yml matches the downloaded linux tarball) go1.27.2 (both the linux-amd64 and darwin-arm64 release binaries) staticcheck ./...: 0 findings
golangci-lint 2.15.0 (the sha256 in ci.yml matches) go1.27.0 make lint: 0 issues in all 10 modules
govulncheck v1.3.0 (go install, so it is built by the job's Go) go1.27.3 "No vulnerabilities found" in all 10 modules

I ran the darwin-arm64 binaries from the same staticcheck and golangci-lint releases. For the linux-amd64 binaries CI uses, I only read their build info.

+dirty (#1266)

  • .gitignore now ignores /dist/.
  • New test TestReleaseBuildLeavesTheTreeClean (release_tree_clean_test.go):
    • It reads .goreleaser.yaml to find every path a release writes into the checkout: the dist: directory (GoReleaser's default is dist, at top level and nested) and the -o and zip outputs of each before: hook, resolved against the hook's cd.
    • It creates a probe file at each of those paths and asserts git status --porcelain --untracked-files=all reports none of them. It removes only the probes it created.
    • It fails rather than passing when it can't work out where a hook writes, for example a go build without -o.
    • In CI, a missing git or a missing checkout is a failure, not a skip.

Gate evidence:

  • Against the current main .gitignore the test fails. It reports ?? dist/artifacts.json and ?? dist/spawn_linux_amd64_v1/probe.
  • With the fix it passes. It probed dist/artifacts.json dist/spawn_linux_amd64_v1/probe lambda/ttl-reaper/build/bootstrap lambda/ttl-reaper/ttl-reaper_lambda_linux_arm64.zip.
  • Negative control 1: I dropped lambda/*/build/ from .gitignore. The test fails with ?? lambda/ttl-reaper/build/bootstrap, so the before-hook outputs are really covered (they are ignored today).
  • Negative control 2: I removed -o build/bootstrap from the hook. The test fails with "go build without -o; cannot tell where it writes".
  • End to end, in a scratch clone with an untracked dist/artifacts.json, building ./cmd/spored:
    • origin/main gives v0.145.0+dirty and vcs.modified=true;
    • this branch gives vcs.modified=false;
    • a clean tree gives vcs.modified=false.

Local checks (GOTOOLCHAIN=go1.27.3)

  • make check: steps 1 to 6 pass (gofmt, vet, vet per release GOOS, staticcheck, golangci-lint, hermetic short tests, the nested modules, tidy).
  • Step 7, check-build-tags, fails because of the /private/tmp paths. It fails the same way on unmodified origin/main under both go1.27.3 and go1.26.10.
  • make lint: 0 issues.
  • govulncheck in every module: clean.
  • semgrep scan --config=auto --error .: clean.

@codecov

codecov Bot commented Oct 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

… +dirty

Moves every CI/release Go pin 1.26.10 -> 1.27.3 (go.mod stays go 1.26.0).
Adds /dist/ to .gitignore and TestReleaseBuildLeavesTheTreeClean, which
probes every path a release build writes into the checkout (discovered
from .goreleaser.yaml) and fails if git status reports any.

Fixes #1266
Refs spore-host/spore-host#609
@scttfrdmn
scttfrdmn merged commit e2d630f into main Oct 26, 2026
9 checks passed
@scttfrdmn
scttfrdmn deleted the ci/go-1.27.3-dirty branch October 26, 2026 04:56
@scttfrdmn scttfrdmn mentioned this pull request Oct 26, 2026
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.

Release binaries are stamped +dirty: dist/ is not gitignored

1 participant