-
Notifications
You must be signed in to change notification settings - Fork 723
Description
Issue #8489 showed that cabal contains two separate lists of packages that cannot be installed. This issue is for determining whether the lists have the same meaning and combining them if they are redundant. #8501 synced the contents of the two lists.
One is in the solver and is described as non-installable:
cabal/cabal-install-solver/src/Distribution/Solver/Modular/Solver.hs
Lines 158 to 173 in 09c90de
-- packages that can never be installed or upgraded | |
-- If you change this enumeration, make sure to update the list in | |
-- "Distribution.Client.Dependency" as well | |
nonInstallable :: [PackageName] | |
nonInstallable = | |
L.map mkPackageName | |
[ "base" | |
, "ghc-bignum" | |
, "ghc-prim" | |
, "ghc-boot" | |
, "ghc" | |
, "ghci" | |
, "integer-gmp" | |
, "integer-simple" | |
, "template-haskell" | |
] |
The other is in Distribution.Client.Dependency and is described as non-upgradable:
cabal/cabal-install/src/Distribution/Client/Dependency.hs
Lines 387 to 414 in 09c90de
-- | Some packages are specific to a given compiler version and should never be | |
-- upgraded. | |
dontUpgradeNonUpgradeablePackages :: DepResolverParams -> DepResolverParams | |
dontUpgradeNonUpgradeablePackages params = | |
addConstraints extraConstraints params | |
where | |
extraConstraints = | |
[ LabeledPackageConstraint | |
(PackageConstraint (ScopeAnyQualifier pkgname) PackagePropertyInstalled) | |
ConstraintSourceNonUpgradeablePackage | |
| Set.notMember (mkPackageName "base") (depResolverTargets params) | |
-- If you change this enumeration, make sure to update the list in | |
-- "Distribution.Solver.Modular.Solver" as well | |
, pkgname <- [ mkPackageName "base" | |
, mkPackageName "ghc-bignum" | |
, mkPackageName "ghc-prim" | |
, mkPackageName "ghc-boot" | |
, mkPackageName "ghc" | |
, mkPackageName "ghci" | |
, mkPackageName "integer-gmp" | |
, mkPackageName "integer-simple" | |
, mkPackageName "template-haskell" | |
] | |
, isInstalled pkgname ] | |
isInstalled = not . null | |
. InstalledPackageIndex.lookupPackageName | |
(depResolverInstalledPkgIndex params) |
If only one is needed, I think we should keep the one in Distribution.Client.Dependency, since it is better to make the solver more general and pass in constraints rather than hard code package names.