[v0.20.x-branch] Backport #11200: build: bump Go language to 1.26.8 and toolchain to 1.27.1 - #11209
Conversation
1c6a3a0 to
b112def
Compare
🔴 PR Severity: CRITICAL
🔴 Critical (3 files)
🟠 High (28 files)
🟡 Medium (12 files)
🟢 Low (22 files)
AnalysisThis is a broad Go toolchain/dependency version-bump PR (updated Go version across all To override, add a |
5350dce to
55e6ef1
Compare
Resolve the fn/v2 dependency to the repository's local ./fn module, matching master. Without this replacement, the v0.20 and v0.21 branches download fn/v2@v2.0.9. Its published Go 1.23 module metadata is incompatible with Go 1.27 when its tests use testing.B.Context. Keep the replacement local so the existing unit-module job tests the same source as the root module. This is a backport-specific compatibility change and does not alter the required fn/v2 version.
Keep lnd compatible with the previous stable Go release by updating the language version in every tracked go.mod file to Go 1.26.8. Move build and release tooling to Go 1.27.1, including CI, Docker images, the Makefile, protobuf generation, the linter configuration, and mobile build documentation. Update the installation documentation and official Linux archive checksums for Go 1.26.8 as well. (cherry picked from commit b1f9ca6)
Upgrade the custom golangci-lint from v2.4.0 to v2.13.2 because the older version reports false type-checking errors for generic mutex code when it runs with Go 1.27. Refresh the tools module dependencies, account for the renamed exhaustruct_v5 linter, and disable the deprecated gomodguard while leaving gomodguard_v2 active. Apply Go 1.27's gofmt output to the PSBT test's composite-literal return. Lower the consecutive-SCID zlib test boundary from 30,794 to 30,792. Go 1.27 changed compress/flate output, making 30,793 SCIDs exceed the 65,535-byte Lightning message limit while 30,792 still fit. (cherry picked from commit 6b54a38)
The protobuf generator uses Go's formatting packages and is now compiled inside the Go 1.27.1 Docker image. This changes generated doc-comment formatting and causes rpc-check to report stale checked-in bindings. Regenerate the RPC bindings with the newly pinned image. The resulting changes affect comments only; protobuf schemas and generated API code stay unchanged. (cherry picked from commit dd52310)
The linter configuration uses default: all, so upgrading golangci-lint also enables checks introduced after v2.4. Adopt canonicalheader, clickhouselint, godoclint, iotamixing, and unqueryvet because they add focused HTTP, documentation, const-block, and SQL safeguards. Fix the canonical WebSocket protocol header spelling required by the expanded canonicalheader implementation. Update twelve existing doc comments to begin with their declared symbol names as required by godoclint. Keep modernize disabled for now because its findings require broader code changes that should be reviewed separately against the Go 1.26 support baseline. (cherry picked from commit bada7ea)
be25a20 to
305e629
Compare
Backport of #11200
This updates the Go language/minimum version and build toolchain pins separately:
go.modfiles on v0.20 now use Go 1.26.8Dockerfiles, golangci-lint configuration, protobuf generation, and mobile
build documentation
checksums
preserved from the parent PR
replace github.com/lightningnetwork/lnd/fn/v2 => ./fndirective before theparent commits, so per-commit CI validation uses the local module
Backport notes
The v0.20 branch did not contain the earlier golangci-lint v2 configuration
migration that is already present on master. This backport therefore folds the
required v2 schema migration,
go toolinvocation, and removal of the obsoletev1
tools/tools.goimport into the tooling commit. The existing v0.20 policy ofdisabling
copyloopvaris retained because its cleanup was not backported.RPC bindings were regenerated from the v0.20 schemas with the newly pinned Go
1.27.1 generator; no master-only RPC surface was copied into the branch.
Verification
git diff --checkmake check-go-versiongo test -run '^$' ./...go test ./lnwirego test ./lnrpc/...make rpcwith no tracked difftools:go mod tidy -diffandgo mod verify0 issues