@@ -131,6 +131,7 @@ import qualified Data.Map as Map
131
131
import qualified Data.Set as Set
132
132
import Control.Exception
133
133
( assert )
134
+ import qualified Control.Arrow as list
134
135
135
136
136
137
-- ------------------------------------------------------------
@@ -395,24 +396,31 @@ dontUpgradeNonUpgradeablePackages params =
395
396
(PackageConstraint (ScopeAnyQualifier pkgname) PackagePropertyInstalled )
396
397
ConstraintSourceNonUpgradeablePackage
397
398
| Set. notMember (mkPackageName " base" ) (depResolverTargets params)
398
- -- If you change this enumeration, make sure to update the list in
399
- -- "Distribution.Solver.Modular.Solver" as well
400
- , pkgname <- [ mkPackageName " base"
401
- , mkPackageName " ghc-bignum"
402
- , mkPackageName " ghc-prim"
403
- , mkPackageName " ghc-boot"
404
- , mkPackageName " ghc"
405
- , mkPackageName " ghci"
406
- , mkPackageName " integer-gmp"
407
- , mkPackageName " integer-simple"
408
- , mkPackageName " template-haskell"
409
- ]
399
+ , pkgname <- nonUpgradeablePackages
410
400
, isInstalled pkgname ]
411
401
412
402
isInstalled = not . null
413
403
. InstalledPackageIndex. lookupPackageName
414
404
(depResolverInstalledPkgIndex params)
415
405
406
+ -- NOTE: the lists of non-upgradable and non-installable packages use to be
407
+ -- respectively in this module and in `Distribution.Solver.Modular.Solver`.
408
+ -- Since they were kept synced, they are now combined in the following list.
409
+ --
410
+ -- See: https://github.com/haskell/cabal/issues/8581
411
+ nonUpgradeablePackages :: [PackageName ]
412
+ nonUpgradeablePackages =
413
+ [ mkPackageName " base"
414
+ , mkPackageName " ghc-bignum"
415
+ , mkPackageName " ghc-prim"
416
+ , mkPackageName " ghc-boot"
417
+ , mkPackageName " ghc"
418
+ , mkPackageName " ghci"
419
+ , mkPackageName " integer-gmp"
420
+ , mkPackageName " integer-simple"
421
+ , mkPackageName " template-haskell"
422
+ ]
423
+
416
424
addSourcePackages :: [UnresolvedSourcePackage ]
417
425
-> DepResolverParams -> DepResolverParams
418
426
addSourcePackages pkgs params =
@@ -469,7 +477,7 @@ removeBounds relKind relDeps params =
469
477
}
470
478
where
471
479
sourcePkgIndex' :: PackageIndex. PackageIndex UnresolvedSourcePackage
472
- sourcePkgIndex' = fmap relaxDeps $ depResolverSourcePkgIndex params
480
+ sourcePkgIndex' = relaxDeps <$> depResolverSourcePkgIndex params
473
481
474
482
relaxDeps :: UnresolvedSourcePackage -> UnresolvedSourcePackage
475
483
relaxDeps srcPkg = srcPkg
@@ -710,7 +718,8 @@ resolveDependencies platform comp pkgConfigDB solver params =
710
718
$ fmap (validateSolverResult platform comp indGoals)
711
719
$ runSolver solver (SolverConfig reordGoals cntConflicts fineGrained minimize
712
720
indGoals noReinstalls
713
- shadowing strFlags allowBootLibs onlyConstrained_ maxBkjumps enableBj
721
+ shadowing strFlags allowBootLibs nonUpgradeablePackages
722
+ onlyConstrained_ maxBkjumps enableBj
714
723
solveExes order verbosity (PruneAfterFirstSuccess False ))
715
724
platform comp installedPkgIndex sourcePkgIndex
716
725
pkgConfigDB preferences constraints targets
0 commit comments