Trying to build an OS X installer is currently deadlocking when
inplace/bin/ghc-cabal install /Users/ian/ghc/6.12-branch/val/dest/Users/ian/ghc/6.12-branch/val/inst/lib/ghc-220.127.116.1190925/ghc-stage2 /Users/ian/ghc/6.12-branch/val/dest/Users/ian/ghc/6.12-branch/val/inst/lib/ghc-18.104.22.16890925/ghc-pkg /Users/ian/ghc/6.12-branch/val/dest/Users/ian/ghc/6.12-branch/val/inst/lib/ghc-22.214.171.12490925 compiler stage2 /Users/ian/ghc/6.12-branch/val/dest /Users/ian/ghc/6.12-branch/val/inst /Users/ian/ghc/6.12-branch/val/inst/lib/ghc-126.96.36.19990925 /Users/ian/ghc/6.12-branch/val/inst/share/doc/ghc/html/libraries
/Users/ian/ghc/6.12-branch/val/dest/Users/ian/ghc/6.12-branch/val/inst/lib/ghc-188.8.131.5290925/ghc-pkg --global-conf /Users/ian/ghc/6.12-branch/val/dest/Users/ian/ghc/6.12-branch/val/inst/lib/ghc-184.108.40.20690925/package.conf.d --force update - --global
-threaded fixes the problem. I believe the problem is that when we are using a
DESTDIR we get a large amount of warnings (more than a buffer full) like:
ghc-220.127.116.1190925: file AsmCodeGen.hi is missing (ignoring)
_ <- forkIO $ do _ <- evaluate (length err); return () _ <- forkIO $ do _ <- evaluate (length out); return () -- push all the input hPutStr inh input hClose inh -- wait for the program to terminate exitcode <- waitForProcess pid unless (exitcode == ExitSuccess) (die err)
deadlocks unless it is compiled with
-threaded, as the forked evaluate threads don't get a chance to run.
The simple fix is to link with
-threaded, but I'm not sure that we want to assume that
-threaded works - especially as it needs to work in the bootstrapping compiler.
Can we eliminate calls to this, and any other problematic, functions?