-
Notifications
You must be signed in to change notification settings - Fork 17.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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>
- Loading branch information
Bryan C. Mills
committed
Jan 26, 2022
1 parent
a9eedc0
commit 0f4bd92
Showing
2 changed files
with
25 additions
and
8 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Regression test for https://go.dev/issue/47215 and https://go.dev/issue/50183: | ||
# A mismatched $GOROOT_FINAL or missing $CC caused the C dependencies of the net | ||
# package to appear stale, and it could not be rebuilt due to a missing $CC. | ||
|
||
[!cgo] skip | ||
|
||
# Control case: net must not already be stale. | ||
! stale net | ||
|
||
# https://go.dev/issue/47215: a missing $(go env CC) caused the precompiled net to be stale. | ||
[!plan9] env PATH='' # Guaranteed not to include $(go env CC)! | ||
[plan9] env path='' | ||
! stale net # issue #47215 | ||
|
||
# https://go.dev/issue/50183: a mismatched GOROOT_FINAL caused net to be stale. | ||
env GOROOT_FINAL=$WORK${/}goroot | ||
! stale net |