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 {