aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitri Shuralyov <dmitshur@golang.org>2023-06-16 09:03:11 -0400
committerGopher Robot <gobot@golang.org>2023-06-16 16:01:47 +0000
commit4eceefa3388c11afc2b71302de53cac921f7f439 (patch)
tree4bbca5f37b23b9dba1975a5c7979e426dc361dd7
parent1a7709d6af76c06d465c5e969b502fc206f8e687 (diff)
downloadgo-4eceefa3388c11afc2b71302de53cac921f7f439.tar.gz
go-4eceefa3388c11afc2b71302de53cac921f7f439.zip
cmd/distpack: make go_$GOOS_$GOARCH_exec programs executable
The go command recognizes when a program named go_$GOOS_$GOARCH_exec is in PATH. There are two such programs living in GOROOT/misc/wasm. Like GOROOT/bin/{go,gofmt} and GOROOT/pkg/tool/**, these programs need to have the executable bit set to do their job, so set it. Comparing a distpack produced before and after this change shows that the pack.go file is modified, the two go_{js,wasip1}_wasm_exec programs have the new file mode, and there are no other changes, as expected. The mode change is relevant to the binary and source distributions only. No change to the module zip since it doesn't include GOROOT/misc at all, so no effect on previously created toolchain modules whose checksums are already recorded in the Go checksum database and cannot be changed. (Other than by changing their "v0.0.1" version, but that's expensive.) Fixes #60843. Change-Id: I799b6aacff59c0785cb7743cbd17dda5a9ef91be Reviewed-on: https://go-review.googlesource.com/c/go/+/503975 Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Run-TryBot: Dmitri Shuralyov <dmitshur@google.com> Reviewed-by: Bryan Mills <bcmills@google.com> Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
-rw-r--r--src/cmd/distpack/pack.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/cmd/distpack/pack.go b/src/cmd/distpack/pack.go
index cddbd0747d..fb549f967d 100644
--- a/src/cmd/distpack/pack.go
+++ b/src/cmd/distpack/pack.go
@@ -235,6 +235,8 @@ func mode(name string, _ fs.FileMode) fs.FileMode {
strings.HasSuffix(name, ".pl") ||
strings.HasSuffix(name, ".rc") {
return 0o755
+ } else if ok, _ := amatch("**/go_?*_?*_exec", name); ok {
+ return 0o755
}
return 0o644
}