-
Notifications
You must be signed in to change notification settings - Fork 696
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
cabal-install should warn if using a version of ghc that is newer than it knows about #415
Comments
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. |
Let's reopen this, people use |
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? |
This finally addresses the long-standing ticket haskell#415
This injects lower-bound constraints on Cabal for custom setup dependencies to prevent the solver from selecting unsupported configurations. Previously we already added an absolute lower bound `Cabal >= 1.20` for nix-local builds, as that's the minimum version we need to be able to interact with custom Setup.hs scripts. This refines with logic by restricting that lower bound even more based on GHC version. This patch augments this with the following rules: - GHC 8.4+ constrains Cabal >= 2.2 - GHC 8.2 constrains Cabal >= 2.0 - GHC 8.0 constrains Cabal >= 1.24 - GHC 7.10 constrains Cabal >= 1.22 - (default constraint Cabal >= 1.20) This only affects nix-style local builds codepaths.
This injects lower-bound constraints on Cabal for custom setup dependencies to prevent the solver from selecting unsupported configurations. Previously we already added an absolute lower bound `Cabal >= 1.20` for nix-local builds, as that's the minimum version we need to be able to interact with custom Setup.hs scripts. This refines with logic by restricting that lower bound even more based on GHC version. This patch augments this with the following rules: - GHC 8.4+ constrains Cabal >= 2.2 - GHC 8.2 constrains Cabal >= 2.0 - GHC 8.0 constrains Cabal >= 1.24 - GHC 7.10 constrains Cabal >= 1.22 - (default constraint Cabal >= 1.20) This only affects nix-style local builds codepaths. (cherry picked from commit 71e797e)
As we can't predict the future, we also place a global upper bound on the lib:Cabal version we know how to interact with: The upper bound is computed by incrementing the current major version twice in order to allow for the current version, as well as the next adjacent major version (one of which will not be released, as only "even major" versions of Cabal are released to Hackage or bundled with proper GHC releases). For instance, if the current version of cabal-install is an odd development version, e.g. Cabal-2.1.0.0, then we impose an upper bound `setup.Cabal < 2.3`; if `cabal-install` is on a stable/release even version, e.g. Cabal-2.2.1.0, the upper bound is `setup.Cabal < 2.4`. This gives us enough flexibility when dealing with development snapshots of Cabal and cabal-install. This addresses haskell#415
As we can't predict the future, we also place a global upper bound on the lib:Cabal version we know how to interact with: The upper bound is computed by incrementing the current major version twice in order to allow for the current version, as well as the next adjacent major version (one of which will not be released, as only "even major" versions of Cabal are released to Hackage or bundled with proper GHC releases). For instance, if the current version of cabal-install is an odd development version, e.g. Cabal-2.1.0.0, then we impose an upper bound `setup.Cabal < 2.3`; if `cabal-install` is on a stable/release even version, e.g. Cabal-2.2.1.0, the upper bound is `setup.Cabal < 2.4`. This gives us enough flexibility when dealing with development snapshots of Cabal and cabal-install. This addresses haskell#415 (cherry picked from commit e66106c)
…askell#415. This commit addresses the comments in PR haskell#5183.
…askell#415. This commit addresses the comments in PR haskell#5183.
…askell#415. This commit addresses the comments in PR haskell#5183. (cherry picked from commit 2b197f8)
This finally addresses the long-standing ticket haskell#415 (cherry picked from commit 5339b36)
This finally addresses the long-standing ticket haskell#415 (cherry picked from commit 5339b36)
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) |
(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 usinglib: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
cabal-install
orlib:Cabal
) can (at best) only advertise support for major versions of its downstream dependencies (e.g.lib:Cabal
orghc
) or formats (e.g..cabal
spec) that were known and tested with at time of publication; we don't attempt to predict the future beyond the major version boundaryGHC version /
lib:Cabal
version Compatibility MatrixTo complement
lib:Cabal
warning about unknown GHC versions, and to avoid running into unsupported configurations we encode the compatiblity matrix as lower bounds on thelib: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.
Cabal >= 2.2
Cabal >= 2.0
Cabal >= 1.24
Cabal >= 1.22
Cabal >= 1.20 && < x.(y+1)
(1)(1) base-line requirement of nix-style local builds;
x.y
denotes major version ofcabal-install
, i.e.cabal-install
only knows how to interact withlib: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.
The text was updated successfully, but these errors were encountered: