Repository navigation
Commit a937d1e
committed
Build go-licenses with the same toolchain as the main module
go-licenses decides whether a package is part of the standard library by
comparing its directory against the GOROOT it was compiled with. The
Makefile builds go-licenses from the tools/ module but runs it against the
main module, and with GOTOOLCHAIN=auto those can resolve to different
toolchains (tools/go.mod has `toolchain go1.24.1`, go.mod has `go 1.25.0`).
When that happens every stdlib package is reported as "does not have module
info" and `make container` fails.
This does not show up in CI because CI pins a Go version that satisfies
both modules, but it reproduces with any host Go older than the main
module's `go` line:
docker run --rm -e GOTOOLCHAIN=auto -v "$PWD":/src -w /src \
golang:1.23.0 make .licenses
Pin GOTOOLCHAIN for the tools build to the version the main module
resolves to, so both steps use the same GOROOT.1 parent cf98d83 commit a937d1e
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
166 | 171 | | |
167 | 172 | | |
168 | 173 | | |
169 | 174 | | |
| 175 | + | |
170 | 176 | | |
171 | 177 | | |
172 | 178 | | |
| |||
0 commit comments