fix(rules): remove rules_python --incompatible_python_disallow_native_rules checking#2327
Merged
rickeylev merged 12 commits intobazel-contrib:mainfrom Oct 22, 2024
Merged
Conversation
Collaborator
|
Should we also close #1645 since we would be testing this? |
aignas
approved these changes
Oct 22, 2024
Collaborator
|
This also needs a changelog item. |
Collaborator
Author
Hrm. Bazel 6 doesn't have the flag, so setting it in the bazelrc files is problematic. I think what I'll have to do is set it as part of the CI config. I'll give that a try, but I might drop this from the PR if it ends up being a big pain.
Done |
Collaborator
Author
|
Figure out a way to get th bazelrcs updated. I changed CI to set |
rickeylev
added a commit
to rickeylev/rules_python
that referenced
this pull request
Oct 22, 2024
…_rules checking (bazel-contrib#2327) When --incompatible_python_disallow_native_rules is enabled, all the core rules fail with an error that rules_python should be used. This is incorrect, since the rules_python rules are being used. What's happening is bazel-contrib#2257 removed the magic migration tag when pystar is enabled, but the code to check the tag was present wasn't removed. This went unnoticed because our CI doesn't set the migration flag. To fix, remove the validation logic entirely. If we're in the rules_python implementation, then there is not need to perform this validation. It was just something copy/pasted from the original code from Bazel itself. Also update the bazelrc to always set --incompatible_python_disallow_native_rules. Fixes bazel-contrib#2326 Fixes bazel-contrib#1645
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When --incompatible_python_disallow_native_rules is enabled, all the core rules fail with
an error that rules_python should be used. This is incorrect, since the rules_python rules
are being used. What's happening is #2257
removed the magic migration tag when pystar is enabled, but the code to check the tag
was present wasn't removed. This went unnoticed because our CI doesn't set the migration
flag.
To fix, remove the validation logic entirely. If we're in the rules_python implementation,
then there is not need to perform this validation. It was just something copy/pasted from
the original code from Bazel itself.
Also update the bazelrc to always set --incompatible_python_disallow_native_rules.
Fixes #2326
Fixes #1645