Skip to content

Idris REPL does not appropriately configure LD_LIBRARY_PATH #514

Open
@bigs

Description

@bigs

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

  1. Clone my repository
  2. Install the package with idris2 --install libgit.ipkg
  3. Open a repl with idris2
  4. Import the module :module Libgit
  5. 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions