Allow setting environment variables in local actions that don't affect the cache key #20950
Labels
P2
We'll consider working on this in future. (Assignee optional)
team-Local-Exec
Issues and PRs for the Execution (Local) team
type: feature request
Description of the feature request:
Sometimes, local actions need information that doesn't affect what they do. For example:
etc.
This information should not be propagated to remotely executed actions and should not be part of the cache key (either in the local action cache, in the disk cache or in the remote cache), but Bazel currently does not offer such a facility.
This information is also not knowable by people writing BUILD/.bzl files, so it should be gathered from the command line. The closest we have is
--action_env
, but that one does affect the caches and propagates to RBE, so it doesn't quite do.The easiest thing would be to add a
--sandbox_env
command line option that only applies to sandboxed actions.The current best workaround is to put this information in a non-hermetic file. That requires adding a little wrapper around the action, though, to read it.
Which category does this issue belong to?
No response
What underlying problem are you trying to solve with this feature?
No response
Which operating system are you running Bazel on?
No response
What is the output of
bazel info release
?No response
If
bazel info release
returnsdevelopment version
or(@non-git)
, tell us how you built Bazel.No response
What's the output of
git remote get-url origin; git rev-parse master; git rev-parse HEAD
?No response
Have you found anything relevant by searching the web?
No response
Any other information, logs, or outputs that you want to share?
No response
The text was updated successfully, but these errors were encountered: