Open adamgundry opened 1 month ago
I've opened #10093 to add ghc-internal
to the list, since that is otherwise wrong for GHC 9.10. We don't need to resolve base
and template-haskell
just yet.
Ideally we would keep template-haskell
in the list for existing GHC versions but remove it for future versions. Perhaps GHC should expose some interface whereby cabal-install
can query the list of non-reinstallable packages?
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 ghc
is in the closure.
[("base", Nothing), -- non-reinstallable in this version
("ghc", Just […]) -- list of packages that are non-reinstallable if "ghc" is used
]
(quick example only, I don't know enough about the details)
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
.
Perhaps GHC should expose some interface whereby cabal-install can query the list of non-reinstallable packages?
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.0
or ghc-internal-9.1001.1
are not reinstallable packages, they shouldn't be in Hackage index (= the input to solver) to begin with.
@geekosaur Package distributed with ghc
are reinstallable unless the build plan contains ghc
. The reason that already installed packages are preferred is #9669 which is unrelated to this ticket as far as I can tell.
"The build plan contains ghc
" is exactly the case I want to capture. I think I missed a case, though: Just []
captures things like text
which are reinstallable.
cabal-install
maintains a list ofnonReinstallablePackages
, 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.template-haskell
package, so it can be removed from the list (cf. #4185).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?
https://github.com/haskell/cabal/blob/dda541cebcde25b3324dac4a59c8b9eb98b01e6a/cabal-install/src/Distribution/Client/Dependency.hs#L447-L471