Add env
and env_inherit
to native_binary
and native_test
#482
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This relies on the
RunEnvironmentInfo
that was introduced in bazel 5.3.0. To keep the library compatible with previous versions, a newbazel_skylib_globals
is added that will provide aNone
definition ofRunEnvironmentInfo
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 bringbazel_features
in the workspace, but then one would have to callbazel_features_deps()
as well afterload
ing 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