Open bigs opened 4 years ago
As a side note, I've made some progress (setting LD_LIBRARY_PATH on my own), so I'd be happy to contribute some fixes to get FFI-readline in ship shape!
@gallais Do you have any ideas as to how shared libraries should be handled by Idris 2 packages? Should they simply be installed somewhere on a user's LD_LIBRARY_PATH? Installing into the idris2 package directories would be suitable for the REPL, where we could modify the environment some, but I worry that it wouldn't be suitable for compiled binaries. I'm happy to take the lead of implementation if we have a solid idea, even if it's just documenting some best practices.
I don't know much about the FFI and even less about interop with other languages / libraries, sorry.
No problem and thanks for the speedy reply! I'll do some noodling and see if I can come up with something reasonable.
Open a repl with idris2
Surely you should open it with idris2 -p libgit
?
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
andMakefile
from the Idris2 sampleFFI-readline
. TheFFI-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
idris2 --install libgit.ipkg
idris2
:module Libgit
I can fix this by setting the LD_LIBRARY_PATH manually e.g.
Expected Behavior
idris2
adds thelib/
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.