You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bump Go toolchain to 1.26.4 and refresh build/test images
⚙️ Configuration changes🕐 10-20 Minutes
AI Description
• Upgrade the project’s minimum Go version to 1.26.4.
• Update build/test Docker base images to Go 1.26.4 variants.
• Switch golangci-lint installation to go install and refresh Sonic deps.
Diagram
graph TD
CI["CI / Developers"] --> MF["Makefile (tools)"] --> LINT["golangci-lint install"]
CI --> MOD["go.mod / go.sum"] --> BUILD["Go build & tests"]
CI --> IMG["Docker build"] --> BASE{{"matrixorigin base images"}}
IMG --> BVT["BVT tester images"]
BASE --> BUILD
Loading
High-Level Assessment
The following are alternative approaches to this PR:
1. Add `toolchain go1.26.4` in go.mod
➕ More strongly pins the Go toolchain used in CI/local (where supported)
➕ Reduces “works on my machine” drift when multiple Go versions are installed
➖ Requires developers/CI runners to use Go versions that understand the toolchain directive
➖ May need documentation updates for environments that vendor toolchains differently
2. Keep curl-based golangci-lint installer with checksum verification
➕ Doesn’t rely on go install behavior or module proxy availability
➕ Can install prebuilt binaries faster in some environments
➖ More supply-chain risk if not pinned and checksum-verified
➖ Harder to audit and maintain than a module-pinned go install
3. Run linting exclusively inside a pinned Docker image
➕ Maximally reproducible tooling across CI and developers
➕ Avoids installing tooling on the host entirely
➖ Adds Docker dependency for contributors
➖ May slow iteration for local lint runs
Recommendation: The current approach (bumping Go to 1.26.4, aligning Docker bases, and installing golangci-lint via go install) is a good default for reproducibility and simpler maintenance. Consider additionally using the toolchain directive if the project’s supported environments are aligned, to further reduce Go-version drift.
Files changed (7) +12 / -12
Other (7) +12 / -12
MakefileInstall golangci-lint via 'go install' instead of curl script+1/-1
Install golangci-lint via 'go install' instead of curl script
• Replaces the curl-piped installer script with a module-pinned 'go install' invocation for golangci-lint v2.6.2. This simplifies tool installation and improves auditability.
go.modBump minimum Go version and update Sonic dependencies+3/-3
Bump minimum Go version and update Sonic dependencies
• Raises the module’s declared minimum Go version from 1.25.4 to 1.26.4. Updates 'github.com/bytedance/sonic' and its loader dependency to newer patch versions.
install-static-check-tools now installs golangci-lint via go install without forcing a known
install directory, but static-check still runs golangci-lint by name, so the lint step can fail
when the Go install dir (e.g., a custom GOBIN) isn’t on PATH. Previously the installer
explicitly placed the binary into $(GOPATH)/bin.
The Makefile installs golangci-lint without specifying an install directory and later invokes
golangci-lint via PATH; although GOPATH is computed, it’s not used to pin the tool location.
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution
## Issue description
`make install-static-check-tools` installs `golangci-lint` using `go install`, but `make static-check` later invokes `golangci-lint` as a bare command. If the Go install directory is not on `PATH`, `static-check` fails with command-not-found.
## Issue Context
The Makefile already computes `GOPATH` via `go env GOPATH`, but the install target does not use it to control where the binary is installed.
## Fix Focus Areas
- Makefile[1041-1053]
- Makefile[52-58]
## Suggested fix
Update `install-static-check-tools` to force a consistent install location (and/or update invocations to use an explicit path), e.g.:
- `@GOBIN=$(GOPATH)/bin go install github.com/golangci/golangci-lint/v2/cmd/[email protected]`
- (Optionally do the same for `molint` and `license-eye` for consistency)
- Or change `static-check` to call `$(GOPATH)/bin/golangci-lint` (and similarly for other tools).
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools
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
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.
What type of PR is this?
Which issue(s) this PR fixes:
issue#25255
What this PR does / why we need it:
update go version 1.26.4 and go1.26.4-jdk8