From a32ec7a3b859a51521d59dfd8a74fe09f23720b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Mart=C3=AD?= Date: Tue, 11 Jan 2022 21:25:05 +0000 Subject: [PATCH] remove the use of -buildinfo=false It looks like the flag will be scrapped from Go 1.18. Stop using it before 1.18rc1 releases without it. See: https://github.com/golang/go/issues/50501#issuecomment-1010225207 --- main.go | 13 ++++--------- shared.go | 2 +- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/main.go b/main.go index dabfe2cf..4383d428 100644 --- a/main.go +++ b/main.go @@ -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 != "" { @@ -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, @@ -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) diff --git a/shared.go b/shared.go index 7beda3c3..c5810949 100644 --- a/shared.go +++ b/shared.go @@ -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...)