Skip to content

Backport #12055: cabal-install: base <4.22 is still non-reinstallable - #12081

Merged
mergify[bot] merged 1 commit into
3.18from
mergify/bp/3.18/pr-12055
Jul 3, 2026
Merged

mergify[bot] merged 1 commit into
3.18from
mergify/bp/3.18/pr-12055

Conversation

@mergify

@mergify mergify Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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:

Manual QA notes

  • With GHC-9.14 try building a package which has this in its build-depends base <4.22
  • You should get an error that is a bit more helpful than before
  • Then loosen the bound to base <4.23 and rebuild
  • and it should build
    This is an automatic backport of pull request cabal-install: base <4.22 is still non-reinstallable #12055 done by Mergify.

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)
@mergify mergify Bot added the backport label Jul 3, 2026
@Mikolaj Mikolaj added the merge me Tell Mergify Bot to merge label Jul 3, 2026
@mergify mergify Bot added the queued label Jul 3, 2026
@mergify

mergify Bot commented Jul 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Merge Queue Status

  • ✅ Entered queue — 2026-07-03 15:48 UTC · Rule: default · triggered by rule Put backports in the rebase+merge queue
  • ✅ Checks skipped · PR is already up-to-date
  • ✅ Merged — 2026-07-03 15:59 UTC · at c7a85c28318b948f4373a266f24f96a0c591166e · merge

This pull request spent 10 minutes 40 seconds in the queue, including 2 seconds running CI.

Required conditions to merge
  • #review-threads-unresolved = 0 [🛡 GitHub branch protection]
  • github-review-approved [🛡 GitHub branch protection]
  • any of [🛡 GitHub branch protection]:
    • check-success = Doctest Cabal
    • check-neutral = Doctest Cabal
    • check-skipped = Doctest Cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Meta checks
    • check-neutral = Meta checks
    • check-skipped = Meta checks
  • any of [🛡 GitHub branch protection]:
    • check-success = Validate post job
    • check-neutral = Validate post job
    • check-skipped = Validate post job
  • any of [🛡 GitHub branch protection]:
    • check-success = docs/readthedocs.org:cabal
    • check-neutral = docs/readthedocs.org:cabal
    • check-skipped = docs/readthedocs.org:cabal
  • any of [🛡 GitHub branch protection]:
    • check-success = Bootstrap post job
    • check-neutral = Bootstrap post job
    • check-skipped = Bootstrap post job
  • any of [🛡 GitHub branch protection]:
    • check-success = whitespace
    • check-neutral = whitespace
    • check-skipped = whitespace
  • any of [🛡 GitHub branch protection]:
    • check-success = Check sdist post job
    • check-neutral = Check sdist post job
    • check-skipped = Check sdist post job
  • any of [🛡 GitHub branch protection]:
    • check-success = Changelogs
    • check-neutral = Changelogs
    • check-skipped = Changelogs

@mergify
mergify Bot merged commit 6eb3615 into 3.18 Jul 3, 2026
60 checks passed
@mergify
mergify Bot deleted the mergify/bp/3.18/pr-12055 branch July 3, 2026 15:59
@mergify mergify Bot removed the queued label Jul 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport merge me Tell Mergify Bot to merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants