Skip to content

Commit 3b50adb

Browse files
committed
build: unset GOBIN during build
Fixes #14340 Change-Id: I43e1624fafc972fb868708c3857fc8acf1bfbbd7 Reviewed-on: https://go-review.googlesource.com/23255 Run-TryBot: Brad Fitzpatrick <[email protected]> Reviewed-by: Rob Pike <[email protected]>
1 parent 44497eb commit 3b50adb

File tree

6 files changed

+9
-1
lines changed

6 files changed

+9
-1
lines changed

src/make.bash

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@
5050
# GO_DISTFLAGS: extra flags to provide to "dist bootstrap".
5151

5252
set -e
53+
54+
unset GOBIN # Issue 14340
55+
5356
if [ ! -f run.bash ]; then
5457
echo 'make.bash must be run from $GOROOT/src' 1>&2
5558
exit 1

src/make.bat

+1
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ setlocal
6868
set GOROOT=%GOROOT_BOOTSTRAP%
6969
set GOOS=
7070
set GOARCH=
71+
set GOBIN=
7172
"%GOROOT_BOOTSTRAP%\bin\go" build -o cmd\dist\dist.exe .\cmd\dist
7273
endlocal
7374
if errorlevel 1 goto fail

src/make.rc

+1-1
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ if(~ $sysname vx32)
8080
8181
if(! ~ $GOHOSTARCH $GOARCH || ! ~ $GOHOSTOS $GOOS){
8282
echo '##### Building packages and commands for host,' $GOHOSTOS/$GOHOSTARCH^.
83-
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH \
83+
GOOS=$GOHOSTOS GOARCH=$GOHOSTARCH GOBIN= \
8484
$GOTOOLDIR/go_bootstrap install -gcflags $"GO_GCFLAGS -ldflags $"GO_LDFLAGS -v $pflag std cmd
8585
echo
8686
}

src/run.bash

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export GOROOT # the api test requires GOROOT to be set.
1111
unset CDPATH # in case user has it set
1212
unset GOPATH # we disallow local import for non-local packages, if $GOROOT happens
1313
# to be under $GOPATH, then some tests below will fail
14+
unset GOBIN # Issue 14340
1415

1516
export GOHOSTOS
1617
export CC

src/run.bat

+2
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ set GOBUILDFAIL=0
1515
:: we disallow local import for non-local packages, if %GOROOT% happens
1616
:: to be under %GOPATH%, then some tests below will fail
1717
set GOPATH=
18+
:: Issue 14340: ignore GOBIN during all.bat.
19+
set GOBIN=
1820

1921
rem TODO avoid rebuild if possible
2022

src/run.rc

+1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ eval `{go env}
99
1010
GOPATH = () # we disallow local import for non-local packages, if $GOROOT happens
1111
# to be under $GOPATH, then some tests below will fail
12+
GOBIN = () # Issue 14340
1213
1314
exec go tool dist test -rebuild $*

0 commit comments

Comments
 (0)