diff --git a/cabal-install/src/Distribution/Client/Dependency.hs b/cabal-install/src/Distribution/Client/Dependency.hs index 5bc5ec51b86..056d0ffed05 100644 --- a/cabal-install/src/Distribution/Client/Dependency.hs +++ b/cabal-install/src/Distribution/Client/Dependency.hs @@ -456,19 +456,34 @@ dontUpgradeNonUpgradeablePackages params = . InstalledPackageIndex.lookupPackageName (depResolverInstalledPkgIndex params) --- NOTE: the lists of non-upgradable and non-installable packages used to be +-- | The set of non-reinstallable packages includes those which cannot be +-- rebuilt using a GHC installation and Hackage-published source distribution. +-- There are a few reasons why this might be true: +-- +-- * the package overrides its unit ID (e.g. with ghc's @-this-unit-id@ flag), +-- which can result in multiple indistinguishable packages (having potentially +-- different ABIs) with the same unit ID. +-- +-- * the package contains definitions of wired-in declarations which tie +-- it to a particular compiler (e.g. we can't build link against +-- @base-4.18.0.0@ using GHC 9.6.1). +-- +-- * the package does not have a complete (that is, buildable) source distribution. +-- For instance, some packages provided by GHC rely on files outside of the +-- source tree generated by GHC's build system. +-- +-- Note: the list of non-upgradable/non-installable packages used to be -- respectively in this module and in `Distribution.Solver.Modular.Solver`. -- Since they were kept synced, they are now combined in the following list. -- --- See: https://github.com/haskell/cabal/issues/8581 +-- See: https://github.com/haskell/cabal/issues/8581 and +-- https://github.com/haskell/cabal/issues/9064. nonUpgradeablePackages :: [PackageName] nonUpgradeablePackages = [ mkPackageName "base" , mkPackageName "ghc-bignum" , mkPackageName "ghc-prim" - , mkPackageName "ghc-boot" , mkPackageName "ghc" - , mkPackageName "ghci" , mkPackageName "integer-gmp" , mkPackageName "integer-simple" , mkPackageName "template-haskell" diff --git a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs index dedb20bc70c..d5973598fa9 100644 --- a/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs +++ b/cabal-install/tests/UnitTests/Distribution/Solver/Modular/Solver.hs @@ -203,12 +203,6 @@ tests = , runTest $ mkTest dbNonupgrade "Refuse to install newer ghc requested by another library" ["A"] $ solverFailure (isInfixOf "rejecting: ghc-2.0.0 (constraint from non-upgradeable package requires installed instance)") - , runTest $ - mkTest dbNonupgrade "Refuse to install newer ghci requested by another library" ["B"] $ - solverFailure (isInfixOf "rejecting: ghci-2.0.0 (constraint from non-upgradeable package requires installed instance)") - , runTest $ - mkTest dbNonupgrade "Refuse to install newer ghc-boot requested by another library" ["C"] $ - solverFailure (isInfixOf "rejecting: ghc-boot-2.0.0 (constraint from non-upgradeable package requires installed instance)") ] , testGroup "reject-unconstrained" @@ -1301,8 +1295,6 @@ dbBase = dbNonupgrade :: ExampleDb dbNonupgrade = [ Left $ exInst "ghc" 1 "ghc-1" [] - , Left $ exInst "ghci" 1 "ghci-1" [] - , Left $ exInst "ghc-boot" 1 "ghc-boot-1" [] , Right $ exAv "ghc" 2 [] , Right $ exAv "ghci" 2 [] , Right $ exAv "ghc-boot" 2 []