Skip to content

Commit d54f663

Browse files
author
Bryan C. Mills
committed
cmd/go: remove the -buildinfo flag
Fixes #50501 (in a sense, by removing a flag that looks like it should do something it does not) Change-Id: I69ae4862706a6283cda4016fd43b361bb21557f9 Reviewed-on: https://go-review.googlesource.com/c/go/+/378576 Trust: Bryan Mills <[email protected]> Run-TryBot: Bryan Mills <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Reviewed-by: Russ Cox <[email protected]>
1 parent 5b3ebc8 commit d54f663

File tree

5 files changed

+4
-16
lines changed

5 files changed

+4
-16
lines changed

src/cmd/go/alldocs.go

Lines changed: 1 addition & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/cmd/go/go_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1387,7 +1387,7 @@ func TestLdFlagsLongArgumentsIssue42295(t *testing.T) {
13871387
for buf.Len() < sys.ExecArgLengthLimit+1 {
13881388
buf.WriteString(testStr)
13891389
}
1390-
tg.run("run", "-buildinfo=false", "-ldflags", fmt.Sprintf(`-X "main.extern=%s"`, buf.String()), tg.path("main.go"))
1390+
tg.run("run", "-ldflags", fmt.Sprintf(`-X "main.extern=%s"`, buf.String()), tg.path("main.go"))
13911391
if tg.stderr.String() != buf.String() {
13921392
t.Errorf("strings differ")
13931393
}

src/cmd/go/internal/cfg/cfg.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import (
2525
// These are general "build flags" used by build and other commands.
2626
var (
2727
BuildA bool // -a flag
28-
BuildBuildinfo bool // -buildinfo flag
2928
BuildBuildmode string // -buildmode flag
3029
BuildBuildvcs bool // -buildvcs flag
3130
BuildContext = defaultContext()

src/cmd/go/internal/load/pkg.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2292,7 +2292,7 @@ func (p *Package) setBuildInfo() {
22922292
// Add command-line flags relevant to the build.
22932293
// This is informational, not an exhaustive list.
22942294
// Please keep the list sorted.
2295-
if cfg.BuildBuildinfo && !p.Standard {
2295+
if !p.Standard {
22962296
if cfg.BuildASan {
22972297
appendSetting("-asan", "true")
22982298
}

src/cmd/go/internal/work/build.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,19 +88,14 @@ and test commands:
8888
8989
-asmflags '[pattern=]arg list'
9090
arguments to pass on each go tool asm invocation.
91-
-buildinfo
92-
Whether to stamp binaries with build flags. By default, the compiler name
93-
(gc or gccgo), toolchain flags (like -gcflags), and environment variables
94-
containing flags (like CGO_CFLAGS) are stamped into binaries. Use
95-
-buildinfo=false to omit build information. See also -buildvcs.
9691
-buildmode mode
9792
build mode to use. See 'go help buildmode' for more.
9893
-buildvcs
9994
Whether to stamp binaries with version control information. By default,
10095
version control information is stamped into a binary if the main package
10196
and the main module containing it are in the repository containing the
10297
current directory (if there is a repository). Use -buildvcs=false to
103-
omit version control information. See also -buildinfo.
98+
omit version control information.
10499
-compiler name
105100
name of compiler to use, as in runtime.Compiler (gccgo or gc).
106101
-gccgoflags '[pattern=]arg list'
@@ -317,7 +312,6 @@ func AddBuildFlags(cmd *base.Command, mask BuildFlagMask) {
317312
cmd.Flag.Var((*base.StringsFlag)(&cfg.BuildToolexec), "toolexec", "")
318313
cmd.Flag.BoolVar(&cfg.BuildTrimpath, "trimpath", false, "")
319314
cmd.Flag.BoolVar(&cfg.BuildWork, "work", false, "")
320-
cmd.Flag.BoolVar(&cfg.BuildBuildinfo, "buildinfo", true, "")
321315
cmd.Flag.BoolVar(&cfg.BuildBuildvcs, "buildvcs", true, "")
322316

323317
// Undocumented, unstable debugging flags.

0 commit comments

Comments
 (0)