-
Notifications
You must be signed in to change notification settings - Fork 4k
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
feature request: add a flag that tells bazel to include the current environment's variables #4093
Comments
You can forward individual environment variables with |
The C++ rules roll their own environment handling and thus have inconsistent behavior with If you've already managed to set the right env vars for CUDA once doesn't seem like it should be hard to copy that knowledge into the Bazel command line. At the very worst, you can have a Bazel wrapper that translates |
@benjaminp that's why it should be an optional flag, but not the default behaviour. and the mentioning of CUDA was only an example of software that implements such a feature. Wrapping |
We would not want to add an option that simply forwards every environment variable. That would mean completely irrelevant variables (e.g. WINDOWID) would impact your build. Caching would be impossible. The only reasonable feature is where the user explicitly enumerates the set of variables they wish to pass on. action_env still seems the right way to approach this. We first have to fix things like #3320, but that is The first step beyond that would be try try expanding in the .bazelrc If not, one could roll their own interim solution.
|
Thank you for contributing to the Bazel repository! This issue has been marked as stale since it has not had any activity in the last 3 years. It will be closed in the next 14 days unless any other activity occurs or one of the following labels is added: "not stale", "awaiting-bazeler". Please reach out to the triage team ( |
This issue has been automatically closed due to inactivity. If you're still interested in pursuing this, please reach out to the triage team ( |
I understand the concept of wanting to have a sandboxed environment for builds on many software in order to maintain reproducibility, etc... but the fact that there is no way to tell bazel to do otherwise is an incredible hassle, especially when, for instance, you are using to build software in an HPC environment (cough TensorFlow cough) where everything is managed using environment modules. there should be a flag along the lines of
--use-local-env
(as innvcc
for CUDA). There's no good reason that I should have to wrap my compilers (Intel, in the current case) just to have them reload all the modules when the compiler is run so that it can find its licenses and what not. I tried using the--action_env
option but it had absolutely no effect. We need an option to keep our local environment when building with bazel. ThanksThe text was updated successfully, but these errors were encountered: