]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: enable printing of error URLs by default
authorRobert Griesemer <gri@golang.org>
Tue, 23 May 2023 23:45:37 +0000 (16:45 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 24 May 2023 01:57:07 +0000 (01:57 +0000)
Change-Id: Ib4094c70b8aa5e818f9f017c59d464d4c178169d
Reviewed-on: https://go-review.googlesource.com/c/go/+/497716
Auto-Submit: Robert Griesemer <gri@google.com>
Reviewed-by: Robert Griesemer <gri@google.com>
Reviewed-by: Carlos Amedee <carlos@golang.org>
Run-TryBot: Robert Griesemer <gri@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>

src/cmd/compile/internal/base/flag.go
src/cmd/internal/testdir/testdir_test.go

index 753a60ae1e591b53620295a431c22f14dba1a1dd..a5441ffac28a8e1e3a7deee55fbf57fb0264b8b8 100644 (file)
@@ -164,6 +164,7 @@ func ParseFlags() {
        Flag.LinkShared = &Ctxt.Flag_linkshared
        Flag.Shared = &Ctxt.Flag_shared
        Flag.WB = true
+       Flag.ErrorURL = true
 
        Debug.ConcurrentOk = true
        Debug.InlFuncsWithClosures = 1
index c86cc20a9cab81d2d85c0983712da9a2320cf022..d9f78f2f6a27b2ef2bf381df59982978009d1f42 100644 (file)
@@ -184,7 +184,7 @@ func compileInDir(runcmd runCmd, dir string, flags []string, importcfg string, p
        if importcfg == "" {
                importcfg = stdlibImportcfgFile()
        }
-       cmd := []string{goTool, "tool", "compile", "-e", "-D", "test", "-importcfg=" + importcfg}
+       cmd := []string{goTool, "tool", "compile", "-e", "-D", "test", "-errorurl=false", "-importcfg=" + importcfg}
        if pkgname == "main" {
                cmd = append(cmd, "-p=main")
        } else {
@@ -201,7 +201,7 @@ func compileInDir(runcmd runCmd, dir string, flags []string, importcfg string, p
        return runcmd(cmd...)
 }
 
-var stdlibImportcfgStringOnce sync.Once // TODO(#56102): Use sync.OnceValue once availabe. Also below.
+var stdlibImportcfgStringOnce sync.Once // TODO(#56102): Use sync.OnceValue once available. Also below.
 var stdlibImportcfgString string
 
 func stdlibImportcfg() string {
@@ -745,7 +745,7 @@ func (t test) run() error {
                // Fail if wantError is true and compilation was successful and vice versa.
                // Match errors produced by gc against errors in comments.
                // TODO(gri) remove need for -C (disable printing of columns in error messages)
-               cmdline := []string{goTool, "tool", "compile", "-p=p", "-d=panic", "-C", "-e", "-importcfg=" + stdlibImportcfgFile(), "-o", "a.o"}
+               cmdline := []string{goTool, "tool", "compile", "-p=p", "-d=panic", "-C", "-e", "-errorurl=false", "-importcfg=" + stdlibImportcfgFile(), "-o", "a.o"}
                // No need to add -dynlink even if linkshared if we're just checking for errors...
                cmdline = append(cmdline, flags...)
                cmdline = append(cmdline, long)