Skip to content

Commit 4eceefa

Browse files
dmitshurgopherbot
authored andcommitted
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 <[email protected]> TryBot-Result: Gopher Robot <[email protected]> Run-TryBot: Dmitri Shuralyov <[email protected]> Reviewed-by: Bryan Mills <[email protected]> Auto-Submit: Dmitri Shuralyov <[email protected]>
1 parent 1a7709d commit 4eceefa

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/cmd/distpack/pack.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ func mode(name string, _ fs.FileMode) fs.FileMode {
235235
strings.HasSuffix(name, ".pl") ||
236236
strings.HasSuffix(name, ".rc") {
237237
return 0o755
238+
} else if ok, _ := amatch("**/go_?*_?*_exec", name); ok {
239+
return 0o755
238240
}
239241
return 0o644
240242
}

0 commit comments

Comments
 (0)