From: Bryan C. Mills Date: Wed, 6 Dec 2023 14:50:42 +0000 (-0500) Subject: cmd/go: unset CC when we remove it from PATH in TestScript/cgo_stale_precompiled X-Git-Tag: go1.22rc1~67 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=77e76c4387d1ba69fc00e5e85e9e70f259675456;p=gostls13.git cmd/go: unset CC when we remove it from PATH in TestScript/cgo_stale_precompiled 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 Reviewed-by: Michael Matloob Auto-Submit: Bryan Mills --- diff --git a/src/cmd/go/testdata/script/cgo_stale_precompiled.txt b/src/cmd/go/testdata/script/cgo_stale_precompiled.txt index eb7e10557b..b2a0e0c8d5 100644 --- a/src/cmd/go/testdata/script/cgo_stale_precompiled.txt +++ b/src/cmd/go/testdata/script/cgo_stale_precompiled.txt @@ -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'