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

Add env and env_inherit to native_binary and native_test #482

Open
wants to merge 13 commits into
base: main
Choose a base branch
from

Conversation

redsun82
Copy link

@redsun82 redsun82 commented Dec 20, 2023

This relies on the RunEnvironmentInfo that was introduced in bazel 5.3.0. To keep the library compatible with previous versions, a new bazel_skylib_globals is added that will provide a None definition of RunEnvironmentInfo if still unavailable.

This is inspired by bazel_features: while using that directly would be easy with bzlmod integration, for the legacy workspace-based integration would suffer, as bazel_skylib_workspace would only be able to bring bazel_features in the workspace, but then one would have to call bazel_features_deps() as well after loading it.

If updating the legacy worksapce integration instructions with the above addition is deemed ok, one could bring that additionally dependency in. Otherwise I just added the necessary code to inspect the version (with the painful external repo workaround) directly in here.

Closes #409

@redsun82 redsun82 marked this pull request as ready for review December 21, 2023 15:22
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.

Add env attr to native_binary and native_test
1 participant