Skip to content

Commit 2e32a44

Browse files
bgamariulysses4ever
authored andcommitted
cabal-install: Fix non-reinstallable package set
In #9064 we discovered that `ghc-boot` was added to the non-reinstallable package set due to #8051 despite there being no reason why it can't be built from its source distribution. This revealed the fact that there is quite some ambiguity around what constitutes a non-reinstallable package. In #9064 we worked out a hopefully-more-clear picture of non-reinstallability. Here we update the commentary to describe this concept and update the lists to reflect the new definition. Closes #9064.
1 parent 6af0c08 commit 2e32a44

File tree

1 file changed

+19
-4
lines changed

1 file changed

+19
-4
lines changed

cabal-install/src/Distribution/Client/Dependency.hs

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -456,19 +456,34 @@ dontUpgradeNonUpgradeablePackages params =
456456
. InstalledPackageIndex.lookupPackageName
457457
(depResolverInstalledPkgIndex params)
458458

459-
-- NOTE: the lists of non-upgradable and non-installable packages used to be
459+
-- | The set of non-reinstallable packages includes those which cannot be
460+
-- rebuilt using a GHC installation and Hackage-published source distribution.
461+
-- There are a few reasons why this might be true:
462+
--
463+
-- * the package overrides its unit ID (e.g. with ghc's @-this-unit-id@ flag),
464+
-- which can result in multiple indistinguishable packages (having potentially
465+
-- different ABIs) with the same unit ID.
466+
--
467+
-- * the package contains definitions of wired-in declarations which tie
468+
-- it to a particular compiler (e.g. we can't build link against
469+
-- @base-4.18.0.0@ using GHC 9.6.1).
470+
--
471+
-- * the package does not have a complete (that is, buildable) source distribution.
472+
-- For instance, some packages provided by GHC rely on files outside of the
473+
-- source tree generated by GHC's build system.
474+
--
475+
-- Note: the list of non-upgradable/non-installable packages used to be
460476
-- respectively in this module and in `Distribution.Solver.Modular.Solver`.
461477
-- Since they were kept synced, they are now combined in the following list.
462478
--
463-
-- See: https://github.com/haskell/cabal/issues/8581
479+
-- See: https://github.com/haskell/cabal/issues/8581 and
480+
-- https://github.com/haskell/cabal/issues/9064.
464481
nonUpgradeablePackages :: [PackageName]
465482
nonUpgradeablePackages =
466483
[ mkPackageName "base"
467484
, mkPackageName "ghc-bignum"
468485
, mkPackageName "ghc-prim"
469-
, mkPackageName "ghc-boot"
470486
, mkPackageName "ghc"
471-
, mkPackageName "ghci"
472487
, mkPackageName "integer-gmp"
473488
, mkPackageName "integer-simple"
474489
, mkPackageName "template-haskell"

0 commit comments

Comments
 (0)