From: Bryan C. Mills Date: Mon, 18 Sep 2023 20:49:41 +0000 (-0400) Subject: [release-branch.go1.21] cmd/go: in TestScript/gotoolchain_path, remove the user's... X-Git-Tag: go1.21.2~10 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=b64dc5f499400f1ec3ef0192cc2d42a87a1916a8;p=gostls13.git [release-branch.go1.21] cmd/go: in TestScript/gotoolchain_path, remove the user's PATH This test checks a behavior of GOTOOLCHAIN when an appropriate toolchain is found in PATH. That requires it to exclude any suitable toolchain binaries from the user's $PATH, which may otherwise interfere. Fixes #62711. Updates #62709. Change-Id: Ie9161e52d33a65be0b5265cb49e9f2bc8473e057 Reviewed-on: https://go-review.googlesource.com/c/go/+/529217 Auto-Submit: Bryan Mills Reviewed-by: Dmitri Shuralyov Reviewed-by: Dmitri Shuralyov LUCI-TryBot-Result: Go LUCI (cherry picked from commit 30886b1b1ea0ff0282419e4deefdd35a51b2c9fc) Reviewed-on: https://go-review.googlesource.com/c/go/+/529435 Run-TryBot: Bryan Mills TryBot-Result: Gopher Robot Auto-Submit: Dmitri Shuralyov --- diff --git a/src/cmd/go/testdata/script/gotoolchain_path.txt b/src/cmd/go/testdata/script/gotoolchain_path.txt index 2549fa4753..9628348f7a 100644 --- a/src/cmd/go/testdata/script/gotoolchain_path.txt +++ b/src/cmd/go/testdata/script/gotoolchain_path.txt @@ -8,11 +8,12 @@ env TESTGO_VERSION=go1.21pre3 # Compile a fake toolchain to put in the path under various names. env GOTOOLCHAIN= mkdir $WORK/bin -[!GOOS:plan9] env PATH=$WORK/bin${:}$PATH -[GOOS:plan9] env path=$WORK/bin${:}$path go build -o $WORK/bin/ ./fakego.go # adds .exe extension implicitly on Windows cp $WORK/bin/fakego$GOEXE $WORK/bin/go1.50.0$GOEXE +[!GOOS:plan9] env PATH=$WORK/bin +[GOOS:plan9] env path=$WORK/bin + go version stdout go1.21pre3