]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: write and use a go.mod file in the bootstrap directory
authorBryan C. Mills <bcmills@google.com>
Tue, 12 Mar 2019 04:26:24 +0000 (00:26 -0400)
committerBryan C. Mills <bcmills@google.com>
Tue, 12 Mar 2019 15:43:46 +0000 (15:43 +0000)
Updates #30228

Change-Id: Ica28525b31a8a787875c147e16274eba8f4dbffc
Reviewed-on: https://go-review.googlesource.com/c/go/+/167078
Run-TryBot: Bryan C. Mills <bcmills@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Jay Conrod <jayconrod@google.com>
src/cmd/dist/buildtool.go

index 71ed4ba8bc7c10e296046901f1e10adac638f90a..2f2453fd1290c2799353dfd932b1d8cb4413ba40 100644 (file)
@@ -131,6 +131,7 @@ func bootstrapBuildTools() {
        xmkdirall(base)
 
        // Copy source code into $GOROOT/pkg/bootstrap and rewrite import paths.
+       writefile("module bootstrap\n", pathf("%s/%s", base, "go.mod"), 0)
        for _, dir := range bootstrapDirs {
                src := pathf("%s/src/%s", goroot, dir)
                dst := pathf("%s/%s", base, dir)
@@ -204,7 +205,7 @@ func bootstrapBuildTools() {
                cmd = append(cmd, "-toolexec="+tool)
        }
        cmd = append(cmd, "bootstrap/cmd/...")
-       run(workspace, ShowOutput|CheckExit, cmd...)
+       run(base, ShowOutput|CheckExit, cmd...)
 
        // Copy binaries into tool binary directory.
        for _, name := range bootstrapDirs {