Skip to content

Remove top-down resolver #3598

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

Merged

Conversation

BardurArantsson
Copy link
Collaborator

Removing 'topdown' as a resolver choice means that 'choose' is also
obsolete and so it is removed too.

@BardurArantsson BardurArantsson force-pushed the remove-topdown-solver-v2 branch from bad2eb9 to e5a3fb1 Compare July 22, 2016 16:33
@@ -16,6 +16,7 @@
(#3429).
* The bootstrap script now works correctly when run from a Git
clone (#3439).
* Removed the top-down solver (#3598).
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong kind of whitespace :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, yes, thank you :)

@BardurArantsson BardurArantsson force-pushed the remove-topdown-solver-v2 branch 2 times, most recently from 228f7de to f0bbcf1 Compare July 22, 2016 17:44
@ezyang
Copy link
Contributor

ezyang commented Jul 22, 2016

Yay, so much deleted code!

But are you sure you want to remove the solver parameter? @phadej wants to add external solver support; ostensibly that would use that plumbing. I guess one could put it back when the time comes.

optionSolver :: (flags -> Flag PreSolver)
-> (Flag PreSolver -> flags -> flags)
-> OptionField flags
optionSolver get set =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ugh I wish we had some library function that let us turn this into a "this was removed flag, modular solver only" to let users who try to use this flag know what to do.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I'd have really liked to keep reading the "solver" option and just emit a warning/error saying "you might have wanted X, but I'm going to do Y", but: In the default configuration the "solver: XXX" line is commented, so it's not going to be a problem for the vast majority of cabal-install users. If they try to change "solver" then, of course, they'll get an error message, but I think that's basically as it should be.

Of course there might be some people out there who are actually using "solver: topdown" in their configurations, but they should have had plenty of time to speak up since it's emitted a deprecation warning for quite some time.

@BardurArantsson
Copy link
Collaborator Author

But are you sure you want to remove the solver parameter? @phadej wants to add external solver support; ostensibly that would use that plumbing. I guess one could put it back when the time comes.

Yeah, I was sort of on the fence about that[1], but as you say it can always be brought back and if we're going to be realistic I think the 'external solver' is quite far off at this point[2], so in the end I decided that it's probably better to avoid the maintenance burden of the "redundant" code. (Basically: Applying the YAGNI principle.)

[1] This is, in fact, the reason that I have separate commits for these things. That'll make it even easier to bring back "solver choice" if it's ever going to be needed again.

[2] In practice... AFAICT it's going to be a lot of work to standardize on a format, etc. (I'm actually not really sold on the idea of an external solver, but whatever.)

@BardurArantsson
Copy link
Collaborator Author

I'll merge the first part of this tomorrow (that bit should be uncontroversial at this point), but I'll hold off for a few days on the follow-ups -- just to let people chime in.

@phadej : Do you think this will cause trouble for you or do you agree with my assessment on the external solver support?

@23Skidoo
Copy link
Member

+67 −2,060

👍

@kosmikus
Copy link
Contributor

I'm in favour of keeping the solver parameter. I have been experimenting with other solvers in the past and think it's likely that I or others will do so in the future. This is much easier if the parameter is there, and I don't think there's a huge maintenance burden attached to it.

@BardurArantsson
Copy link
Collaborator Author

OK.

For clarification: Do you want to retain the configuration bits per se? With the changes I've posted it's still pretty easy to experiment by changing the a single line in resolveDependencies -- change modularResolver to myResolver. That's the only place it's mentioned.

I suppose we could also change chooseSolver to just return a IO (DependencyResolver ...) instead -- that'll mean that you can easily use IO when initializing the solver and all the "solver" parameter plumbing will take care of the rest.

WDYT?

@BardurArantsson BardurArantsson force-pushed the remove-topdown-solver-v2 branch from 1a2eef5 to 5d475b0 Compare July 23, 2016 06:54
Removing 'topdown' as a resolver choice means that 'choose' is also
obsolete and so it is removed too.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants