]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: include default GOEXPERIMENT in build config
authorCherry Zhang <cherryyz@google.com>
Fri, 12 Mar 2021 16:21:38 +0000 (11:21 -0500)
committerCherry Zhang <cherryyz@google.com>
Fri, 12 Mar 2021 16:51:16 +0000 (16:51 +0000)
Currently, the build config includes GOEXPERIMENT environment
variable if it is not empty, but that doesn't take the default
value (set at make.bash/bat/rc time) into consideration. This
may cause standard library packages appearing stale, as the
build config appears changed.

This CL changes it to use cfg.GOEXPERIMENT variable, which
includes the default value (if it is not overwritten).

May fix regabi and staticlockranking builders.

Change-Id: I242f887167f8e99192010be5c1a046eb88ab0c2a
Reviewed-on: https://go-review.googlesource.com/c/go/+/301269
Trust: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
Reviewed-by: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/go/internal/work/exec.go

index bd5ae467393b498413d2bdffccc2bd11cf534156..fd3d3e03bb950079282dac5c34e8c7e35ee16f44 100644 (file)
@@ -276,7 +276,7 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
                key, val := cfg.GetArchEnv()
                fmt.Fprintf(h, "%s=%s\n", key, val)
 
-               if exp := cfg.Getenv("GOEXPERIMENT"); exp != "" {
+               if exp := cfg.GOEXPERIMENT; exp != "" {
                        fmt.Fprintf(h, "GOEXPERIMENT=%q\n", exp)
                }
 
@@ -1250,7 +1250,7 @@ func (b *Builder) printLinkerConfig(h io.Writer, p *load.Package) {
                key, val := cfg.GetArchEnv()
                fmt.Fprintf(h, "%s=%s\n", key, val)
 
-               if exp := cfg.Getenv("GOEXPERIMENT"); exp != "" {
+               if exp := cfg.GOEXPERIMENT; exp != "" {
                        fmt.Fprintf(h, "GOEXPERIMENT=%q\n", exp)
                }