Stop! Tickets are now managed at GitHub.

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


Ticket #71 (closed defect: fixed)

Opened 5 years ago

Last modified 5 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
Cc:

Description

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):
	cat_evals
    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 5 years ago by anonymous

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

Changed 5 years ago by gregorycollins

  • priority changed from major to blocker

GHC is tracking this as http://hackage.haskell.org/trac/ghc/ticket/3275, 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    ==0.72.0.2,
    regex-compat  ==0.71.0.1,
    regex-posix   ==0.72.0.3,
    ...
    
  • 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 5 years ago by dons

@gregorycollins

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 
mtl-1.1.0.2
happy-1.18.4
HUnit-1.2.0.3
OpenGL-2.2.1.1
GLUT-2.1.1.2
QuickCheck-1.2.0.0
alex-2.3.1
editline-0.2.1.0
haskell-src-1.0.1.3
html-1.0.1.2
fgl-5.4.2.2
parallel-1.1.0.1
parsec-2.1.0.1
network-2.2.1.1
HTTP-4000.0.6
regex-base-0.72.0.2
regex-posix-0.72.0.3
regex-compat-0.71.0.1
stm-2.1.1.2
time-1.1.2.4
xhtml-3000.2.0.1
cgi-3001.1.7.1
zlib-0.5.0.0
cabal-install-0.6.2

So you can then install the in order. http://code.haskell.org/haskell-platform/src/generic/

Changed 5 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 5 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 5 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.