Repository navigation
Description
(updated description by @hvr)
Extended problem statement
As it's difficult to predict the future and lib:Cabal encodes knowledge about compiler internals and features indexed by their respective versions, the implicit assumption has been that the lib:Cabal version that interacts with a specific GHC version needs to be sufficiently recent. This ought to be made more explicit to avoid subtle corruption as a result of using lib:Cabal versions which aren't compatible with a given GHC release, and may either fail loudly or silently resulting in a bad user experience.
The related forward-compat scheme described in #4899 covers the compatibility aspect between Cabal and .cabal files, and encodes the principle that we don't try to understand unknown/future formats; this ticket's scope covers the Cabal / GHC interface in a similar spirit, insofar as we avoid trying to interact with unknown/future GHCs to the extent this is practicable.
To restate the basic principle of the compatibility contract
- A component (e.g.
cabal-installorlib:Cabal) can (at best) only advertise support for major versions of its downstream dependencies (e.g.lib:Cabalorghc) or formats (e.g..cabalspec) that were known and tested with at time of publication; we don't attempt to predict the future beyond the major version boundary
GHC version / lib:Cabal version Compatibility Matrix
To complement lib:Cabal warning about unknown GHC versions, and to avoid running into unsupported configurations we encode the compatiblity matrix as lower bounds on the lib:Cabal which interacts with GHC, and inject these as constraints to the solver.
The table below effectively encodes the respective major Cabal version bundled with the respective GHC release.
| Compiler | Implied constraint |
|---|---|
| GHC 8.4 | Cabal >= 2.2 |
| GHC 8.2 | Cabal >= 2.0 |
| GHC 8.0 | Cabal >= 1.24 |
| GHC 7.10 | Cabal >= 1.22 |
| any | Cabal >= 1.20 && < x.(y+1) (1) |
(1) base-line requirement of nix-style local builds; x.y denotes major version of cabal-install, i.e. cabal-install only knows how to interact with lib:Cabal versions it knows about
(original imported description)
(Imported from Trac #422, reported by @dcoutts on 2008-12-01)
It seems to often happen that newer versions of ghc make changes that break old versions of Cabal. This is particularly a problem for cabal-install since that need not necessarily be upgraded when ghc is upgraded.
Probably it should warn if the major version is bigger than the known version at the time.
Activity
tibbe commentedon May 15, 2014
Closing as there's been no activity in years.
We're cleaning up the bug tracker to make it useful again and are thus closing bugs that haven't seen any activity in a long time. Please re-open (or file a new bug) if the problem reappears.
phadej commentedon Jul 17, 2017
Let's reopen this, people use
CABALVER=1.24 GHCVER=8.2.1in CI, and it works by accident. I don't think this is hard issue to fix, if someone (maybe new contributor) picks this up![-]Cabal should warn if using a version of ghc that is newer than Cabal knows about[/-][+]cabal-install should warn if using a version of ghc that is newer than it knows about[/+]ezyang commentedon Jul 20, 2017
Hey @phadej, I'd like the newcomer tag to refer to tickets which have instructions for how to get started (e.g., where to look in the codebase, etc.) Maybe you could fill those out and then retag this one?
Emit warning when an unknown GHC version is encountered
Emit warning when an unknown GHC version is encountered
Implement ghc/cabal compatiblity matrix (re haskell#415)
Implement ghc/cabal compatiblity matrix (re haskell#415)
Merge pull request #5177
1 remaining item
Merge pull request #5180 from hvr/pr/2.2/issue-415c
Set upper bound on setup.Cabal relative to current version
Merge pull request #5183 from hvr/pr/2.3/issue-415c
Update regression test for issue haskell#4154 after the fix for issue h…
Update regression test for issue haskell#4154 after the fix for issue h…
Merge pull request #5186 from grayjay/update-T4154
Update regression test for issue haskell#4154 after the fix for issue h…
Emit warning when an unknown GHC version is encountered
Emit warning when an unknown GHC version is encountered
Merge pull request #5192 from grayjay/update-T4154-2.2
Update custom-setup lower bounds for GHC 8.6 (c.f. #415)
Update custom-setup lower bounds for GHC 8.6 (c.f. #415)
Update custom-setup lower bounds for GHC 8.8 (c.f. #415)
jneira commentedon Jun 29, 2022
hi, from the commits and prs linking this issue I would say it can be closed (specially for #5194 which added just what was requested originally in the issue)