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

fix: define rules_python_internal earlier so Bazel 9 doesn't try to use PyInfo et al builtins #2485

Merged

Conversation

rickeylev
Copy link
Collaborator

For Bazel 9 workspace builds, if @rules_python_internal isn't defined early enough,
an earlier version of @rules_python gets defined and the logic to not use the builtin
PyInfo et al symbols doesn't occur. Since Bazel 9 doesn't have these builtins, an error
occurs.

This seems to only happen if the main module is rules_python. The example workspaces don't
see to have an issue. I'm not sure why, but it seems similar to the behavior where
autoloading is disabled for specific repos, rules_python among them.

To fix, move the @rules_python_internal repo definition to be earlier in the WORKSPACE
processing. With that repo defined, the conditional logic takes place, and things seem
to be happy.

@rickeylev rickeylev requested a review from aignas as a code owner December 7, 2024 09:28
@rickeylev rickeylev enabled auto-merge December 7, 2024 09:29
Copy link
Collaborator

@aignas aignas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. It seems that there is a stray load in internal_dev_setup.bzl.

@rickeylev rickeylev added this pull request to the merge queue Dec 9, 2024
Merged via the queue into bazelbuild:main with commit b11f077 Dec 9, 2024
4 checks passed
@rickeylev rickeylev deleted the fix.bazel9.rules.python.override branch December 9, 2024 03:38
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.

2 participants