]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/distpack: use positive list of tools to keep
authorMichael Matloob <matloob@golang.org>
Fri, 16 May 2025 23:53:21 +0000 (19:53 -0400)
committerMichael Matloob <matloob@google.com>
Mon, 19 May 2025 17:20:17 +0000 (10:20 -0700)
Previously, distpack filtered out tools from the packaged distribution
using a list of tools to remove. Instead follow mpratt's suggestion on
CL 666755 and instead filter out tools that are not on a list of tools
to keep. This will make it easier to tell which tools are actually in
the distribution.

For #71867

Change-Id: I8336465703ac820028c3381a0a743c457997e78a
Reviewed-on: https://go-review.googlesource.com/c/go/+/673696
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
Reviewed-by: Michael Matloob <matloob@google.com>
src/cmd/distpack/pack.go

index fd091c1ebb2037c7f9b2503f6ba4dae2d5609c19..8e0b58af216a342342d215946b374e87a90a8973 100644 (file)
@@ -167,11 +167,11 @@ func main() {
                        if !strings.HasPrefix(name, "pkg/tool/"+goosUnderGoarch+"/") {
                                return false
                        }
-                       // Inside pkg/tool/$GOOS_$GOARCH, discard helper tools, and tools not needed for builds.
+                       // Inside pkg/tool/$GOOS_$GOARCH, keep only tools needed for build actions.
                        switch strings.TrimSuffix(path.Base(name), ".exe") {
-                       case "addr2line", "api", "buildid", "covdata", "dist", "distpack", "doc", "fix",
-                               "metadata", "nm", "objdump", "pprof", "test2json", "trace":
+                       default:
                                return false
+                       case "asm", "cgo", "compile", "cover", "link", "pack", "preprofile", "vet":
                        }
                }
                return true