Skip to content

[build] Add go mod tidy before go mod vendor for Go 1.24 compat#157

Open
rustiqly wants to merge 1 commit intosonic-net:masterfrom
rustiqly:fix/go-mod-tidy
Open

[build] Add go mod tidy before go mod vendor for Go 1.24 compat#157
rustiqly wants to merge 1 commit intosonic-net:masterfrom
rustiqly:fix/go-mod-tidy

Conversation

@rustiqly
Copy link
Contributor

@rustiqly rustiqly commented Mar 8, 2026

Description

[agent]
Add go mod tidy before go mod vendor in Makefile for Go 1.24 compatibility.

What I did

Added $(GO) mod tidy before the $(GO) mod vendor call in the Makefile.

Why I did it

Go 1.24 (shipped in Debian Trixie) enforces stricter module graph consistency. When go.mod specifies an older Go version but the build runs under Go 1.24, go mod vendor fails with module resolution errors unless go mod tidy runs first.

How I verified it

Successfully built sonic-mgmt-framework under a Trixie slave container with Go 1.24.
On bookworm (Go 1.21), go mod tidy is a no-op — no behavior change.

Type of change

  • Bug fix

Go 1.24 (shipped in Debian Trixie) is stricter about module graph
consistency. Running `go mod vendor` without `go mod tidy` first
fails with module resolution errors when the go.mod was written
for an older Go version.

Add `go mod tidy` before `go mod vendor`. This is backward
compatible — on Go 1.21 (bookworm) it is a no-op.

Signed-off-by: Rustiqly <rustiqly@users.noreply.github.com>
@mssonicbld
Copy link

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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