google / hrepl

Interactive development for Bazel/Haskell rules
Apache License 2.0
47 stars 10 forks source link

cc_library dependencies aren't loaded on MacOS #6

Open judah opened 4 years ago

judah commented 4 years ago

GHC expects shared libraries to be .dylib on MacOS, but Bazel cc_library rules always emit .so:

$ hrepl hrepl/tests:CLib1
...
GHCi, version 8.6.5: http://www.haskell.org/ghc/  :? for help
<command line>: user specified .o/.so/.DLL could not be loaded (dlopen(libhrepl_Stests_Slibclib1.dylib, 5): image not found)
Whilst trying to load:  (dynamic) hrepl_Stests_Slibclib1
Additional directories searched:   bazel-out/darwin-fastbuild/bin/_solib_darwin
Error running GHCi.

rules_haskell uses cc_wrapper to work around this. We can probably do something similar for hrepl.