]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: unset CC when we remove it from PATH in TestScript/cgo_stale_precompiled
authorBryan C. Mills <bcmills@google.com>
Wed, 6 Dec 2023 14:50:42 +0000 (09:50 -0500)
committerGopher Robot <gobot@golang.org>
Thu, 7 Dec 2023 19:13:27 +0000 (19:13 +0000)
Otherwise, if make.bash produced a relative default CC path but the
user has an absolute path to CC set in their environment, the test
will fail spuriously.

For #64423.

Change-Id: I0f3e1d04851585e1b39266badcda9f17489332d9
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/547997
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Matloob <matloob@golang.org>
Auto-Submit: Bryan Mills <bcmills@google.com>

src/cmd/go/testdata/script/cgo_stale_precompiled.txt

index eb7e10557b0c1528487d18623b7585744a0dc54f..b2a0e0c8d578ad135e44ba091773e82969aedaa6 100644 (file)
@@ -29,8 +29,12 @@ env GOROOT_FINAL=$oldGOROOT_FINAL
 # no longer installed anyway! Since we're requiring a C compiler in order to
 # build and use cgo libraries in the standard library, we should make sure it
 # matches what's in the cache.
-[!abscc] env CGO_ENABLED=1
-[!abscc] [!GOOS:plan9] env PATH=''  # Guaranteed not to include $(go env CC)!
-[!abscc] [GOOS:plan9] env path=''
-[!abscc] ! go build -x runtime/cgo
-[!abscc] stderr 'C compiler .* not found'
+
+[abscc] stop
+
+env CGO_ENABLED=1
+env CC=''
+[!GOOS:plan9] env PATH=''  # Guaranteed not to include $(go env CC)!
+[GOOS:plan9] env path=''
+! go build -x runtime/cgo
+stderr 'C compiler .* not found'