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

handling for rules that involve transitions #6605

Merged

Conversation

andponlin-canva
Copy link
Contributor

Checklist

  • I have filed an issue about this change and discussed potential changes with the maintainers.
  • I have received the approval from the maintainers to make this change.
  • This is not a stylistic, refactoring, or cleanup change.

Please note that the maintainers will not be reviewing this change until all checkboxes are ticked. See
the Contributions section in the README for more
details.

Discussion thread for this change

Issue number: 6600

Description of this change

When a Python rule is used such as py_binary and the rule is using a pinned Python interpreter, the ruleName is coming through as _transition_py_binary from the aspect but is still a py_binary. This change will still detect the transitioned rule name as Kind.Provider.create("py_binary", LanguageClass.PYTHON, RuleType.BINARY) from PythonBlazeRules.java so that debugging works for py_binary-s that are using the pinned interpreter.

See the issue discussion for further details and an example.

@tpasternak
Copy link
Collaborator

This seems not to be enough, the targets with pinned seem not to contain PyInfo

if not PyInfo in target or _is_language_specific_proto_library(ctx, target, semantics):
return False

@tpasternak
Copy link
Collaborator

The root cause is that, pinning the repo requires to load non-builtin rules_python. When you do load('@python_3_11:defs.bzl", "py_binary"), the py_binary rule exports @@rules_python//python/private/common:providers.bzl%PyInfo instead of PyInfo

@tpasternak
Copy link
Collaborator

Ok, but it still fixes debugging. Correct import is a separate issue

@tpasternak tpasternak merged commit 321f132 into bazelbuild:master Aug 8, 2024
8 checks passed
@github-actions github-actions bot removed the awaiting-review Awaiting review from Bazel team on PRs label Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
product: CLion CLion plugin product: GoLand GoLand plugin product: IntelliJ IntelliJ plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants