I'm having trouble building Go from source using a self-built Go compiler.
steps to reproduce:
- clone Go repo
cd src && ./all.bash- Build succeeds and tests pass, yay!

- Now use self-built Go to rebuild Go:
PATH="$PWD/../bin:$PATH" GOROOT_BOOTSTRAP="$PWD/.." all.bash
Expected: Build should succeed again
Actual:
Building Go cmd/dist using /home/max/workspace/googlesource.com/go/src/... (go1.22.12 linux/amd64)
++ false
++ [[ /home/max/workspace/googlesource.com/go/src/.. == \/\h\o\m\e\/\m\a\x\/\w\o\r\k\s\p\a\c\e\/\g\o\o\g\l\e\s\o\u\r\c\e\.\c\o\m\/\g\o ]]
++ rm -f cmd/dist/dist
++ GOROOT=/home/max/workspace/googlesource.com/go/src/..
++ nogoenv /home/max/workspace/googlesource.com/go/src/../bin/go build -o cmd/dist/dist ./cmd/dist
++ GO111MODULE=off
++ GOENV=off
++ GOOS=
++ GOARCH=
++ GOEXPERIMENT=
++ GOFLAGS=
++ /home/max/workspace/googlesource.com/go/src/../bin/go build -o cmd/dist/dist ./cmd/dist
go: no such tool "compile"
go: no such tool "compile"
go: no such tool "compile"
go: no such tool "compile"
go: no such tool "compile"
go: no such tool "compile"
go: no such tool "compile"
go: no such tool "compile"
fatal error: internal error: exit hook invoked exit
How do I fix this?