Add prefer-version setting - #11569
Conversation
geekosaur
left a comment
There was a problem hiding this comment.
Looks okay to me, but GitHub says you have a merge conflict.
25d89f2 to
24e4708
Compare
|
I might need some help with writing a test. As far as I can tell the solver tests aren't a good fit since the behaviour seems to already select the latest package rather than the installed one unlike what |
|
Maybe there are smarter options, but peeking in |
|
That's a good point. I'll try to write an integration test instead and then I don't have to worry about figuring out the solver tests. |
|
Or did you mean that that should be added to the manual QA notes? |
No you got that right in your first reply, I was suggesting to write a golden test. |
054cf86 to
7433a58
Compare
Do you know where the solver unit tests specify a different default? That sounds like a bug to me, especially because I couldn't find any tests relating to the installed vs latest preference from a quick skim. Also, there are relatively few installed packages in the unit tests. Do you know whether any existing tests fail when the default is changed? |
|
I've taken another look and I figured it out. I was asking the solver to install a package and that is handled specially such that it will pick the latest version for it, and the behaviour is different for non selected packages. I've added some solver tests now. I created a new package db rather than editing the existing one to keep it intelligble |
|
@sebright perhaps you'd like to review |
c9fcf4e to
2ee0615
Compare
|
Thanks for the review @sebright ! I've pushed a new version that should hopefully address most of your comments and I've asked on the matrix channel about deprecating the command line flag |
|
@zlonast unlikely. We pushed the tags already. In theory, we could redo that and redo the candidates (which we also did). If someone thiks there's a good reason to do it, and delay the release by about a week, they should speak up. Preferably, both here and at the Cabal meeting. |
c3a9a1e to
d043818
Compare
The default behaviour of the solver is that we pick the latest version of each package EXCEPT if it is a package installed in the global pkg db, ie, package shipped with GHC. Here we extend the existing `--prefer-oldest` flag into a `--prefer-version=` option, which allows us to pick between - oldest - latest (new) - installed-or-latest (old default) Resolves #9669
Merge Queue Status
This pull request spent 33 minutes 33 seconds in the queue, including 22 minutes 31 seconds running CI. Waiting for
All conditions
ReasonThe merge conditions cannot be satisfied due to failing checks
Failing checks:
HintYou may have to fix your CI before adding the pull request to the queue again. |
|
@Mergifyio queue |
Merge Queue Status
This pull request spent 2 hours 4 minutes 37 seconds in the queue, including 1 hour 53 minutes 5 seconds running CI. Required conditions to merge
|
The default behaviour of the solver is that we pick the latest version
of each package EXCEPT if it is a package installed in the global pkg
db, ie, package shipped with GHC.
Here we extend the existing
--prefer-oldestflag into a--prefer-version=option, which allows us to pick betweenResolves #9669
Manual QA instructions
--prefer-version=latestand confirm that the version from Hackage is pickedInclude the following checklist in your PR:
significance: significantin the changelog file.