My build system downloads 1.4, downloads newer source, patches it, and then runs ./make.bash. It does this because I have custom patches that require a full rebuild (I can no longer just rebuild cmd/link or similar). I've automated all of this nicely in my makefile, which downloads tarballs, checks hashes, runs build commands, and ultimately .deps/go/bin/go exists and works. The rest of my build system then runs with export PATH := $(CURDIR)/.deps/go/bin:$(PATH). All is well.
Except for one thing: src/cmd/dist/build.go errors out if you're building in a child directory of something with a go.mod in it: fatalf("found go.mod file in %s: $GOROOT must not be inside a module", modRoot). So that means my makefile has to rename go.mod to go.mod.renamed, or struggle to find a good tmp directory on the same partition for atomic moves or some other type of headache.
Instead, it would be nice to be able to run ./make.bash anywhere, regardless of what the parent directories have in them.
Are there any big architectural reasons why this can't be?
My build system downloads 1.4, downloads newer source, patches it, and then runs ./make.bash. It does this because I have custom patches that require a full rebuild (I can no longer just rebuild cmd/link or similar). I've automated all of this nicely in my makefile, which downloads tarballs, checks hashes, runs build commands, and ultimately
.deps/go/bin/goexists and works. The rest of my build system then runs withexport PATH := $(CURDIR)/.deps/go/bin:$(PATH). All is well.Except for one thing: src/cmd/dist/build.go errors out if you're building in a child directory of something with a go.mod in it:
fatalf("found go.mod file in %s: $GOROOT must not be inside a module", modRoot). So that means my makefile has to rename go.mod to go.mod.renamed, or struggle to find a good tmp directory on the same partition for atomic moves or some other type of headache.Instead, it would be nice to be able to run
./make.bashanywhere, regardless of what the parent directories have in them.Are there any big architectural reasons why this can't be?