Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ fix ] loading of dylib on macOS Monterey #2078

Merged
merged 2 commits into from
Nov 2, 2021

Conversation

chrrasmussen
Copy link
Contributor

Hi,

After upgrading to macOS 12 (Monterey) I was unable to run the idris2 executable that I had previously installed. Instead I was shown the following error:

Exception: (while loading libidris2_support.dylib) dlopen(libidris2_support.dylib, 0x0002): tried: 'libidris2_support.dylib' (no such file), '/usr/local/lib/libidris2_support.dylib' (no such file), '/usr/lib/libidris2_support.dylib' (no such file), '/Users/USER/Idris/Idris2-main/libidris2_support.dylib' (no such file), '/usr/local/lib/libidris2_support.dylib' (no such file), '/usr/lib/libidris2_support.dylib' (no such file)

Thanks to @ska80's clarification in INSTALL.md (commit 880981d) I was able to fix the problem. It appears that macOS Monterey requires DYLD_LIBRARY_PATH to be set (instead of LD_LIBRARY_PATH).

In order to make it possible to bootstrap Idris 2 on macOS Monterey from the main branch I also needed to update the Chez and Racket bootstrap files: The previous bootstrap files would generate the idris2 shell script with only LD_LIBRARY_PATH specified.


Similar error when bootstrapping from Racket:

idris2 --build prelude.ipkg
ffi-lib: couldn't open "libidris2_support.dylib" (dlopen(libidris2_support.dylib, 0x0006): tried: 'libidris2_support.dylib' (no such file), '/usr/local/lib/libidris2_support.dylib' (no such file), '/usr/lib/libidris2_support.dylib' (no such file), '/Users/USER/Idris/Idris2-main/libs/prelude/libidris2_support.dylib' (no such file), '/usr/local/lib/libidris2_support.dylib' (no such file), '/usr/lib/libidris2_support.dylib' (no such file))
  context...:
   /Applications/Racket v7.9/collects/ffi/unsafe.rkt:131:0: get-ffi-lib
   '#%mzc:idris2-boot: [running body]
   top-level: [running body]
make[2]: *** [all] Error 1
make[1]: *** [prelude] Error 2
make: *** [bootstrap-racket] Error 2

@gallais gallais added Installation Issue Problem compiling or running Idris os: mac labels Nov 1, 2021
@gallais
Copy link
Member

gallais commented Nov 1, 2021

Hmmm. Why was macos-bootstrap-chez skipped?

@chrrasmussen
Copy link
Contributor Author

I force-pushed to re-run the workflows. Looks better now (Still 2 Racket-related workflows skipped though).

@gallais gallais changed the title Fix loading of dylib on macOS Monterey [ fix ] loading of dylib on macOS Monterey Nov 2, 2021
@gallais gallais merged commit 44fc580 into idris-lang:main Nov 2, 2021
@chrrasmussen chrrasmussen deleted the fix-dylib-on-macos-monterey branch November 2, 2021 19:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Installation Issue Problem compiling or running Idris os: mac
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants