Thanks to visit codestin.com
Credit goes to github.com

Skip to content

macOS 26: fatal error: 'ffi.h' file not found #94

@mc

Description

@mc

(used brew to install most of the prerequisites, then went to)

% cabal v1-install tidal (as mentioned in https://raw.githubusercontent.com/tidalcycles/tidal-bootstrap/master/tidal-bootstrap.command)

output stuttered in

[...]
Building library for clock-0.8.4...
[1 of 2] Compiling System.Clock     ( dist/build/System/Clock.hs, dist/build/System/Clock.o, dist/build/System/Clock.dyn_o )
System/Clock.hsc:134:44: warning: [GHC-90584] [-Wderiving-typeable]
    • Deriving ‘Typeable’ has no effect: all types now auto-derive Typeable
    • In the data declaration for ‘Clock’
    |
134 |   deriving (Eq, Enum, Generic, Read, Show, Typeable)
    |                                            ^^^^^^^^

System/Clock.hsc:235:36: warning: [GHC-90584] [-Wderiving-typeable]
    • Deriving ‘Typeable’ has no effect: all types now auto-derive Typeable
    • In the data declaration for ‘TimeSpec’
    |
235 |   } deriving (Generic, Read, Show, Typeable)
    |                                    ^^^^^^^^

In file included from /var/folders/d8/plt8hkrj51l4vdplxlwbfrrw0000gn/T/ghc73147_tmp_0_0/ghc_tmp_0_2.c:4:0: error:
    

/opt/homebrew/Cellar/ghc/9.12.2/lib/ghc-9.12.2/lib/../lib/aarch64-osx-ghc-9.12.2-inplace/rts-1.0.2/include/rts/ghc_ffi.h:28:10: error:
     fatal error: 'ffi.h' file not found
       28 | #include "ffi.h"
          |          ^~~~~~~
   |
28 | #include "ffi.h"
   |          ^

1 error generated.
<no location info>: error:
    `clang' failed in phase `C Compiler'. (Exit code: 1)

cabal: Leaving directory '/var/folders/d8/plt8hkrj51l4vdplxlwbfrrw0000gn/T/cabal-tmp-73008/clock-0.8.4'

gcc showed includes being used as

% gcc -E -Wp,-v -
clang -cc1 version 17.0.0 (clang-1700.4.4.1) default target arm64-apple-darwin25.1.0
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/local/include"
ignoring nonexistent directory "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/Library/Frameworks"
#include "..." search starts here:
#include <...> search starts here:
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/17/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include
 /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks (framework directory)
 /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/SubFrameworks (framework directory)
End of search list.
# 1 "<stdin>"
# 1 "<built-in>" 1
# 1 "<built-in>" 3
# 466 "<built-in>" 3
# 1 "<command line>" 1
# 1 "<built-in>" 2
# 1 "<stdin>" 2

went hunting down ffi.h

% cd /Applications/Xcode.app/Contents/Developer 

% find . -name ffi.h
./Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/ffi/ffi.h

huh,

did

mkdir -p /usr/local/include
echo '#include "ffi/ffi.h"' > /usr/local/include/ffi.h

Compile was now successful.

Not sure if this is 26 oddity, or some brew oddity (I think not), but maybe its helpful for others.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions