Skip to content

Commit

Permalink
make.bash: disable GOEXPERIMENT when using bootstrap toolchain
Browse files Browse the repository at this point in the history
When using Go 1.4 this doesn't matter, but when using Go 1.17,
the bootstrap toolchain will complain about unknown GOEXPERIMENT settings.
Clearly GOEXPERIMENT is for the toolchain being built, not the bootstrap.

Already submitted as CL 395879 on the dev.boringcrypto branch,
but needed on master to set up GOEXPERIMENT=boringcrypto
builder ahead of merge.

For #51940.

Change-Id: Ib6a4099cca799b4d5df1974cdb5471adb0fd557d
Reviewed-on: https://go-review.googlesource.com/c/go/+/397894
Trust: Russ Cox <rsc@golang.org>
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
  • Loading branch information
rsc committed Apr 4, 2022
1 parent 11ec59a commit ef55053
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/make.bash
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ fi
# Get the exact bootstrap toolchain version to help with debugging.
# We clear GOOS and GOARCH to avoid an ominous but harmless warning if
# the bootstrap doesn't support them.
GOROOT_BOOTSTRAP_VERSION=$(GOOS= GOARCH= $GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //')
GOROOT_BOOTSTRAP_VERSION=$(GOOS= GOARCH= GOEXPERIMENT= $GOROOT_BOOTSTRAP/bin/go version | sed 's/go version //')
echo "Building Go cmd/dist using $GOROOT_BOOTSTRAP. ($GOROOT_BOOTSTRAP_VERSION)"
if $verbose; then
echo cmd/dist
Expand All @@ -204,7 +204,7 @@ if [ "$GOROOT_BOOTSTRAP" = "$GOROOT" ]; then
exit 1
fi
rm -f cmd/dist/dist
GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist
GOROOT="$GOROOT_BOOTSTRAP" GOOS="" GOARCH="" GO111MODULE=off GOEXPERIMENT="" "$GOROOT_BOOTSTRAP/bin/go" build -o cmd/dist/dist ./cmd/dist

# -e doesn't propagate out of eval, so check success by hand.
eval $(./cmd/dist/dist env -p || echo FAIL=true)
Expand Down
1 change: 1 addition & 0 deletions src/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ set GOROOT=%GOROOT_BOOTSTRAP%
set GOOS=
set GOARCH=
set GOBIN=
set GOEXPERIMENT=
set GO111MODULE=off
"%GOROOT_BOOTSTRAP%\bin\go.exe" build -o cmd\dist\dist.exe .\cmd\dist
endlocal
Expand Down
2 changes: 1 addition & 1 deletion src/make.rc
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ if(~ $GOROOT_BOOTSTRAP $GOROOT){
echo 'Building Go cmd/dist using '^$GOROOT_BOOTSTRAP
if(~ $#vflag 1)
echo cmd/dist
GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist
GOROOT=$GOROOT_BOOTSTRAP GOOS='' GOARCH='' GOEXPERIMENT='' GO111MODULE=off $GOROOT_BOOTSTRAP/bin/go build -o cmd/dist/dist ./cmd/dist

eval `{./cmd/dist/dist env -9}
if(~ $#vflag 1)
Expand Down

0 comments on commit ef55053

Please sign in to comment.