-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Adds --stop-on-block/--stop option to solver #1016
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.
This output-related code continues to be our biggest wart, I think 😓
crates/spk-solve/src/io.rs
Outdated
@@ -1089,16 +1124,21 @@ impl DecisionFormatter { | |||
self.send_sentry_warning_message( | |||
&runtime.solver, | |||
solve_time, | |||
if mesg.contains("by user") { | |||
if mesg.contains("by user") || mesg.contains("--stop-on-block") { |
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.
is it possible to replace this magic string with a constant? Like maybe save the message string from above as a const and then refer to it here so that it doesn't break if we change the message in the future?
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've added constants for this check and used them in the messages.
506cd85
to
c801d80
Compare
This stops the solver when it first reaches a BLOCKED state and would step back. This is useful when working out missing dependencies, e.g. when porting a package between OSes or python versions. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
This pauses the solver when a BLOCKED state is reached (a step-back change). The solver will start up again when the user hits Enter. Signed-off-by: David Gilligan-Cook <dcook@imageworks.com>
c801d80
to
b068cb0
Compare
This adds
--stop-on-block/--stop
option to solver. This option stops the solver completely when it reaches the firstBLOCKED
state (step-back).This turned out to be useful when working out missing dependencies, e.g. when porting a package between OSes or python versions, or otherwise dealing with lots of dependencies changing. While debugging solves that entered solver hell, I found myself running and interrupting the solve over and over. I would scroll back up the output to the first BLOCKED line and use that to work out what request to change, or what other package needed to be converted or built and published. Having the solver stop when it hit BLOCKED streamlined the process for me.
For example:
It can be combined with all the usual verbosity and report settings to show more context around the point that it BLOCKED. By default, using
--stop-on-block
does not print the solver report that interrupting the solver with Ctrl-C or a timeout does, but you can use-t
to see the report as well.