Skip to content

go: 1.26.8 -> 1.27.1 (unblocks croc GHSA-x89h fix, #750) - #758

Merged
bryan-minimal merged 5 commits into
mainfrom
go-1.27.1
Sep 30, 2026
Merged

bryan-minimal merged 5 commits into
mainfrom
go-1.27.1

Conversation

@bryan-minimal

@bryan-minimal bryan-minimal commented Sep 24, 2026 •

Copy link
Copy Markdown
Member

Why now

It unblocks the croc security fix (#750, GHSA-x89h). croc 11.5.2 (the fix release) and 11.5.3 both declare go 1.27.0 in go.mod, and our build uses GOTOOLCHAIN=local, so #750's minimal build fails on both arches:

go: go.mod requires go >= 1.27.0 (running go 1.26.8; GOTOOLCHAIN=local)

A no-op re-run can't fix that. Patching croc's go.mod down would mean guessing whether it uses 1.27 APIs, and letting it download a toolchain would break offline builds. Bumping Go is the honest path.

Checksums

From go.dev's official release manifest (https://go.dev/dl/?mode=json):

go1.27.1.linux-amd64.tar.gz   63d339f0...90168445   70,553,950 bytes
go1.27.1.src.tar.gz           4e408aba...2ab238b1   35,109,201 bytes

No hex0 re-root needed (a minor bump, so checked)

Go's rule, from src/cmd/dist/build.go:480 at go1.27.1: Go 1.N bootstraps from Go 1.M, "where M is N-2 rounded down to an even number". For 1.27 that's 1.24, enforced by notgo124.go. The arm64 leg's bedrock root is go1.24.9 (the hex0 ladder), so its Source block is untouched. The diff is 3 lines: version plus the two checksums.

Blast radius

50 packages build with go and will rebuild:
act, age, bun, caddy, chezmoi, cloud-sql-proxy, cloudflared, cosign, crane, croc, dive, duf, esbuild, fq, fzf, gh, git-lfs, gitleaks, glow, go-swagger, golangci-lint, goose, govulncheck, grpcurl, grype, helm, jqfmt, k9s, kubectl, lazydocker, lazygit, mermaid-ascii, minimal-sshd, mkcert, nats-cli, nats-server, otel-collector, podman-remote, pulumi, restic, scrt, skopeo, sops, spire, syft, tailscale, terraform, trivy, vhs, yq.

A Go minor release can surface new vet or compile errors in dependents, so minimal build on this PR is the real verification.

After this merges

I'll update #750 (croc) from main, and its build should go green.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Updates
    • Updated the packaged Go version to 1.27.1.
  • Bug Fixes
    • Fixed Trivy builds to work with the updated Go toolchain’s JSON behavior.

Unblocks croc 11.5.3 (#750, GHSA-x89h): croc 11.5.2 and 11.5.3 both declare
`go 1.27.0` in go.mod, and our GOTOOLCHAIN=local build refuses
("go.mod requires go >= 1.27.0 (running go 1.26.8)"), so the fix release
cannot build on 1.26.

Checksums come from go.dev's official release manifest
(https://go.dev/dl/?mode=json):
  go1.27.1.linux-amd64.tar.gz  63d339f0...90168445  70,553,950 bytes
  go1.27.1.src.tar.gz          4e408aba...2ab238b1  35,109,201 bytes

No hex0 re-root: Go 1.N bootstraps from Go 1.M where M = N-2 rounded down to
even (src/cmd/dist/build.go:480, go1.27.1), so 1.27 needs 1.24.x, which is
what the arm64 bedrock root (go1.24.9) already provides. The arm64 Source
block is untouched.

Blast radius: 50 packages build with go and will rebuild.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: gominimal/pkgs/.coderabbit.yaml

Review profile: CHILL

Plan: Essentials

Run ID: 0565852a-c761-48ee-9bde-5c8242363046

📥 Commits

Reviewing files that changed from the base of the PR and between 660b385 and 28375f1.

📒 Files selected for processing (2)
  • packages/go/build.ncl
  • packages/trivy/build.sh
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/go/build.ncl

Included review availability: This review used your included allowance. 0 included reviews remain after this review. Your included PR review attempts over the past 7 days set your current allowance at 2 reviews per hour.


📝 Walkthrough

Walkthrough

The Go recipe updates to version 1.27.1 and its matching source archive digest. The Trivy build adds a Go 1.27 JSON compatibility patch, applies it, and checks for remaining Go 1.26-only patterns.

Changes

Go 1.27 build updates

Layer / File(s) Summary
Update Go version and source archive digest
packages/go/build.ncl
The recipe changes from version 1.27.0 to 1.27.1 and updates the source archive SHA-256 digest. The source URL template remains unchanged.
Apply and verify the Trivy JSON patch
packages/trivy/go127-json-skipfunc.patch, packages/trivy/build.ncl, packages/trivy/build.sh
The patch replaces two json.SkipFunc returns with errors.ErrUnsupported and changes the Rego input tag from inline to embed. The Trivy build applies the patch and fails if non-test Go files still contain either Go 1.26-only pattern. The previous json.SkipFunc rewrite bridge is removed.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Merge Risk: ⚪ Minimal · up to 28375

The Go update and Trivy compatibility patch have no established merge-blocking issue. Complete the intended minimal build before merging.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: updating Go from 1.26.8 to 1.27.1. It also states the main purpose of the update by referencing the croc security fix.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Comment @coderabbitai help to get the list of available commands.

…ErrUnsupported)

With go 1.27.1, trivy v0.74.0 was the only one of the 50 Go packages that
failed, on both arches:
    pkg/x/json/json.go:109:16: undefined: json.SkipFunc
Go 1.27's encoding/json/v2 dropped `json.SkipFunc`; the "fall back to default
decoding" sentinel is now `errors.ErrUnsupported`. Upstream fixed this on main
in dc3c56eed5 (#11127), but it is not in any release yet.

Backported: only the pkg/x/json/json.go hunk (+3/-1, verified to apply
cleanly to v0.74.0's file). The rest of that upstream commit is CI/lint/test
churn and a style-only errors.AsType move. The patch is applied by name, and
build.sh checks that it landed. Drop at the next trivy release.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bryan-minimal

Copy link
Copy Markdown
Member Author

First build on 1.27.1: 49 of 50 Go packages built fine. The exception was trivy (v0.74.0), on both arches: pkg/x/json/json.go:109:16: undefined: json.SkipFunc. Go 1.27's encoding/json/v2 dropped SkipFunc (the fall-back sentinel is now errors.ErrUnsupported). Upstream fixed it on main in aquasecurity/trivy@dc3c56eed5, but it isn't released, so I've added that one hunk (+3/−1, verified to apply cleanly to v0.74.0) as a named patch on trivy, with a landed-check. Drop it at the next trivy release. Rebuilding now.

bryan-minimal and others added 2 commits September 24, 2026 08:46
…e->embed)

The first cut took only pkg/x/json/json.go. CI then failed at
pkg/iac/scanners/cloudformation/parser/parameter.go:57 (undefined:
json.SkipFunc), the second call site, which upstream's same commit fixes.
Both are now included, plus pkg/result/filter.go's struct tag
`json:",inline"` -> `json:",embed"`. That one still COMPILES on 1.27 but
would silently change the shape of trivy's JSON output.

Verified against the full v0.74.0 source: those are the only SkipFunc uses
and the only `,inline` JSON tag, and the patch applies cleanly to all three
files. The build.sh check now fails if ANY SkipFunc/`,inline` survives in
non-test Go source, using a single grep whose exit status is portable. The
old `| grep -v` form tripped on the PATCHED tree under ugrep.

Negative control (unpatched tree trips, patched tree passes) run under both
ugrep and BSD grep.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
With Go 1.27.1, otelcol-contrib failed on both arches inside a transitive dep:
    cockroachdb/swiss@v0.0.0-20251224182025-b0f6560f979b/map.go:
    undefined: hashFn, getRuntimeHasher, fastrand64
swiss reaches runtime internals via go:linkname shims gated per Go version.
The resolved commit ("Enable Go 1.26 support") compiles them out on 1.27.
Upstream aa852fb3c14e (2026-08-20, "Enable go 1.27 support") adds 1.27.

Pinned through the manifest's existing `replaces:` block before ocb runs,
with checks that the section exists and the pin landed. Validated against
v0.159.0's manifest: one substitution, 4 replaces entries, the obi/ebpf/avro
entries untouched. An unused replace is inert, so this is safe to keep until
a collector release carries the newer swiss.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bryan-minimal

Copy link
Copy Markdown
Member Author

/build

- packages/go/build.ncl: keep main's hex0-bootstrapped, source-built shape
  (#667); bump it to 1.27.1 with the 1.27.1 source sha256 (verified against
  go.dev's published checksum and by hashing the tarball). The branch's
  prebuilt amd64 url/sha is obsolete under #667.
- packages/otel-collector/build.sh: take main's Go-1.27 swiss pin; drop the
  branch's duplicate (main's guard exits if swiss is already pinned).
- packages/trivy/build.sh (semantic conflict git didn't flag): keep this
  branch's upstream json/v2 patch (trivy dc3c56eed5, also handles
  json:",inline") and drop #667's sed SkipFunc bridge, which deliberately
  exits 1 when no json.SkipFunc is left, i.e. after the patch has run.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
bryan-minimal added a commit that referenced this pull request Sep 29, 2026
croc >= 11.5.2 declares go 1.27.0; this branch last built against go 1.26
and failed. Main is now on go 1.27.0 (hex0-bootstrapped, #667), so the bump
no longer waits on #758. No conflicts; vs main the branch still changes only
packages/croc/build.ncl.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@bryan-minimal
bryan-minimal added this pull request to the merge queue Sep 30, 2026
Merged via the queue into main with commit 9e4b255 Sep 30, 2026
11 checks passed
@bryan-minimal
bryan-minimal deleted the go-1.27.1 branch September 30, 2026 16:20
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.

2 participants