ghc-pkg library
On Twitter, Anthony Cowley was wondering why there was no GHC API functions for taking Cabal InstalledPackageInfos and turning them into GHC InstalledPackageInfos. https://twitter.com/a_cowley/status/680158885953564672
No such interface exists: to keep GHC decoupled from Cabal, the GHC package representation is mediated solely by ghc-pkg, so the "correct" way to create a package config file, run ghc-pkg to load it into the GHC binary representation, and go from there.
It seems like it would be convenient if ghc-pkg was libified, and so people who linked against GHC and Cabal could just directly do the conversion without going through ghc-pkg. It's unclear what the right interface is; ghc-pkg does a number of sanity checks and it's unclear if those should be libified too. Any such library also must be uploaded to Hackage, because if you want to link against a newer version of Cabal you have to rebuild the ghc-pkg library against the newest version of Cabal.
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.11 |
| Type | FeatureRequest |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Package system |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | acowley |
| Operating system | |
| Architecture |