-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Add 'remove_legacy_create_init_py' flag #9271
Add 'remove_legacy_create_init_py' flag #9271
Conversation
I'm sure Jon will take good care of this PR :) |
Thank you for this PR! The implementation looks good but I'd like to request a change to how this behavior is rolled out. There are three levels of behavioral change to consider:
This PR skips (1) and goes directly to implementing (2) but not (3). Skipping (1) means that users can't incrementally migrate their builds -- they can't temporarily opt out of the change for one or two stubborn targets, even if everything else in their build works. Skipping (3) means a separate incompatible change will still be needed just to cleanup the no-op attribute. I suggest that instead we structure it so that this PR implements (1). Then a later change (to be flipped after Bazel 2.0!) could skip (2) and go directly to (3). The biggest barrier I see is that migration for many builds may be cumbersome, since you have to add a |
…so the new incompatible_remove_legacy flag can control the unset default
…t attribute overrides the migration flag
…f.add_legacy_init_py_flag
@brandjon - I've re-implemented the change in line with your comment. I did have to change the type of "legacy_create_init" from Boolean to TriState, but the tests verify that anyone who has set the attribute using existing boolean values will still have it work. I tried to utilize the codebase's existing "default value" mechanism instead, but the amount of private classes and methods there made me think this was not an encouraged method. |
@brandjon - ping. |
Thanks for the changes. I'm merging this internally with a few tweaks:
Awaiting internal code review, expect the push in a day or two. |
FYI, downstream CI shows no problem with changing the type of |
Does the first step detailed by @brandjon in #7386, adding a migration flag to set the value of
legacy_create_init
to False.