[Haskell-cafe] uninstalling libraries
allbery.b at gmail.com
Mon Nov 13 04:14:59 UTC 2017
The problem is that the package db contains only what ghc needs to be able
to use the library; not the additional information needed to safely remove
it. (There are other package systems with this problem, notably Apple's.
Apple decided that instead of solving it, they would only support
applications that are complete bundles in and of themselves.) And arguably
it doesn't actually belong in ghc-pkg insofar as it's not intended to do
anything but store the information needed for ghc to link against packages.
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?)
On Sun, Nov 12, 2017 at 10:53 PM, Evan Laforge <qdunkan at gmail.com> wrote:
> For a very long time, I've used a local script to uninstall libraries.
> Initially it was very simple: use ghc-pkg field to find and remove
> library-dirs, import-dirs, and haddock-html, and call ghc-pkg
> It served well for a long time, but eventually I got tired of copy
> paste games and extended it to be able to recursively delete
> dependents too. Unfortunately now it's no longer so simple. The main
> problem is that the only way I know to find dependents is to ghc-pkg
> unregister, and see what the error message complains about. That's
> obviously pretty bad, since by that time you've already unregistered,
> so it's too late to back out. The non-atomic nature of unregister+rm
> has always caused problems anyway, since if unregister succeeds, but
> the remove fails, we are stuck with a partial install. Recursive
> delete is too error prone, so I reverted that.
> And then I discovered that hmatrix helpfully includes /opt/local/lib
> and /usr/local/lib in its library-dirs, so clearly just deleting
> whatever the package tells me is not very safe. All this has led me
> to believe uninstalling packages is not so simple, and maybe there
> should be an actual real way to do it, not everyone hacking up their
> own dangerous shell scripts.
> So... is there? Should there be one? Is there interest in one? How
> do other people uninstall libraries? Is there a better interface to
> the pkg db than ghc-pkg? Is there a better way to find dependents
> than ghc-pkg unregister?
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users at haskell.org
brandon s allbery kf8nh sine nomine associates
allbery.b at gmail.com ballbery at sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad http://sinenomine.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe