Repository navigation
Backport #12055: cabal-install: base <4.22 is still non-reinstallable - #12081
Merged
Merged
Conversation
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 (cherry picked from commit 20f0f90)
5 of 6 tasks
Mikolaj
approved these changes
Jul 3, 2026
Contributor
Author
Merge Queue Status
This pull request spent 10 minutes 40 seconds in the queue, including 2 seconds running CI. Required conditions to merge
|
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 rebuildThis is an automatic backport of pull request cabal-install: base <4.22 is still non-reinstallable #12055 done by Mergify.