tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: go package build problem: go: cannot find GOROOT directory: 'go' binary is trimmed and GOROOT is not set



> Inspecting the actual "go" binary with strings shows that the older
> versions, up to and including 120, have the goroot in the binary while
> 121 does not. I assume something in the build turns on the "-trimpath"
> option to remove that. There were some toolchain changes around
> portability of binaries, so that could be related.

The code that sets "trimpath", causing that behavior, is here:
https://cs.opensource.google/go/go/+/master:src/cmd/dist/build.go;l=1315;bpv=0;bpt=0

The default paths are removed when building a release, as opposed to
building inside a git checkout, to ensure reproducible binaries.

I added a patch and bumped the revision; try go121-1.21.5nb1 please!

-- 
Benny


Home | Main Index | Thread Index | Old Index