Skip to content

Commit

Permalink
cmd/dist: set buildvcs=false if not within a git repository
Browse files Browse the repository at this point in the history
When compiling without a Git repository, "go install" returns an error:

error obtaining VCS status: exit status 128
	Use -buildvcs=false to disable VCS stamping.

Set -buildvcs=false in go install when isGitDir() returns false.

Signed-off-by: Christian Stewart <christian@aperture.us>
  • Loading branch information
paralin committed Jul 27, 2023
1 parent 2c358ff commit 1e0a65f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/cmd/dist/buildtool.go
Expand Up @@ -213,6 +213,9 @@ func bootstrapBuildTools() {
if tool := os.Getenv("GOBOOTSTRAP_TOOLEXEC"); tool != "" {
cmd = append(cmd, "-toolexec="+tool)
}
if !isGitRepo() {
cmd = append(cmd, "-buildvcs=false")
}
cmd = append(cmd, "bootstrap/cmd/...")
run(base, ShowOutput|CheckExit, cmd...)

Expand Down

0 comments on commit 1e0a65f

Please sign in to comment.