Skip to content

Commit

Permalink
remove the use of -buildinfo=false
Browse files Browse the repository at this point in the history
It looks like the flag will be scrapped from Go 1.18.
Stop using it before 1.18rc1 releases without it.

See: golang/go#50501 (comment)
  • Loading branch information
mvdan committed Jan 11, 2022
1 parent d25e718 commit a32ec7a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 10 deletions.
13 changes: 4 additions & 9 deletions main.go
Expand Up @@ -499,10 +499,7 @@ This command wraps "go %s". Below is its help:
}
if semver.Compare(goVersionSemver, "v1.18.0") >= 0 {
// TODO: remove the conditional once we drop support for 1.17
goArgs = append(goArgs,
"-buildinfo=false",
"-buildvcs=false",
)
goArgs = append(goArgs, "-buildvcs=false")
}
goArgs = append(goArgs, toolexecFlag.String())
if flagDebugDir != "" {
Expand Down Expand Up @@ -1821,10 +1818,9 @@ var forwardBuildFlags = map[string]bool{
"-v": false,

// These are always set by garble.
"-trimpath": false,
"-toolexec": false,
"-buildinfo": false,
"-buildvcs": false,
"-trimpath": false,
"-toolexec": false,
"-buildvcs": false,

"-p": true,
"-race": true,
Expand Down Expand Up @@ -1862,7 +1858,6 @@ var booleanFlags = map[string]bool{
"-linkshared": true,
"-modcacherw": true,
"-trimpath": true,
"-buildinfo": true,
"-buildvcs": true,

// Test flags (TODO: support its special -args flag)
Expand Down
2 changes: 1 addition & 1 deletion shared.go
Expand Up @@ -163,7 +163,7 @@ func (p *listedPackage) obfuscatedImportPath() string {
func appendListedPackages(patterns ...string) error {
startTime := time.Now()
// TODO: perhaps include all top-level build flags set by garble,
// including -buildinfo=false and -buildvcs=false.
// including -buildvcs=false.
// They shouldn't affect "go list" here, but might as well be consistent.
args := []string{"list", "-json", "-deps", "-export", "-trimpath"}
args = append(args, cache.ForwardBuildFlags...)
Expand Down

0 comments on commit a32ec7a

Please sign in to comment.