]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: avoid darwin_amd64 assumption in debug prints
authorRuss Cox <rsc@golang.org>
Tue, 31 Oct 2017 13:59:29 +0000 (09:59 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 31 Oct 2017 16:25:52 +0000 (16:25 +0000)
Noted in CL 73212 review by crawshaw.
Neglected to update CL 73212 before submitting.

Also fix printing of target goos/goarch for cross-compile build.

Change-Id: If702f23071a4456810f1de6abb9115b38933c5c1
Reviewed-on: https://go-review.googlesource.com/74631
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
src/cmd/dist/build.go

index 7334fca7fddd7679518a91b56f412effb2eb510b..0a397a18af68db3248c9022327c05ebb1421214e 100644 (file)
@@ -1155,7 +1155,7 @@ func cmdbootstrap() {
        goInstall(toolchain...)
        if debug {
                run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
-               run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/../../darwin_amd64/runtime/internal/sys.a", tooldir))
+               run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
                copyfile(pathf("%s/compile2", tooldir), pathf("%s/compile", tooldir), writeExec)
        }
 
@@ -1183,7 +1183,7 @@ func cmdbootstrap() {
        goInstall(append([]string{"-a"}, toolchain...)...)
        if debug {
                run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
-               run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/../../darwin_amd64/runtime/internal/sys.a", tooldir))
+               run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
                copyfile(pathf("%s/compile3", tooldir), pathf("%s/compile", tooldir), writeExec)
        }
        checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
@@ -1212,19 +1212,19 @@ func cmdbootstrap() {
                if vflag > 0 {
                        xprintf("\n")
                }
-               xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
                goos = oldgoos
                goarch = oldgoarch
                os.Setenv("GOOS", goos)
                os.Setenv("GOARCH", goarch)
                os.Setenv("CC", defaultcctarget)
+               xprintf("Building packages and commands for target, %s/%s.\n", goos, goarch)
        }
        goInstall("std", "cmd")
        checkNotStale(goBootstrap, "std", "cmd")
        checkNotStale(cmdGo, "std", "cmd")
        if debug {
                run("", ShowOutput|CheckExit, pathf("%s/compile", tooldir), "-V=full")
-               run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/../../darwin_amd64/runtime/internal/sys.a", tooldir))
+               run("", ShowOutput|CheckExit, pathf("%s/buildid", tooldir), pathf("%s/pkg/%s_%s/runtime/internal/sys.a", goroot, goos, goarch))
                checkNotStale(goBootstrap, append(toolchain, "runtime/internal/sys")...)
                copyfile(pathf("%s/compile4", tooldir), pathf("%s/compile", tooldir), writeExec)
        }