Closed
Description
commit 1cbec68
The Go compiler refuses to build my usual executables without specifying the -buildvcs=false
flag.
Here's a testscript
reproducer:
mkdir d/.bzr
cd d/m
exec git init
go build
-- d/m/go.mod --
module m
go 1.18
-- d/m/main.go --
package main
func main() {
}
This fails as follows:
% testscript /tmp/build-bug.txtar
> mkdir d/.bzr
> cd d/m
$WORK/d/m
> exec git init
[stdout]
Initialized empty Git repository in $WORK/d/m/.git/
> go build
[stderr]
error obtaining VCS status: directory "$WORK/d/m" uses git, but parent "$WORK/d" uses bzr
Use -buildvcs=false to disable VCS stamping.
[exit status 1]
FAIL: /tmp/testscript742157310/build-bug.txtar/script.txt:4: unexpected go command failure
error running /tmp/build-bug.txtar in /tmp/testscript742157310/build-bug.txtar
When the nearest VCS directory is at the root of the current module, I believe it should be taken as definitive and the search should go no further back into parent directories.