Related: #54852 - cc @williamh @bcmills
In Buildroot we have a build failure when there exists an invalid .git in a parent directory of GOROOT_BOOTSTRAP: https://gitlab.com/buildroot.org/buildroot/-/jobs/4725186525
Building Go toolchain1 using /builds/buildroot.org/buildroot/test-output/TestMender/host/lib/go-1.19.10.
error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
error obtaining VCS status: exit status 128
Use -buildvcs=false to disable VCS stamping.
go tool dist: FAILED: /builds/buildroot.org/buildroot/test-output/TestMender/host/lib/go-1.19.10/bin/go install -tags=math_big_pure_go compiler_bootstrap purego bootstrap/cmd/...: exit status 1
Reproduction of the issue:
# This reproduction sets up a directory structure that breaks Go make.bash.
# make.bash should not break due to .git files outside of the Go sources.
#
# The error specifically occurs when an invalid .git is present in a parent git
# directory of the GOROOT_BOOTSTRAP. Go issue #61620
mkdir go-issue-61620
cd ./go-issue-61620
wget https://go.dev/dl/go1.19.11.src.tar.gz
mkdir go-bootstrap
tar -xf go1.19.11.src.tar.gz -C ./go-bootstrap --strip-components=1
cd ./go-bootstrap/src/
bash make.bash
cd ../../
wget https://go.dev/dl/go1.20.6.src.tar.gz
mkdir go
tar -xf go1.20.6.src.tar.gz -C ./go/ --strip-components=1
printf "gitdir: ../../does/not/exist/.git" > ./.git
cd ./go/src/
GOROOT_BOOTSTRAP=$(pwd)/../../go-bootstrap/ bash make.bash
# Build fails using -buildvcs=false errors.
The error only occurs when the .git that git detects in the parent directory
of the GOROOT_BOOTSTRAP is invalid or not present causing errors when running git commands within GOROOT_BOOTSTRAP.
Related: #54852 - cc @williamh @bcmills
In Buildroot we have a build failure when there exists an invalid .git in a parent directory of GOROOT_BOOTSTRAP: https://gitlab.com/buildroot.org/buildroot/-/jobs/4725186525
Reproduction of the issue:
The error only occurs when the .git that git detects in the parent directory
of the GOROOT_BOOTSTRAP is invalid or not present causing errors when running
gitcommands within GOROOT_BOOTSTRAP.