]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: remove the -buildinfo flag
authorBryan C. Mills <bcmills@google.com>
Fri, 14 Jan 2022 16:23:59 +0000 (11:23 -0500)
committerBryan Mills <bcmills@google.com>
Tue, 18 Jan 2022 18:06:50 +0000 (18:06 +0000)
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 <bcmills@google.com>
Run-TryBot: Bryan Mills <bcmills@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/go/alldocs.go
src/cmd/go/go_test.go
src/cmd/go/internal/cfg/cfg.go
src/cmd/go/internal/load/pkg.go
src/cmd/go/internal/work/build.go

index 3bb9d146b21ae44568ba8e039c1374fefe78474f..1d3098a76e4597c7f12cf00506ce372e225fa513 100644 (file)
 //
 //     -asmflags '[pattern=]arg list'
 //             arguments to pass on each go tool asm invocation.
-//     -buildinfo
-//             Whether to stamp binaries with build flags. By default, the compiler name
-//             (gc or gccgo), toolchain flags (like -gcflags), and environment variables
-//             containing flags (like CGO_CFLAGS) are stamped into binaries. Use
-//             -buildinfo=false to omit build information. See also -buildvcs.
 //     -buildmode mode
 //             build mode to use. See 'go help buildmode' for more.
 //     -buildvcs
 //             version control information is stamped into a binary if the main package
 //             and the main module containing it are in the repository containing the
 //             current directory (if there is a repository). Use -buildvcs=false to
-//             omit version control information. See also -buildinfo.
+//             omit version control information.
 //     -compiler name
 //             name of compiler to use, as in runtime.Compiler (gccgo or gc).
 //     -gccgoflags '[pattern=]arg list'
index 170c882df9e77158b9591370411bc6f728018825..7aaec4eb9864e8a3bd50ef5fa146eff5625ac5df 100644 (file)
@@ -1387,7 +1387,7 @@ func TestLdFlagsLongArgumentsIssue42295(t *testing.T) {
        for buf.Len() < sys.ExecArgLengthLimit+1 {
                buf.WriteString(testStr)
        }
-       tg.run("run", "-buildinfo=false", "-ldflags", fmt.Sprintf(`-X "main.extern=%s"`, buf.String()), tg.path("main.go"))
+       tg.run("run", "-ldflags", fmt.Sprintf(`-X "main.extern=%s"`, buf.String()), tg.path("main.go"))
        if tg.stderr.String() != buf.String() {
                t.Errorf("strings differ")
        }
index 5b84d8be92117993e32047ae0dc97c3747ad6c3d..7f68d7bb62839edb9a6d535773e299e49e138181 100644 (file)
@@ -25,7 +25,6 @@ import (
 // These are general "build flags" used by build and other commands.
 var (
        BuildA                 bool   // -a flag
-       BuildBuildinfo         bool   // -buildinfo flag
        BuildBuildmode         string // -buildmode flag
        BuildBuildvcs          bool   // -buildvcs flag
        BuildContext           = defaultContext()
index a891d601b1d4fdf62faebaa6eb5f6cd3b492ee79..fca9d5a0a296c83a4e3c236b0b779adead038134 100644 (file)
@@ -2292,7 +2292,7 @@ func (p *Package) setBuildInfo() {
        // Add command-line flags relevant to the build.
        // This is informational, not an exhaustive list.
        // Please keep the list sorted.
-       if cfg.BuildBuildinfo && !p.Standard {
+       if !p.Standard {
                if cfg.BuildASan {
                        appendSetting("-asan", "true")
                }
index 9b1acf987d0569eb7ea3a2b9946e3aa27f182b85..56648338c553c47e2c4f664acd278d926a78fcee 100644 (file)
@@ -88,11 +88,6 @@ and test commands:
 
        -asmflags '[pattern=]arg list'
                arguments to pass on each go tool asm invocation.
-       -buildinfo
-               Whether to stamp binaries with build flags. By default, the compiler name
-               (gc or gccgo), toolchain flags (like -gcflags), and environment variables
-               containing flags (like CGO_CFLAGS) are stamped into binaries. Use
-               -buildinfo=false to omit build information. See also -buildvcs.
        -buildmode mode
                build mode to use. See 'go help buildmode' for more.
        -buildvcs
@@ -100,7 +95,7 @@ and test commands:
                version control information is stamped into a binary if the main package
                and the main module containing it are in the repository containing the
                current directory (if there is a repository). Use -buildvcs=false to
-               omit version control information. See also -buildinfo.
+               omit version control information.
        -compiler name
                name of compiler to use, as in runtime.Compiler (gccgo or gc).
        -gccgoflags '[pattern=]arg list'
@@ -317,7 +312,6 @@ func AddBuildFlags(cmd *base.Command, mask BuildFlagMask) {
        cmd.Flag.Var((*base.StringsFlag)(&cfg.BuildToolexec), "toolexec", "")
        cmd.Flag.BoolVar(&cfg.BuildTrimpath, "trimpath", false, "")
        cmd.Flag.BoolVar(&cfg.BuildWork, "work", false, "")
-       cmd.Flag.BoolVar(&cfg.BuildBuildinfo, "buildinfo", true, "")
        cmd.Flag.BoolVar(&cfg.BuildBuildvcs, "buildvcs", true, "")
 
        // Undocumented, unstable debugging flags.