Skip to content

dyld: Library not loaded: @rpath/libffi.7.dylib

Summary

After a recent pull, I can't build GHC on macOS+nix anymore. Clean build fails with:

# ghc-config (for _build/test/ghcconfig)
dyld: Library not loaded: @rpath/libffi.7.dylib
  Referenced from: /Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190530/libHSrts-1.0_thr-ghc8.9.0.20190530.dylib
  Reason: image not found
ghc-config: readCreateProcess: /Users/int-index/Projects/ghc/_build/stage1/bin/ghc "+RTS" "--info" (exit -6): failed
Error when running Shake build system:
  at want, called at src/Main.hs:75:30 in main:Main
* Depends on: test
  at need, called at src/Rules/Test.hs:186:9 in main:Rules.Test
* Depends on: _build/test/ghcconfig
* Raised the exception:
user error (Development.Shake.cmd, system command failed
Command line: _build/test/bin/ghc-config /Users/int-index/Projects/ghc/_build/stage1/bin/ghc
Exit code: 1
Stderr:
dyld: Library not loaded: @rpath/libffi.7.dylib
  Referenced from: /Users/int-index/Projects/ghc/_build/stage1/lib/x86_64-osx-ghc-8.9.0.20190530/libHSrts-1.0_thr-ghc8.9.0.20190530.dylib
  Reason: image not found
ghc-config: readCreateProcess: /Users/int-index/Projects/ghc/_build/stage1/bin/ghc "+RTS" "--info" (exit -6): failed
)

Judging by the error message, I suspect 3aa71a22 might be involved, therefore I assign to @alp

Steps to reproduce

  1. nix-shell https://github.com/alpmestan/ghc.nix/archive/master.tar.gz
  2. ./boot && ./configure
  3. hadrian/build.sh --flavour=Quick

Expected behavior

Successful build.

Environment

  • GHC version used: HEAD
  • Operating System: macOS Mojave 10.14.4
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information