
On Sun, Nov 12, 2017 at 8:14 PM, Brandon Allbery
This is something of a nasty problem, considering that storing uninstall information separately is not particularly robust. Perhaps ghc-pkg should, if it doesn't already, support extension fields that e.g. cabal can use to store uninstall information. (But even that potentially has problems, given that people are known to copy package registration information between package databases. If there is uninstall information in there, what happens if someone uninstalls via one or the other copy?)
Aren't packages only allowed to install a restricted set of things into a restricted set of places? We have the code (.hi, .a, .so, etc., in import-dirs / library-dirs), possibly library-specific data (I assume that's data-dir), and haddock (haddock-html and haddock-interfaces, awkwardly in separate places). One problem is that I don't fully understand what those fields mean, is there documentation somewhere? And then the fact that these are all plural so presumably you could have a lot of them, what is that for? I'm guessing library-dirs means something like "put this on your -L line" so it's clearly a mistake to interpret that as "here's where I put the library", and you'll have things like /usr/local/lib if you need to link external libraries. Is there any more complicated install plan than put *.a, *.so, *.hi in $root/lib/$ghc/$package-$id, put haddock in $root/share/doc/$ghc/$package, put ad-hoc junk in $root/share/$ghc/$package? I assume there must be, but who's doing that and why? If it's OS packages, then they have their own uninstall mechanisms, presumably not ghc's problem.