]> Cypherpunks repositories - gostls13.git/commit
cmd/go: allow symlinks of non-directory files in embed
authorMichael Matloob <matloob@golang.org>
Thu, 16 Jan 2025 20:44:55 +0000 (15:44 -0500)
committerMichael Matloob <matloob@golang.org>
Tue, 11 Mar 2025 14:51:38 +0000 (07:51 -0700)
commit73fea035bf1e4e68ef14995a389d4fd8df5c6a34
treef270eb7b35335d14ec61fb045eb645825abd41e2
parenta588c6fba6d411245d72b9e071eedc3b4d00a0c8
cmd/go: allow symlinks of non-directory files in embed

We previously disallowed all non-regular files being embedded. This CL
relaxes the restriction a little: if the GODEBUG embedfollowsymlinks=1
is set, we allow the leaf files being embedded (not the directories
containing them) to be symlinks. The files pointed to by the symlinks
must still be regular files.

This will be used when a Bazel build action executing the Go command is
running in a symlink-based sandbox. It's not something we want to enable
in general for now, so it's behind a GODEBUG.

Fixes #59924

Change-Id: I895be14c12de55b7d1b663d81bdda1df37d54804
Reviewed-on: https://go-review.googlesource.com/c/go/+/643215
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Alan Donovan <adonovan@google.com>
doc/godebug.md
src/cmd/go/internal/load/pkg.go
src/cmd/go/testdata/script/embed.txt
src/internal/godebugs/table.go
src/runtime/metrics/doc.go