From 73fea035bf1e4e68ef14995a389d4fd8df5c6a34 Mon Sep 17 00:00:00 2001 From: Michael Matloob Date: Thu, 16 Jan 2025 15:44:55 -0500 Subject: 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 Reviewed-by: Alan Donovan --- src/runtime/metrics/doc.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/runtime') diff --git a/src/runtime/metrics/doc.go b/src/runtime/metrics/doc.go index 563ddf4c95..0d35314e06 100644 --- a/src/runtime/metrics/doc.go +++ b/src/runtime/metrics/doc.go @@ -234,6 +234,11 @@ Below is the full list of supported metrics, ordered lexicographically. The number of non-default behaviors executed by the time package due to a non-default GODEBUG=asynctimerchan=... setting. + /godebug/non-default-behavior/embedfollowsymlinks:events + The number of non-default behaviors executed by the cmd/go + package due to a non-default GODEBUG=embedfollowsymlinks=... + setting. + /godebug/non-default-behavior/execerrdot:events The number of non-default behaviors executed by the os/exec package due to a non-default GODEBUG=execerrdot=... setting. -- cgit v1.3