]> Cypherpunks repositories - gostls13.git/commit
cmd/go/internal/tool: set Internal.ExeName on tool's package
authorMichael Matloob <matloob@golang.org>
Thu, 21 Nov 2024 18:16:43 +0000 (13:16 -0500)
committerMichael Matloob <matloob@golang.org>
Thu, 21 Nov 2024 19:44:18 +0000 (19:44 +0000)
commita86ea80197ed3bf0f276638a9ce079cbd2071d83
tree3868876a7de40903ab2a9410c5750e0219078b0c
parenta3a31ec8ed4aff33d9f5ef8358f9f74efb249f74
cmd/go/internal/tool: set Internal.ExeName on tool's package

While the cached name of an executable is set based on the base name of
the package path, the executable produced as the output of link doesn't
have ExeName set on it and is just called a.out (with a .exe suffix on
Windows). Set ExeName so that the first time the binary is run, from the
directory link is run in, it has the right name for ps.

For #48429

Change-Id: Ic049304ec6fd5b23c2f5aaaf91aa58d79fe5a7ba
Cq-Include-Trybots: luci.golang.try:gotip-linux-amd64-longtest,gotip-windows-amd64-longtest
Reviewed-on: https://go-review.googlesource.com/c/go/+/630695
Reviewed-by: Conrad Irwin <conrad.irwin@gmail.com>
Reviewed-by: Hongxiang Jiang <hxjiang@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/cmd/go/internal/tool/tool.go
src/cmd/go/testdata/script/tool_exename.txt [new file with mode: 0644]