hrepl fails to load targets that depend on certain types of dynamic libraries.
This can be reproduced on the rules_haskell repository with the following command:
$ nix-shell --run 'hrepl //tests/binary-with-indirect-sysdeps:hs-lib'
GHCi, version 8.6.5: http://www.haskell.org/ghc/ :? for help
<command line>: User-specified static library could not be loaded (/home/aj/.cache/bazel/_bazel_aj/021cc9f0bfc60754963d997427e7eb3e/execroot/rules_haskell/bazel-out/k8-fastbuild/bin/_solib_k8/_U@zlib.dev_S_S_Czlib___Uexternal_Snixpkgs_Uzlib_Slib/libz.so)
Loading static libraries is not supported in this configuration.
Try using a dynamic library instead.
Error running GHCi.
Using the --show-commands flag shows that GHCi is passed the following flags:
This seems to be the source of the issue and seems to be caused by the following line in hrepl:
|
sharedLibName = drop 3 . takeBaseName |
That logic to obtain the library name from a file name fails on versioned libraries like
libz.so.1.2.11, or on system libraries outside of Linux, e.g.
libz.dylib.
The target //tests/binary-with-indirect-sysdeps:hs-lib depends on a libz that is provided by nixpkgs and comes in three shapes: libz.so libz.so.1 libz.so.1.2.11.
hrepl revision 33f879e
rules_haskell revision b41234677c9381982aae98098fb473a5b733c945
hreplfails to load targets that depend on certain types of dynamic libraries.This can be reproduced on the rules_haskell repository with the following command:
Using the
--show-commandsflag shows that GHCi is passed the following flags:This seems to be the source of the issue and seems to be caused by the following line in hrepl:
hrepl/hrepl/Repl.hs
Line 239 in 33f879e
That logic to obtain the library name from a file name fails on versioned libraries like
libz.so.1.2.11, or on system libraries outside of Linux, e.g.libz.dylib.The target
//tests/binary-with-indirect-sysdeps:hs-libdepends on alibzthat is provided by nixpkgs and comes in three shapes:libz.so libz.so.1 libz.so.1.2.11.hrepl revision 33f879e
rules_haskell revision b41234677c9381982aae98098fb473a5b733c945