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.
GHC expects shared libraries to be
.dylib
on MacOS, but Bazel cc_library rules always emit.so
:rules_haskell
usescc_wrapper
to work around this. We can probably do something similar for hrepl.