Skip to content

Conversation

@benjaminp
Copy link
Contributor

About half the action registrations in rules_java formerly set this. Be consistent.

About half the action registrations in rules_java formerly set this. Be consistent.
@benjaminp benjaminp requested review from a team and comius as code owners February 24, 2025 21:22
@fmeum
Copy link
Contributor

fmeum commented Feb 25, 2025

It's unfortunately still common for users to use --action_env to set variables for repo rules, which when combined with use_default_shell_env = True results in cache invalidation. Do you see a use case for --action_env for hermetic JDKs? If not, then setting the default based on whether the JAVA_HOME path is absolute could be a safer choice.

@benjaminp
Copy link
Contributor Author

I'm trying to pass certain environmental variables to every hermetic JVM invocation, so use_default_shell_env = True only for local jdks wouldn't suffice.

What would also be useful is the ability to configure --action_env by mnemonic or perhaps platform.

@fmeum
Copy link
Contributor

fmeum commented Feb 25, 2025

What would also be useful is the ability to configure --action_env by mnemonic or perhaps platform.

Yes, that would be really useful and much less of a footgun.

@crt-31
Copy link

crt-31 commented Mar 29, 2025

Actually, I came here to argue that we should always set use_default_shell_env to False.
Setting it to true causes cache misses, and rules_java should be oriented to hermetic by default.

@benjaminp benjaminp deleted the use_default_shell_env branch March 29, 2025 03:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants