Skip to content

ffi.h missing when building parallel on Darwin

I've had this annoyance for a while building from a clean tree on macOS

Steps to reproduce:

% ./boot
% ./configure
% ./hadrian/build -j

The build fails building ghc-prim with a missing ffi.h error. The quickest way to do a full build is:

% ./hadrian/build -j
   # wait until failure
% ./hadrian/build
^C # (after libffi/rts have been built completely)
% ./hadrian/build -j
   # wait until build finishes

Perhaps the failure depends on the number of jobs, it fails reliably on my 12-core M2 Max CPU.

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information