]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist, cmd/internal/metadata: don't install metadata binary
authorCherry Mui <cherryyz@google.com>
Thu, 9 Jun 2022 21:30:05 +0000 (17:30 -0400)
committerCherry Mui <cherryyz@google.com>
Fri, 10 Jun 2022 20:39:12 +0000 (20:39 +0000)
It is only needed by cmd/dist, no need to build and install the
binary.

Change-Id: I6aba6b81496406077a0efba255c35020cff9d351
Reviewed-on: https://go-review.googlesource.com/c/go/+/411534
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Michael Pratt <mpratt@google.com>
Run-TryBot: Cherry Mui <cherryyz@google.com>

src/cmd/dist/test.go
src/cmd/internal/metadata/main.go

index 677be336ac4e4100496a6f38d459159142361164..26d7fe0f73760b8c49e8c3190df9cc82600fd439 100644 (file)
@@ -290,7 +290,7 @@ func (t *tester) maybeLogMetadata() error {
        //
        // TODO(prattmic): If we split dist bootstrap and dist test then this
        // could be simplified to directly use internal/sysinfo here.
-       return t.dirCmd(filepath.Join(goroot, "src/cmd/internal/metadata"), "go", []string{"run", "."}).Run()
+       return t.dirCmd(filepath.Join(goroot, "src/cmd/internal/metadata"), "go", []string{"run", "main.go"}).Run()
 }
 
 // short returns a -short flag value to use with 'go test'
index 157226e890148f59122724969e103e7321b8c5b4..7478eec1c9b516629d4007f2c728d1b0e8f17d3d 100644 (file)
@@ -5,6 +5,12 @@
 // Metadata prints basic system metadata to include in test logs. This is
 // separate from cmd/dist so it does not need to build with the bootstrap
 // toolchain.
+
+// This program is only used by cmd/dist. Add an "ignore" build tag so it
+// is not installed. cmd/dist does "go run main.go" directly.
+
+//go:build ignore
+
 package main
 
 import (