Fwd: Using Cabal to install terminfo- breaks GHC on Debian x86_64

Ramin Honary ramin.honary at gmail.com
Mon Apr 14 17:35:20 UTC 2014

Hi, thanks for your reply.

Yes, I know for a fact I was installing to the global registry. All of my
Haskell projects depend on a few important packages, and I always install
these globally. For stuff I just want to play around with, I just install
into the user registry. Actually terminfo- is not something any of
my projects depend on, but I had installed it globally anyway and then this
problem occurred.

Also, the behavior Cabal installing Crypto- was odd. As I explained
in my first e-mail, some of the shared modules were being built with file
extensions of ".hi" instead of ".dyn_hi", but the "copy" phase of the Cabal
installation was searching for files with ".dyn_hi" extensions and was
failing. And not all modules were being built incorrectly, some modules had
the correct ".dyn_hi", others had just ".hi". This may be a problem with
the Crypto.cabal file, however.

But anyway, the transition to using shared libraries by default has (in my
experience) caused just these two hiccups. I'm glad I was able to expose
this problem.

-- Ramin Honary

On Mon, Apr 14, 2014 at 10:07 PM, Austin Seipp <austin at well-typed.com>wrote:

> Hi Ramin,
> Can I ask if you're installing packages into the global user database?
> If so, that's definitely the way for this to happen - otherwise, Cabal
> should never overwrite *anything* in the 'global' package directory
> (in your case, under /usr/local/lib/ghc-7.8.2...) This is the only way
> I can see this happening. In particular, installing 'terminfo' into my
> local package database ('cabal install terminfo') works fine...
> Carefully review your cabal configuration if you don't mind. You can
> also always force the installation using '--user' when running cabal.
> However, thank you very much for bringing this to my attention. What
> you have discovered is a real brainfart I don't think we had
> considered! The problem is that now that GHC is dynamically linked, we
> *cannot* get away with lying about whether those packages are
> installed - because they must install shared objects for GHC itself to
> work. That means overwriting them by accident (because we don't think
> they're installed) is a real possibility.
> Relatedly, the NixOS Haskell users are suffering from the same problem
> with 7.8.2 -
> http://lists.science.uu.nl/pipermail/nix-dev/2014-April/012992.html
> - same problem, slightly different symptoms.
> See https://ghc.haskell.org/trac/ghc/ticket/8919 for the ticket.
> So this is definitely a real problem. I think scheduling the change
> for 7.8.3 is correct.
> My intuition tells me the fix might actually be quite simple - don't
> lie about xhtml and terminfo being installed, and just be honest. Is
> there any particular downside to doing this? I don't think so, *other*
> than the fact it does mean terminfo has to come along when it's not
> part of the Haskell Platform!
> On Mon, Apr 14, 2014 at 7:08 AM, Ramin Honary <ramin.honary at gmail.com>
> wrote:
> > I am using Debian, not Mac. It is possible the problem may be with the
> > binary release for Debian x86_64, or it could just be my Cabal config
> file.
> >
> > When I install the binary distribution onto Debian, I simply run "make
> > install" in the ghc-7.8.2 directory. I don't know how this install
> process
> > the creates the GHC package registry, but after a fresh install, the
> output
> > of the "ghc-pkg list" command shows that "terminfo-" is NOT
> installed
> > even though there the /usr/local/lib/ghc-7.8.2/terminfo- directory
> > clearly exists and is populated with the correct library files. But
> since it
> > is not registered Cabal tries to re-build it and overwrites the existing
> > "terminfo-" package.
> >
> > After a fresh install on Mac or Fedora, I wonder if "terminfo-"
> shows
> > up in the GHC package registry? It could be the package registry for the
> > Debian binary distribution missed that detail.
> >
> >
> > _______________________________________________
> > Glasgow-haskell-users mailing list
> > Glasgow-haskell-users at haskell.org
> > http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
> >
> --
> Regards,
> Austin Seipp, Haskell Consultant
> Well-Typed LLP, http://www.well-typed.com/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/glasgow-haskell-users/attachments/20140415/c4c97fd8/attachment-0001.html>

More information about the Glasgow-haskell-users mailing list