Stop! Tickets are now managed at GitHub.

Please enter new tickets, and find and edit existing tickets there:

Ticket #71 (closed defect: fixed)

Opened 8 years ago

Last modified 8 years ago

OSX installer should build platform libraries in topological order

Reported by: anonymous Owned by: gregorycollins
Priority: blocker Milestone:
Component: OSX installer Keywords: OS X, darcs


When I install GHC and the Platform from the beta .dmg, and try to do 'cabal install darcs', I get a GHC panic:

ghc: panic! (the 'impossible' happened)
  (GHC version 6.10.3 for i386-apple-darwin):
    base:GHC.Arr.Array{d ras}
    [ww{v aKhO} [lid], ww1{v aKhP} [lid], ww2{v aKhQ} [lid]]
    [!, !, _, _]

This only happens when I use the platform, and also happens when I try to install the tarball from the darcs website. If I install only GHC (either from the Platform .dmg or the GHC website) and zlib, HTTP and cabal-install manually, then install darcs with cabal install, there is no problem.

Change History

Changed 8 years ago by anonymous

  • owner set to dons
  • component changed from (none-specified) to Platform

Changed 8 years ago by gregorycollins

  • priority changed from major to blocker

GHC is tracking this as, I'll cc: this message to the ticket there.

There must be some subtle ABI incompatibility that is triggering this. Actually, I bet I know what's causing this. Roughly speaking, here's the sequence of events when I build the installer:

  • I install GHC from binary
  • I build the libraries in LISTED order (we'll return to this):
    regex-base    ==,
    regex-compat  ==,
    regex-posix   ==,
  • Each library gets packaged into a .pkg file which, when installed, copies the generated libs to the destination and runs "ghc-pkg register"

So regex-compat gets built against GHC's regex-posix instead of the platform's, then we build a NEW regex-posix against the platform libraries and GHC panics when you try to use -compat. The two regex-posix libraries have the same version number but are installed in different places and obviously aren't binary-identical, probably some autogenerated symbol names are different.

The obvious workaround is to build and install the platform libraries in strict topological order -- could we re-order haskell-platform.cabal so that each library's dependencies are listed before it? Or could someone tell me how to do this topological sort using the Cabal library?

Hopefully this message will create an "aha!" moment for someone who knows the GHC internals better than I do (which is to say, "not at all").

Changed 8 years ago by dons


As luck would have it, the generic unix source bundle already has a script to generate dependencies in topological order:

$ runhaskell Build.hs ../../haskell-platform.cabal z

Will generate z/platform.packages containing:

$ cat platform.packages 

So you can then install the in order.

Changed 8 years ago by gregorycollins

  • owner changed from dons to gregorycollins
  • status changed from new to assigned
  • component changed from Platform to OSX installer
  • summary changed from GHC panic on cabal install of darcs w/ Platform to OSX installer should build platform libraries in topological order

Changed 8 years ago by gregorycollins

This should be fixed with the latest installer but I don't want to close it until I get confirmation of that.

Changed 8 years ago by gregorycollins

  • status changed from assigned to closed
  • resolution set to fixed

This should be fixed now -- I was getting problems with auto-generated symbols mismatching before, now I'm building subsequent packages against verbatim copies of packages generated earlier, everything should (hopefully) line up now. Closing.

Note: See TracTickets for help on using tickets.