]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go/internal/work: omit modinfo line from cache key when empty
authorBryan C. Mills <bcmills@google.com>
Fri, 1 Apr 2022 19:55:56 +0000 (15:55 -0400)
committerBryan Mills <bcmills@google.com>
Tue, 5 Apr 2022 14:16:39 +0000 (14:16 +0000)
Cache keys are dumped in case of mismatch; an empty modinfo string
adds noise to that dump without a corresponding benefit.

For #52009.

Change-Id: I1b4cd85fa5ff920973552fc94977954f93622a32
Reviewed-on: https://go-review.googlesource.com/c/go/+/398059
Trust: Bryan Mills <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/internal/work/exec.go

index 4252209f1002fd4a4a8e062c32f44c2342802a5f..0c8e1dcdafd12b45af54ebf19c568c315cfd178d 100644 (file)
@@ -303,7 +303,9 @@ func (b *Builder) buildActionID(a *Action) cache.ActionID {
                        fmt.Fprintf(h, "fuzz %q\n", fuzzFlags)
                }
        }
-       fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo)
+       if p.Internal.BuildInfo != "" {
+               fmt.Fprintf(h, "modinfo %q\n", p.Internal.BuildInfo)
+       }
 
        // Configuration specific to compiler toolchain.
        switch cfg.BuildToolchainName {