Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow setting environment variables in local actions that don't affect the cache key #20950

Open
lberki opened this issue Jan 19, 2024 · 0 comments
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

Comments

@lberki
Copy link
Contributor

lberki commented Jan 19, 2024

Description of the feature request:

Sometimes, local actions need information that doesn't affect what they do. For example:

  1. Address of a jobserver so that the local machine is not overloaded
  2. Address of an RBE server of ccache if a complicated build is hidden behind a local action
  3. Address of servers the action should connect to

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 returns development 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

@lberki lberki added type: feature request P2 We'll consider working on this in future. (Assignee optional) team-Local-Exec Issues and PRs for the Execution (Local) team labels Jan 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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
Projects
None yet
Development

No branches or pull requests

4 participants