Skip to content

Commit

Permalink
cmd/dist, cmd/internal/metadata: don't install metadata binary
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
cherrymui committed Jun 10, 2022
1 parent 386245b commit fb75c2d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/cmd/dist/test.go
Expand Up @@ -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'
Expand Down
6 changes: 6 additions & 0 deletions src/cmd/internal/metadata/main.go
Expand Up @@ -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 (
Expand Down

0 comments on commit fb75c2d

Please sign in to comment.