-
Notifications
You must be signed in to change notification settings - Fork 710
Combine non-installable & non-upgradable packages #8712
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
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.
Thanks for simplifying the non-upgradeable package constraints! This PR is a big improvement and can be merged as is, though I think it could go further to resolve #8581 by also removing the requireInstalled
function. The current PR is a straightforward refactoring and doesn't need any additional testing, but removing requireInstalled
has the potential to change behavior, so it might help to add more unit tests if you choose to remove that function.
Co-authored-by: Artem Pelenitsyn <[email protected]>
@grayjay I gave a try removing There are already some tests in |
It may have been wiser to do the second part ( |
This reverts commit adfce24.
Yes, I can try a separate PR. I reverted the commit. As I suspected, it is not as simple as to remove @grayjay I think we need to add constraints in a similar way than |
@@ -710,7 +717,8 @@ resolveDependencies platform comp pkgConfigDB solver params = | |||
$ fmap (validateSolverResult platform comp indGoals) | |||
$ runSolver solver (SolverConfig reordGoals cntConflicts fineGrained minimize | |||
indGoals noReinstalls | |||
shadowing strFlags allowBootLibs onlyConstrained_ maxBkjumps enableBj | |||
shadowing strFlags allowBootLibs nonUpgradeablePackages |
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.
Would it be possible to add some comment as to why the nonInstallablePackages
field is initialized with nonUpgradeablePackages
(there’s a clear mismatch here)? Perhaps, reference a place where the difference between noninstallable and nonupgradeable is discussed? @grayjay, do you happen to know such a place? Or if there’s none, perhaps you could help with writing the comment I’m asking for. This stuff is very confusing and I hope we can write up something that could clear things up for the future reference.
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.
@ulysses4ever I think that non-installable and non-upgradable may have the exact same meaning, which is the reason I opened #8581. If this PR is merged as is, then I think it can just have a comment pointing to #8581. If it is possible to remove requireInstalled
, then this part of the change can be reverted.
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 added a comment
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.
If we agree that "non-installable" and "non-upgradable" are the same, can we please rename one of these into the other?
@wismill thanks for the comment. Can you also update the comment on nonUpgradeablePackages
to say that they are the same?
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.
@ulysses4ever I'm not completely sure that non-installable and non-upgradable are the same. I wasn't able to determine the difference by looking at the history of the code, so I think that the best way to answer the question is to try to remove one of them and see whether the tests pass. I think it would be better to just link to issue #8581 until we can try removing the rest of the redundant code.
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.
@wismill Thanks for trying to remove It looks like the test failure could have been caused by this line:
I'm not sure what the purpose of that line was, but I'm guessing that it was made obsolete by the flag
Testing for a larger part of the error message in "Refuse to install base without --allow-boot-library-installs" is probably enough.
I don't think we need to add any more constraints than the ones in |
@wismill after grepping the source, I have another proposal that may help to lower my confusion. Could you change the name of the binding you introduced as I'd also suggest to change |
@ulysses4ever I don't think that we should rename the variables now, since we don't know whether non-installable and non-upgradable are the same. This PR only resolves #8581 partially, so the comments can link to that issue. The next step is to determine whether non-installable and non-upgradable packages are treated the same, and, if they are, remove |
@grayjay I think what you propose is a good path for a transition. With good comments in the code it could be reverse if it turns out that the two lists may be different, now or in the future. Who should we ask to get a definitive answer? I have the feeling GHC devs could enlighten us. Should this PR be merged soon, I might get another one ready in time for Cabal 3.10 to fix #7993. What is the release schedule? |
Some findings:
|
GHC devs could help with creating a complete list of packages that shouldn't be reinstalled and using the correct terminology (non-upgradable vs wired-in vs boot). However, I think that having separate non-installable and non-upgradable lists is only an implementation detail of the cabal dependency solver and doesn't relate to GHC. |
Approving as a good incremental step. |
@wismill: if you add the "squash+merge_me" label, it should automatically rebase as needed. |
Combine non-installable and non-upgradable packages list.
Since the two lists are synced, we try to keep the list in
Distribution.Client.Dependency
(preferred location) and pass it as a parameter to functions inDistribution.Solver.Modular.Solver
.Fixes #8581
Please include the following checklist in your PR:
Please also shortly describe how you tested your change. Bonus points for added tests!