cabal-install: base <4.22 is still non-reinstallable#12055
Merged
Conversation
b261f27 to
3f11c20
Compare
0fa56a1 to
2b8eed3
Compare
GHC-9.14 ships with base-4.22, since that release of GHC, base is "reinstallable". This means that we can install a version of base that is not the one that was shipped with GHC. In #10982, we extended cabal-install to allow reinstalling base when GHC>=9.14 Yet, we should *not* allow solving for very old versions of base. Older versions of base can be picked by the solver, but they are unbuildable and give confusing error messages. To solve this, we simply also add a constraint that base must be >=4.22 if we take it to be reinstallable. So, now the error mentions that versions of base <4.22 are non-reinstallable. This is an unfortunate hack to resolve this error, but it's the best we can do. Alternatively we could try to revise old versions of base so that the solver does not pick them, but then we would still get a somewhat confusing error message (old versions of base require such and such a version of the rts), and it would require that users have a version of the Hackage tarball that is latter than the revisions. Resolves #11356
2b8eed3 to
20f0f90
Compare
Collaborator
|
I tested it manually using my example from #11983 (comment). Seems good, thanks. |
Bodigrim
approved these changes
Jun 29, 2026
zlonast
approved these changes
Jun 30, 2026
Contributor
Merge Queue Status
This pull request spent 2 hours 2 minutes 11 seconds in the queue, including 1 hour 51 minutes 6 seconds running CI. Required conditions to merge
|
Collaborator
|
(Sorry, I didn't realise that "priority: high" has an effect of bypassing two days delay before merging; I hope it's acceptable) |
34 tasks
Member
|
It's fine. :) |
Member
|
@mergify backport 3.18 |
Contributor
✅ Backports have been createdDetails
|
6 tasks
mergify Bot
added a commit
that referenced
this pull request
Jul 3, 2026
Backport #12055: cabal-install: base <4.22 is still non-reinstallable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GHC-9.14 ships with base-4.22. Since that release of GHC, base is "reinstallable". This means that we can install a version of base that is not the one that was shipped with GHC.
In #10982, we extended cabal-install to allow reinstalling base when GHC>=9.14
Yet, we should not allow solving for very old versions of base. Older versions of base can be picked by the solver, but they are unbuildable and give confusing error messages.
We need both a version of GHC>=9.14 and a version of base>=4.22, otherwise we are forced to use the version that was shipped with GHC.
To solve this, we simply also add a constraint that base must be >=4.22 if we take it to be reinstallable. So, now the error mentions that versions of base <4.22 are non-reinstallable.
This is an unfortunate hack to resolve this error, but it's the best we can do.
Alternatively we could try to revise old versions of base so that the solver does not pick them, but then we would still get a somewhat confusing error message (old versions of base require such and such a version of the rts), and it would require that users have a version of the Hackage tarball that is latter than the revisions.
Resolves #11356
I have not added a changelog entry as this just modifies the behaviour of an unreleased feature. I think the existing changelog entry is sufficient.
Include the following checklist in your PR:
significance: significantin the changelog file.Manual QA notes
base <4.22base <4.23and rebuild