-
Notifications
You must be signed in to change notification settings - Fork 697
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
Deprecating --solver=modular
CLI argument
#9206
base: master
Are you sure you want to change the base?
Conversation
Ah we need more pair programming sessions if we're getting nice refactorings like this, thank you @andreabedini for taking the time |
I extended the PR with more lines removed 85ebc06 ... It has the side effect of removing this (useless) CLI option:
|
My only condern is about parsing the config files. Can one specify the solver in cabal.project? What about cabal.config? I admit it's very unlikely that anybody ever did but I would prefer to avoid a sudden parsing error. |
Same thing for the cli option. We could leave the option and just make it emit an informative warning/error. |
Then I can just discard my second commit and create another PR that add deprecation warnings for the |
Thanks for cleaning up the solver option! I agree that we should deprecate the option before completely removing it. |
I am not sure a fully deprecating cycle makes sense here, the option never really did anything useful since there always been only one option to choose from! My concern is about failing on parse, which would be very suprising for the unlucky developer who had the idea of fixing the value of To be extra clear, I suggest both For the rest the PR looks alright already. |
Yes, the option has had no effect since #3598, so we can deprecate it and still remove most of the code that deals with choosing a solver. |
I think there is reasonable consensus here. @yvan-sraka can you add a tests showing that we can still parse configs that specify |
Same thing for QA notes, we'd need a couple of steps to reproduce the graceful handling of the |
648c76b
to
d15c641
Compare
I added warnings in docs and for CLI |
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.
Few things are left to do:
- Warning for
cabal build --solver=modular
- Warning for
solver: modular
in the config file. I have checked and the file will still parse, giving an "unrecognised field" warning. - The initial config still includes
-- solver: modular
- Tests that codify this behavior.
I think I am ok with an "unrecognised field" warning to be honest. If you want to add a proper warning you can start from here
-- TODO: next step, make the deprecated fields elicit a warning. |
😂
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 think configSolver
in ConfigExFlags
and anything downstream of that can go. The fact that we keep the option does not mean we need to keep its value (expecially given there's never been any value!).
742c4e4
to
eedfcf6
Compare
chooseSolver
and inline Modular
solver as default choice--solver=modular
CLI argument
@yvan-sraka Is there anything here that wasn't included in #9282? It looks like we end up keeping |
1fd0e07
to
ab35390
Compare
No! This PR included everything that is in #9282 + it removes
I believe that what I aimed to do was to deprecate it with a warning message rather than completely removing it. But thanks for spotting it. I've added a new commit that completely removes the option from the CLI. |
As far as I remember the plan was this #9206 (review). With "the fact that we keep the option does not mean we need to keep its value" I meant something like this:
|
562dc1d
to
7e37109
Compare
--solver=modular
CLI argument--solver=modular
CLI argument
7e37109
to
499dc9b
Compare
I still need to find where the initial config is defined: I found only it in
TBH, this would be a bit ambitious for my actually
That's exactly what I did: cabal/cabal-install/src/Distribution/Client/Setup.hs Lines 934 to 940 in 499dc9b
|
499dc9b
to
0d1a76f
Compare
I've made a few updates to the PR: However, I'm still not satisfied by the use of |
EDIT: This PR DOES modify
cabal
behavior (remove--solver=modular
CLI argument). During a pair-programming session with @andreabedini, we noticed that the currentchooseSolver
function (which returns anIO Solver
) unnecessarily complicates the code. Currently, the only available option is indeed theModular
solver.Checklist: