-
Notifications
You must be signed in to change notification settings - Fork 519
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
Flip use_default_shell_env to True in run_node ctx.actions.run #1548
Comments
Related issues: |
#1648 We have this problem there too. |
This issue has been automatically marked as stale because it has not had any activity for 60 days. It will be closed if no further activity occurs in two weeks. Collaborators can add a "cleanup" or "need: discussion" label to keep it open indefinitely. Thanks for your contributions to rules_nodejs! |
According to the relevant design docs,
|
Is this still being considered? IMO defaulting to true would make more sense. We had issues with false positive cache hits because someone used actions.run_shell() and hadn't set Until this is implemented we need to catch the use of actions.run_shell() or actions.run() without |
I don't think this is still applicable for rules_nodejs since the This is being considered as opt-in in rules_js (aspect-build/rules_js#1303) and has initial use with lifecycle hooks (aspect-build/rules_js#1489). However it should never be enabled by default due to the cache-busting effects it has. |
Once bazelbuild/bazel#5980 is resolved and
use_default_shell_env=True
can be used without overwrittingenv{}
(which we rely on to set the COMPILATION_MODE env for build actions).This will allow passing over environment variables to npm_package_bin build actions via --action_env.
See https://docs.bazel.build/versions/master/skylark/lib/actions.html#run for more info on
use_default_shell_env
.See https://docs.bazel.build/versions/master/skylark/lib/configuration.html#default_shell_env for more info on ctx.configuration.default_shell_env.
It looks like the intention of the Bazel team is to flip the
use_default_shell_env
default to true: see https://bazel.build/designs/2016/06/21/environment.html#new-flag---action_env.A possible (but less than ideal) workaround is to set https://docs.bazel.build/versions/master/command-line-reference.html#flag--distinct_host_configuration to False and don't use
env{}
to passCOMPILATION_MODE
to build actions. But a distinct host configuration is desirable so we should keep usingenv{}
and wait until the #5890 is resolved anduse_default_shell_env=True
can be used without overwrittingenv{}
The text was updated successfully, but these errors were encountered: