Repository navigation
Closed
Description
cabal-install maintains a list of nonReinstallablePackages, preventing certain packages being reinstalled by the user. This list needs some updates:
ghc-internal(released with GHC 9.10) should be considered non-reinstallable, so it needs to be added to the list.- Following the excellent work by @TeofilC in https://gitlab.haskell.org/ghc/ghc/-/merge_requests/12479, GHC 9.12 will allow reinstallation of the
template-haskellpackage, so it can be removed from the list (cf. Marktemplate-haskellnon-upgradable (again) #4185). - GHC 9.12 will hopefully allow reinstallation of
base; this is not yet fully implemented but is tracked in https://gitlab.haskell.org/ghc/ghc/-/issues/24903 (cc @mpickering).
The list of non-reinstallable packages does not currently depend on the compiler version. Really it should; is there an easy way to achieve this?
cabal/cabal-install/src/Distribution/Client/Dependency.hs
Lines 447 to 471 in dda541c
| -- | 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. | |
| nonReinstallablePackages :: [PackageName] | |
| nonReinstallablePackages = | |
| [ mkPackageName "base" | |
| , mkPackageName "ghc-bignum" | |
| , mkPackageName "ghc-prim" | |
| , mkPackageName "ghc" | |
| , mkPackageName "integer-gmp" | |
| , mkPackageName "integer-simple" | |
| , mkPackageName "template-haskell" | |
| ] |
Activity
solver: Prevent ghc-internal from being reinstalled (see #10087)
adamgundry commentedon Jun 9, 2024
I've opened #10093 to add
ghc-internalto the list, since that is otherwise wrong for GHC 9.10. We don't need to resolvebaseandtemplate-haskelljust yet.Ideally we would keep
template-haskellin the list for existing GHC versions but remove it for future versions. Perhaps GHC should expose some interface wherebycabal-installcan query the list of non-reinstallable packages?geekosaur commentedon Jun 9, 2024
I've been thinking it would be nice of the libdir contained a file of bootlibs and dependencies, which would allow us to both get the non-reinstallable libs and treat the others as non-reinstallable if
ghcis in the closure.(quick example only, I don't know enough about the details)
geekosaur commentedon Jun 9, 2024
Also, do we need to worry about the likes of
ghc-internal?-- ETA: wrong one, I saw several new internal libs in the list.
ghc-boot,ghc-boot-th,ghc-experimental.phadej commentedon Jun 9, 2024
The issue is that packages which cannot be actually built are uploaded to Hackage. AFAICT, the only reason is to provide haddocks in the common place with everything else. But I'd argue it's primarily a Hackage issue. If say
base-4.20.0.0orghc-internal-9.1001.1are not reinstallable packages, they shouldn't be in Hackage index (= the input to solver) to begin with.mpickering commentedon Jun 10, 2024
@geekosaur Package distributed with
ghcare reinstallable unless the build plan containsghc. The reason that already installed packages are preferred is #9669 which is unrelated to this ticket as far as I can tell.geekosaur commentedon Jun 10, 2024
"The build plan contains
ghc" is exactly the case I want to capture. I think I missed a case, though:Just []captures things liketextwhich are reinstallable.solver: Prevent ghc-internal from being reinstalled (see #10087)
solver: Prevent ghc-internal from being reinstalled (see #10087) (#10093
solver: Prevent ghc-internal from being reinstalled (see #10087) (#10093
solver: Prevent ghc-internal from being reinstalled (see #10087) (#10093
33 remaining items
Support getting nonreinstallable units from GHC
Expose ghc-internal unit id through the settings file
Expose ghc-internal unit id through the settings file
Expose ghc-internal unit id through the settings file
Expose ghc-internal unit id through the settings file
Support getting nonreinstallable units from GHC
Support getting nonreinstallable units from GHC
Support getting nonreinstallable units from GHC
Support getting nonreinstallable units from GHC
Support getting nonreinstallable units from GHC
Support getting nonreinstallable units from GHC
Support getting nonreinstallable units from GHC
Support getting nonreinstallable units from GHC
Support getting nonreinstallable units from GHC