-
-
Notifications
You must be signed in to change notification settings - Fork 628
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
Turn on --v2
by default now that the V2 backends are not loaded by default
#9007
Conversation
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.
I know that it is only symbolic, but: yay!
bc28628
to
808e105
Compare
CI caught a big issue for us! Yay CI! Certain V2 rules don't work properly when they have no backends providing an implementation, such as The issue with this PR is that now, for ambiguous goals like The solution is to extend #9002, which only impacts the output of |
Another consideration here is: does this conflict with enabling |
When you say: "don't work properly", what do you mean? Shouldn't they noop? The So, if anything, it feels like the |
Yes, IMO they should no-op. Are you proposing that this logic should live at the goal level, rather than at one level higher of abstraction like here? pants/src/python/pants/init/engine_initializer.py Lines 201 to 242 in 155393b
That would work, but IMO it makes more sense for the engine to never even try running the goal if there is no actual implementation for it. Beyond this seeming like a more appropriate level of abstraction, this would enable us to do things like output in |
Note that I have a pending change (#8997) that will only register |
Tricky. V2 UI does not work great when also running V1. Possibly, we should improve this interaction. Possibly, this PR is a bad idea (but I think the necessary precursor changes are still good ones). |
A fix for the edge case of |
So, it shouldn't necessarily be the case that this is true... exactly one codepath should be reading and using the pants/src/python/pants/engine/scheduler.py Lines 464 to 479 in aa0d9c2
I think that issues mixing v1 and v2 likely stem from the fact that we currently push this flag value into the pants/src/python/pants/bin/local_pants_runner.py Lines 124 to 132 in aa0d9c2
We don't want to use the UI for "the whole |
# Conflicts: # pants.ini # src/python/pants/option/global_options.py
# Conflicts: # src/python/pants/option/global_options.py
Now that we have
backend_packages
vs.backend_packages2
, turning on--v2
by default will have zero impact on users who have not explicitly opted in to V2 backends becausebackend_packages2
defaults to[]
and we no-op for V2 goals with no implementations.So, if this has no impact on users, why do this? It lowers the barrier to adoption for using V2. Currently, to use V2 Black, for example, you must do two things:
backend_packages2. add = ['pants.backend.python.lint.black']
v2 = true
Now, you solely must do
backend_packages2.add = ['pants.backend.python.lint.black']
.