From 9c2b481b57aea1ee69b2131c09af1e0dc0ea84d8 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Thu, 28 Jul 2022 15:29:38 -0400 Subject: [PATCH] run: set GOENV=off when running 'go tool dist env' 'go tool' sets environment variables, including the GOAMD64 value from the user's go.env file. 'go tool dist test' then rebuilds and reinstalls the toolchain and standard library based on those variables. It should not; instead, it should test exactly the configuration installed by the make scripts. Fixes #54084. Change-Id: I7cc8a21cc1d8331e06d7b7c55b14d170f8e2faab Reviewed-on: https://go-review.googlesource.com/c/go/+/420055 Run-TryBot: Bryan Mills Auto-Submit: Bryan Mills Reviewed-by: Ian Lance Taylor --- src/run.bash | 1 + src/run.bat | 1 + src/run.rc | 1 + 3 files changed, 3 insertions(+) diff --git a/src/run.bash b/src/run.bash index 99b09fcbde..4f4d437365 100755 --- a/src/run.bash +++ b/src/run.bash @@ -21,6 +21,7 @@ if [ ! -f ../bin/go ]; then exit 1 fi +export GOENV=off eval $(../bin/go tool dist env) export GOROOT # The api test requires GOROOT to be set, so set it to match ../bin/go. diff --git a/src/run.bat b/src/run.bat index 74bf8a4d8d..35c8ead8cb 100644 --- a/src/run.bat +++ b/src/run.bat @@ -18,6 +18,7 @@ setlocal set GOBUILDFAIL=0 +set GOENV=off ..\bin\go tool dist env > env.bat if errorlevel 1 goto fail call .\env.bat diff --git a/src/run.rc b/src/run.rc index 2a0bb7f7a1..704290ca5e 100755 --- a/src/run.rc +++ b/src/run.rc @@ -10,6 +10,7 @@ if(! test -f ../bin/go){ exit wrongdir } +GOENV=off eval `{../bin/go tool dist env} GOPATH=/nonexist-gopath -- 2.50.0