]> Cypherpunks repositories - gostls13.git/commit
cmd/go: avoid recording GOROOT_FINAL in precompiled C archives
authorBryan C. Mills <bcmills@google.com>
Wed, 26 Jan 2022 14:18:14 +0000 (09:18 -0500)
committerBryan Mills <bcmills@google.com>
Wed, 26 Jan 2022 17:03:32 +0000 (17:03 +0000)
commit0f4bd92c4d9a16efe05e397354dec87737338d2c
tree7e06db66b8d3bb0fcf6f9f42ce12273e81c8afc7
parenta9eedc0789085f55193bdbf0d777b8eaeccb1890
cmd/go: avoid recording GOROOT_FINAL in precompiled C archives

C archives for packages in GOROOT are shipped along with binary
releases of the Go toolchain. Although we build the toolchain with
GOROOT_FINAL set, we don't know actually know where the release will
be installed: the user's real GOROOT can differ arbitrarily from our
GOROOT_FINAL.

(In the specific case of toolchains installed through golang.org/dl
wrappers, the release's GOROOT_FINAL is /usr/local/go but the actual
GOROOT to which the release is installed is
$HOME/sdk/$(go env GOVERSION).)

Fixes #50183
Updates #48319

Change-Id: If10a42f90c725300bbcb89c3b5b01a2d93ab6ef7
Reviewed-on: https://go-review.googlesource.com/c/go/+/380915
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
Reviewed-by: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
src/cmd/go/internal/work/exec.go
src/cmd/go/testdata/script/cgo_stale_precompiled.txt [new file with mode: 0644]