From 781da440912c095e61b9e5a95e5b068062b150a9 Mon Sep 17 00:00:00 2001 From: "Bryan C. Mills" Date: Tue, 12 Mar 2019 00:26:24 -0400 Subject: [PATCH] cmd/dist: write and use a go.mod file in the bootstrap directory Updates #30228 Change-Id: Ica28525b31a8a787875c147e16274eba8f4dbffc Reviewed-on: https://go-review.googlesource.com/c/go/+/167078 Run-TryBot: Bryan C. Mills TryBot-Result: Gobot Gobot Reviewed-by: Jay Conrod --- src/cmd/dist/buildtool.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cmd/dist/buildtool.go b/src/cmd/dist/buildtool.go index 71ed4ba8bc..2f2453fd12 100644 --- a/src/cmd/dist/buildtool.go +++ b/src/cmd/dist/buildtool.go @@ -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 { -- 2.48.1