Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/cmd/distpack/pack.go
Original file line number Diff line number Diff line change
Expand Up @@ -167,9 +167,10 @@ func main() {
if !strings.HasPrefix(name, "pkg/tool/"+goosUnderGoarch+"/") {
return false
}
// Inside pkg/tool/$GOOS_$GOARCH, discard helper tools.
// Inside pkg/tool/$GOOS_$GOARCH, discard helper tools, and tools not needed for builds.
switch strings.TrimSuffix(path.Base(name), ".exe") {
case "api", "dist", "distpack", "metadata":
case "addr2line", "api", "buildid", "covdata", "dist", "distpack", "doc", "fix",
"metadata", "nm", "objdump", "pprof", "test2json", "trace":
return false
}
}
Expand Down
3 changes: 2 additions & 1 deletion src/cmd/go/internal/doc/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"cmd/go/internal/base"
"cmd/go/internal/cfg"
"context"
"path/filepath"
)

var CmdDoc = &base.Command{
Expand Down Expand Up @@ -130,5 +131,5 @@ Flags:
}

func runDoc(ctx context.Context, cmd *base.Command, args []string) {
base.Run(cfg.BuildToolexec, base.Tool("doc"), args)
base.Run(cfg.BuildToolexec, filepath.Join(cfg.GOROOTbin, "go"), "tool", "doc", args)
}
3 changes: 2 additions & 1 deletion src/cmd/go/internal/fix/fix.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"fmt"
"go/build"
"os"
"path/filepath"
)

var CmdFix = &base.Command{
Expand Down Expand Up @@ -80,6 +81,6 @@ func runFix(ctx context.Context, cmd *base.Command, args []string) {
if *fixes != "" {
fixArg = []string{"-r=" + *fixes}
}
base.Run(str.StringList(cfg.BuildToolexec, base.Tool("fix"), "-go="+goVersion, fixArg, files))
base.Run(str.StringList(cfg.BuildToolexec, filepath.Join(cfg.GOROOTbin, "go"), "tool", "fix", "-go="+goVersion, fixArg, files))
}
}
2 changes: 1 addition & 1 deletion src/cmd/go/internal/work/buildid.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ func (b *Builder) updateBuildID(a *Action, target string) error {
sh := b.Shell(a)

if cfg.BuildX || cfg.BuildN {
sh.ShowCmd("", "%s # internal", joinUnambiguously(str.StringList(base.Tool("buildid"), "-w", target)))
sh.ShowCmd("", "%s # internal", joinUnambiguously(str.StringList("go", "tool", "buildid", "-w", target)))
if cfg.BuildN {
return nil
}
Expand Down
3 changes: 1 addition & 2 deletions src/cmd/go/internal/work/cover.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
package work

import (
"cmd/go/internal/base"
"cmd/go/internal/cfg"
"cmd/go/internal/str"
"cmd/internal/cov/covcmd"
Expand All @@ -25,7 +24,7 @@ import (
func (b *Builder) CovData(a *Action, cmdargs ...any) ([]byte, error) {
cmdline := str.StringList(cmdargs...)
args := append([]string{}, cfg.BuildToolexec...)
args = append(args, base.Tool("covdata"))
args = append(args, "go", "tool", "covdata")
args = append(args, cmdline...)
return b.Shell(a).runOut(a.Objdir, nil, args)
}
Expand Down