Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

How is py_binary defined? #2036

Answered by rickeylev
allsey87 asked this question in Q&A
Jul 4, 2024 · 1 comments · 1 reply
Discussion options

I am a bit confused about how py_binary is defined. It seems that you can use this function in Bazel without importing anything, but it is also possible to override this default provided py_binary with a version from rules_python by loading it in. Does py_binary refer to different implementations in these two cases? If so, where are the differences between these implementations documented?

You must be logged in to vote

You've pretty much got it.

Bazel provides an implementation of the core python rules. However, they are being moved out of Bazel and into rules_python. Rules_python is a drop in replacement for the old rules built into bazel. The two implementations have almost identical behavior. There's not many differences and they are pretty minor differences (rules_python probably has a few fixes and features beyond it, actually). There's an issue in the Bazel repo that has a list of differences, but I'm on mobile and can't find it.

Eventually, Bazel will remove the built-in implementations. I'm not sure when that'll happen. Hopefully Bazel 8.

Replies: 1 comment · 1 reply

Comment options

You've pretty much got it.

Bazel provides an implementation of the core python rules. However, they are being moved out of Bazel and into rules_python. Rules_python is a drop in replacement for the old rules built into bazel. The two implementations have almost identical behavior. There's not many differences and they are pretty minor differences (rules_python probably has a few fixes and features beyond it, actually). There's an issue in the Bazel repo that has a list of differences, but I'm on mobile and can't find it.

Eventually, Bazel will remove the built-in implementations. I'm not sure when that'll happen. Hopefully Bazel 8.

You must be logged in to vote
1 reply
@allsey87
Comment options

I think this is the issue that you were referencing: bazelbuild/bazel#15897

Answer selected by allsey87
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.