]> Cypherpunks repositories - gostls13.git/commit
cmd/go: always return the cached path from go tool -n
authorMichael Matloob <matloob@golang.org>
Fri, 18 Jul 2025 18:14:16 +0000 (14:14 -0400)
committerGopher Robot <gobot@golang.org>
Thu, 24 Jul 2025 15:59:40 +0000 (08:59 -0700)
commitefc37e97c0f358f3cffe7ca2b78c743470345189
tree3d38ca731bdcbe5d2a64d19a223642e0ec132e9b
parent98a031193b93d7b0e8353810351c9544250e7bcd
cmd/go: always return the cached path from go tool -n

If we're running go tool -n always return the cached path of the tool.
We can't always use the cached path when running the tool because if we
copied the tool to the cached location in the same process and then try
to run it we'll run into #22315, producing spurious ETXTBSYs.

Fixes #72824

Change-Id: I81f23773b9028f955ccc97453627ae4f2573814b
Reviewed-on: https://go-review.googlesource.com/c/go/+/688895
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Michael Matloob <matloob@google.com>
Reviewed-by: Michael Pratt <mpratt@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/tool/tool.go
src/cmd/go/internal/work/action.go
src/cmd/go/internal/work/buildid.go
src/cmd/go/testdata/script/tool_n_issue72824.txt [new file with mode: 0644]