1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:18:32 -06:00

cmd/toolstash: don't try comparing "compile -V=full" output

Fixes golang/go#22552.

Change-Id: I2a31cf4fe85f33068502102031ed62f06abb6d6e
Reviewed-on: https://go-review.googlesource.com/75670
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Matthew Dempsky 2017-11-02 15:27:13 -07:00
parent 9b61fcc4c5
commit d620ba0fbb

View File

@ -174,9 +174,16 @@ var (
binDir string
)
func canCmp(name string) bool {
func canCmp(name string, args []string) bool {
switch name {
case "compile", "link", "asm":
case "compile":
if len(args) == 1 && (args[0] == "-V" || strings.HasPrefix(args[0], "-V=")) {
// cmd/go uses "compile -V=full" to query the
// compiler's build ID.
return false
}
return true
case "link", "asm":
return true
}
return len(name) == 2 && '0' <= name[0] && name[0] <= '9' && (name[1] == 'a' || name[1] == 'g' || name[1] == 'l')
@ -235,7 +242,7 @@ func main() {
os.Exit(2)
}
if *cmp && canCmp(tool) {
if *cmp && canCmp(tool, cmd[1:]) {
compareTool()
return
}