fix(PyRuntimeInfo): use builtin PyRuntimeInfo unless pystar is enabled. #1748
+55
−3
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 fixes the bug where the PyRuntimeInfo symbol rules_python exported wasn't matching the provider identity that
py_binary
actually provided.The basic problem was, when pystar is disabled:
native.py_binary
, which provides only the builtin PyRuntimeInfo provider.Thus, when users loaded the rules_python PyRuntimeInfo symbol, it was referring to a provider that the underlying py_binary didn't actually provide. Pystar is always disabled on Bazel 6.4,
and enabling it for Bazel 7 will happen eminently.
This typically showed up when users had a custom rule with an attribute definition that used the rules_python PyRuntimeInfo.
To fix, only use the rules_python define PyRuntimeInfo if pystar is enabled. This ensures the providers the underlying rules are providing match the symbols that rules_python is exported.
py_binary
andpy_test
to also return the builtin PyRuntimeInfo. Thisshould make the transition from the builtin symbols to the rules_python symbols a bit
easier.
Fixes #1732