Skip to content

Commit 040855e

Browse files
committed
test: restore no-gogcflags build shortcut, save time
With a clean cache on a laptop before change time go run run.go -- . fixedbugs real 2m10.195s user 3m16.547s sys 1m52.939s Or, before, directly after make.bash (the actual use case we care about) time go run run.go -- . fixedbugs real 2m8.704s user 3m12.327s sys 1m49.123s after change time go run run.go -- . fixedbugs real 1m38.915s user 2m38.389s sys 1m8.490s Tests, fortunately, still seem to pass. Latest version of this takes the slow route for cross-compilation, which includes wasm. Change-Id: Iad19951612defa96c4e9830bce920c5e8733834a Reviewed-on: https://go-review.googlesource.com/c/go/+/223083 Run-TryBot: David Chase <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Cherry Zhang <[email protected]>
1 parent 938ad55 commit 040855e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

test/run.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,10 @@ func goGcflags() string {
462462
return "-gcflags=all=" + os.Getenv("GO_GCFLAGS")
463463
}
464464

465+
func goGcflagsIsEmpty() bool {
466+
return "" == os.Getenv("GO_GCFLAGS")
467+
}
468+
465469
// run runs a test.
466470
func (t *test) run() {
467471
start := time.Now()
@@ -1002,7 +1006,7 @@ func (t *test) run() {
10021006
useTmp = false
10031007
var out []byte
10041008
var err error
1005-
if len(flags)+len(args) == 0 && goGcflags() == "" && !*linkshared {
1009+
if len(flags)+len(args) == 0 && goGcflagsIsEmpty() && !*linkshared && goarch == runtime.GOARCH && goos == runtime.GOOS {
10061010
// If we're not using special go command flags,
10071011
// skip all the go command machinery.
10081012
// This avoids any time the go command would

0 commit comments

Comments
 (0)