Allow GHC library to be reinstalled
While the GHC library currently has a .cabal
file, the information that it captures is not sufficient to build the package as a "normal" Haskell package. Consequently, ghc
must be built using the GHC build system and the rest of the ecosystem (e.g. cabal-install
) considers it to be non-reinstallable. This has a few unfortunate implications:
- users of the GHC API must use precisely the dependency packages that
ghc
links against - GHC binary distributions must ship the
ghc
library in every conceivable way that the user might need
However there is no good reason why ghc
can't be made to be reinstallable and shipped as a normal Hackage package (with some restrictions). Specifically, this involves:
- moving all of the ad-hoc compiler flags encoded in the build system into the
.cabal
file - moving any code generation logic from the build system into a custom
Setup.hs