]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: provide full path as os.Args[0] when invoking tools
authorShenghou Ma <minux@golang.org>
Fri, 11 Sep 2015 04:26:50 +0000 (00:26 -0400)
committerMinux Ma <minux@golang.org>
Fri, 18 Sep 2015 01:55:22 +0000 (01:55 +0000)
cmd/dist needs to re-exec or open itself to detect GOARM (CL 3973) and
detect host machine endianness (CL 14460).

Change-Id: If6438831ab0715ba8e236d64bb2c7c1bde1470aa
Reviewed-on: https://go-review.googlesource.com/14476
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/go/tool.go

index 937ca1f306cf025eb5124c6cfc86950d8c132e83..9ff0dcfb12916b87283de85620dbbffe5f7f1a5d 100644 (file)
@@ -98,6 +98,7 @@ func runTool(cmd *Command, args []string) {
                fmt.Printf("%s\n", cmd)
                return
        }
+       args[0] = toolPath // in case the tool wants to re-exec itself, e.g. cmd/dist
        toolCmd := &exec.Cmd{
                Path:   toolPath,
                Args:   args,