From: Michael Matloob Date: Fri, 16 May 2025 23:53:21 +0000 (-0400) Subject: cmd/distpack: use positive list of tools to keep X-Git-Tag: go1.25rc1~238 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=bd299852121f997b8bff3c9de244df27427819f3;p=gostls13.git cmd/distpack: use positive list of tools to keep 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 Reviewed-by: Michael Pratt Reviewed-by: Michael Matloob --- diff --git a/src/cmd/distpack/pack.go b/src/cmd/distpack/pack.go index fd091c1ebb..8e0b58af21 100644 --- a/src/cmd/distpack/pack.go +++ b/src/cmd/distpack/pack.go @@ -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