diff options
author | Austin Clements <austin@google.com> | 2023-05-10 13:55:10 -0400 |
---|---|---|
committer | Austin Clements <austin@google.com> | 2023-05-19 01:37:29 +0000 |
commit | 071770b846452ef9b00277ef5e1d8693bb891ac2 (patch) | |
tree | ad800dad52b6ff93ef893369f314bfe9c073253a /src/cmd/dist/test.go | |
parent | e95982fe306da84ef6e9b90293d4adb95cbfec26 (diff) | |
download | go-071770b846452ef9b00277ef5e1d8693bb891ac2.tar.gz go-071770b846452ef9b00277ef5e1d8693bb891ac2.zip |
cmd/dist: enable more cgo tests if GO_GCFLAGS != ""
Currently, we have several tests disabled if GO_GCFLAGS is non-empty.
Long ago, this was critical because many of these tests use "go
install" with no -gcflags and would thus overwrite std packages in
GOROOT built with -gcflags=$GO_GCFLAGS. Now these packages all live in
the build cache, so this is no longer a concern.
The other reason for this (the reason given in the code comment), is
that these tests will rebuild significant portions of std without
flags. While this is still theoretically true, there are many tests
that run "go build" with no -gcflags, so these tests don't contribute
much overall.
Empirically, on my linux/amd64 host, running these tests at all grows
the Go build cache by 14%, from 1.899 GB to 2.165 GB. When building
with GO_GCFLAGS="-N -l" (the only use case on the builders), enabling
them grows the Go build cache by 18%, from 1.424 GB to 1.684 GB. This
is only a 4 percentage point difference, and still results in a build
cache that's smaller than the default build
Given all this, there's little reason to carry the complexity of
disabling these tests when GO_GCFLAGS != "". Removing this condition
is a step toward running these as regular cmd tests.
Change-Id: I2c41be721927c40a742e01476cd9a0f7650d38e6
Reviewed-on: https://go-review.googlesource.com/c/go/+/495917
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Bryan Mills <bcmills@google.com>
Run-TryBot: Austin Clements <austin@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Diffstat (limited to 'src/cmd/dist/test.go')
-rw-r--r-- | src/cmd/dist/test.go | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/src/cmd/dist/test.go b/src/cmd/dist/test.go index 0294a5babb..b6775cacbb 100644 --- a/src/cmd/dist/test.go +++ b/src/cmd/dist/test.go @@ -859,11 +859,7 @@ func (t *tester) registerTests() { t.registerCgoTests(cgoHeading) } - // Don't run these tests with $GO_GCFLAGS because most of them - // assume that they can run "go install" with no -gcflags and not - // recompile the entire standard library. If make.bash ran with - // special -gcflags, that's not true. - if t.cgoEnabled && gogcflags == "" { + if t.cgoEnabled { t.registerTest("cgo_testgodefs", cgoHeading, &goTest{pkg: "cmd/cgo/internal/testgodefs", timeout: 5 * time.Minute}) t.registerTest("cgo_testso", cgoHeading, &goTest{pkg: "cmd/cgo/internal/testso", timeout: 600 * time.Second}) |