]> Cypherpunks repositories - gostls13.git/commit
[release-branch.go1.25] 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>
Mon, 28 Jul 2025 17:58:29 +0000 (10:58 -0700)
commitc95d3093ca7f7b66453dbe67b4d210ffa5d83a9a
tree03250741d65b941f7035a5cf87d08def3ed3bf41
parent561964c9a8218b53086ba9951045151a9f18b59a
[release-branch.go1.25] 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>
(cherry picked from commit efc37e97c0f358f3cffe7ca2b78c743470345189)
Reviewed-on: https://go-review.googlesource.com/c/go/+/690895
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Bypass: Dmitri Shuralyov <dmitshur@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.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]