]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/go: drop GOEXPERIMENT in script tests
authorAustin Clements <austin@google.com>
Sat, 17 Apr 2021 01:45:02 +0000 (21:45 -0400)
committerDavid Chase <drchase@google.com>
Mon, 19 Apr 2021 02:43:30 +0000 (02:43 +0000)
commitc914e6160db8b6af358cad90ed7272ebc5c22dda
tree66c7b8a85a4c3913023395ee1298e728278c9df1
parent4efd581383ade76c562953289ed8210bb55bff47
cmd/go: drop GOEXPERIMENT in script tests

TestScript sets the GOEXPERIMENT environment variable to the value of
buildcfg.GOEXPERIMENT() with the intent that tests can use this to
inspect the value of buildcfg.GOEXPERIMENT. This has the unfortunate
side-effect of also affecting the experiments enabled for all builds
done by TestScript. For the most part this is harmless, but
GOEXPERIMENT can be GOOS/GOARCH-sensitive, so if a test changes GOOS
or GOARCH, it will continue to use the GOEXPERIMENT from the host
GOOS/GOARCH rather than what makes sense (or is even allowed) in the
test's GOOS/GOARCH. In fact, prior to CL 307819, TestScript set
GOEXPSTRING instead of GOEXPERIMENT because it previously captured
objabi.Expstring(), so the captured value didn't affect the build.

There's only one experiment that actually uses TestScript's
GOEXPERIMENT and there's a much better way to write that test now such
that it doesn't need to read GOEXPERIMENT at all. Hence, this CL
rewrites this test and drops GOEXPERIMENT from TestScript.

This should fix the *-regabi builders.

Change-Id: I3fcbf1f21e1b471ebc0e953c31333645553ea24c
Reviewed-on: https://go-review.googlesource.com/c/go/+/310969
Trust: Austin Clements <austin@google.com>
Run-TryBot: Austin Clements <austin@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/go/script_test.go
src/cmd/go/testdata/script/README
src/cmd/go/testdata/script/build_tag_goexperiment.txt