Open
Description
In attempting to create libgit2 bindings for Idris 2, I've run into some usability issues with the Idris REPL that make it difficult to work with external shared objects. I've copied my .ipkg
and Makefile
from the Idris2 sample FFI-readline
. The FFI-readline
project is in a pretty poor state (I'll make another issue for that). My small motivating example can be found in this repo.
Steps to Reproduce
- Clone my repository
- Install the package with
idris2 --install libgit.ipkg
- Open a repl with
idris2
- Import the module
:module Libgit
- Attempt a call to my function
Main> :exec logSomething "sup" Exception: (while loading libgit_idris_wrapper.so) libgit_idris_wrapper.so: cannot open shared object
I can fix this by setting the LD_LIBRARY_PATH manually e.g.
$ LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$(idris2 --libdir)/libgit/lib"
Main> :module Libgit
Imported module Libgit
Main> :exec logSomething "sup"
logging: sup
Expected Behavior
idris2
adds the lib/
folder in installed package paths to LD_LIBRARY_PATH e.g. $(idris2 --libdir)/libgit/lib
Observed Behavior
LD_LIBRARY_PATH is not updated to include the package-specific library paths, resulting in an error opening the shared object.