Commit 3b50adbc authored by Brad Fitzpatrick's avatar Brad Fitzpatrick

build: unset GOBIN during build

Fixes #14340

Change-Id: I43e1624fafc972fb868708c3857fc8acf1bfbbd7
Reviewed-on: https://go-review.googlesource.com/23255
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: default avatarRob Pike <r@golang.org>
parent 44497eba
...@@ -50,6 +50,9 @@ ...@@ -50,6 +50,9 @@
# GO_DISTFLAGS: extra flags to provide to "dist bootstrap". # GO_DISTFLAGS: extra flags to provide to "dist bootstrap".
set -e set -e
unset GOBIN # Issue 14340
if [ ! -f run.bash ]; then if [ ! -f run.bash ]; then
echo 'make.bash must be run from $GOROOT/src' 1>&2 echo 'make.bash must be run from $GOROOT/src' 1>&2
exit 1 exit 1
......
...@@ -68,6 +68,7 @@ setlocal ...@@ -68,6 +68,7 @@ setlocal
set GOROOT=%GOROOT_BOOTSTRAP% set GOROOT=%GOROOT_BOOTSTRAP%
set GOOS= set GOOS=
set GOARCH= set GOARCH=
set GOBIN=
"%GOROOT_BOOTSTRAP%\bin\go" build -o cmd\dist\dist.exe .\cmd\dist "%GOROOT_BOOTSTRAP%\bin\go" build -o cmd\dist\dist.exe .\cmd\dist
endlocal endlocal
if errorlevel 1 goto fail if errorlevel 1 goto fail
......
...@@ -80,7 +80,7 @@ if(~ $sysname vx32) ...@@ -80,7 +80,7 @@ if(~ $sysname vx32)
if(! ~ $GOHOSTARCH $GOARCH || ! ~ $GOHOSTOS $GOOS){ if(! ~ $GOHOSTARCH $GOARCH || ! ~ $GOHOSTOS $GOOS){
echo '##### Building packages and commands for host,' $GOHOSTOS/$GOHOSTARCH^. echo '##### Building packages and commands for host,' $GOHOSTOS/$GOHOSTARCH^.
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \ GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH GOBIN= \
$GOTOOLDIR/go_bootstrap install -gcflags $"GO_GCFLAGS -ldflags $"GO_LDFLAGS -v $pflag std cmd $GOTOOLDIR/go_bootstrap install -gcflags $"GO_GCFLAGS -ldflags $"GO_LDFLAGS -v $pflag std cmd
echo echo
} }
......
...@@ -11,6 +11,7 @@ export GOROOT # the api test requires GOROOT to be set. ...@@ -11,6 +11,7 @@ export GOROOT # the api test requires GOROOT to be set.
unset CDPATH # in case user has it set unset CDPATH # in case user has it set
unset GOPATH # we disallow local import for non-local packages, if $GOROOT happens unset GOPATH # we disallow local import for non-local packages, if $GOROOT happens
# to be under $GOPATH, then some tests below will fail # to be under $GOPATH, then some tests below will fail
unset GOBIN # Issue 14340
export GOHOSTOS export GOHOSTOS
export CC export CC
......
...@@ -15,6 +15,8 @@ set GOBUILDFAIL=0 ...@@ -15,6 +15,8 @@ set GOBUILDFAIL=0
:: we disallow local import for non-local packages, if %GOROOT% happens :: we disallow local import for non-local packages, if %GOROOT% happens
:: to be under %GOPATH%, then some tests below will fail :: to be under %GOPATH%, then some tests below will fail
set GOPATH= set GOPATH=
:: Issue 14340: ignore GOBIN during all.bat.
set GOBIN=
rem TODO avoid rebuild if possible rem TODO avoid rebuild if possible
......
...@@ -9,5 +9,6 @@ eval `{go env} ...@@ -9,5 +9,6 @@ eval `{go env}
GOPATH = () # we disallow local import for non-local packages, if $GOROOT happens GOPATH = () # we disallow local import for non-local packages, if $GOROOT happens
# to be under $GOPATH, then some tests below will fail # to be under $GOPATH, then some tests below will fail
GOBIN = () # Issue 14340
exec go tool dist test -rebuild $* exec go tool dist test -rebuild $*
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment