-
-
Notifications
You must be signed in to change notification settings - Fork 650
build: add flag_alias definition for Starlarkification of python flags #3450
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
base: main
Are you sure you want to change the base?
Changes from all commits
7b52502
e9688b7
15687f1
5c6539e
504ccf3
effbe4c
e7bc464
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -93,7 +93,7 @@ def _test_basic_zip(name, config): | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # platforms. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # Pass value to both native and starlark versions of the flag until | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # the native one is removed. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "//command_line_option:build_python_zip": "true", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "//python/config_settings:build_python_zip": "true", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @gregestren sorry for ping again. Are you sure this is a correct change on bazel 7 and 8? My understanding is that
So the result is this change to overrides on these bazel versions will make the override stop overriding anything, breaking the test. I see in CI failures like below that probably is related |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| labels.BUILD_PYTHON_ZIP: True, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "//command_line_option:cpu": "linux_x86_64", | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "//command_line_option:crosstool_top": CROSSTOOL_TOP, | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this work for users of rules_python too?
otherwise I think this issue still stands : #3252 (comment)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should work today, even before this PR is submitted.
Bazel 9 hard-codes those aliases right now. Once this PR works we'll remove the hard-coded logic from bazel@head.
The intention is users should have a seamless experience regardless of what's going on behind the scenes.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! I read https://docs.google.com/document/d/1yOvi4hVV7Ja32ocwVb4lsEUnijftk8nilXPncYm-BH8/edit?tab=t.0#heading=h.mfw8nr4w6amb briefly, and as you say this trickles down to users too, and not just rules_python. Makes sense.
Now another question, by adding this PR, should this code just be removed now?
rules_python/python/private/flags.bzl
Lines 39 to 73 in 144984c
flag_aliasis already doing (and even a better job) than what this code is trying to do.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should still be necessary so
rules_pythonremains compatible with bazel 7 and 8, which can't resolve the flag aliases. Wheneverrules_pythondrops support for pre-9 bazel we can remove this code.