ghci doesn't respect loaded packages' library-dirs
@RyanGlScott reported that packages which are built with cabal
and the extra-lib-dirs
cannot be loaded under ghci
as extra-lib-dirs
is not added to the library search path used by the dynamic linker (except on Windows).
Reproducer:
- Install OpenJDK 11
- Clone https://github.com/RyanGlScott/jimage
- Create a
cabal.project
adding the OpenJDK library directory toextra-lib-dirs
:$ cd jimage $ cat <<EOF >cabal.project.local package jimage extra-lib-dirs: /nix/store/pd4rnvmvy82irwrlsckp5qbi4rc0rivm-openjdk-11.0.9+11/lib/openjdk/lib ld-options: -Wl,-rpath=/nix/store/pd4rnvmvy82irwrlsckp5qbi4rc0rivm-openjdk-11.0.9+11/lib/openjdk/lib
- Build:
cabal v2-build modules-extraction --write-ghc-environment-files=always
- Try starting
ghci
. You should encounter a linker error