Fix repl rule with indirect cc_library deps #576
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The repl rule adds "-l" from external_libraries, but that can contain static libraries, which
won't have the mangled .so/.dylib linked in, and ghci will then fail to find this library. This changes
repl.bzl to only add "-l"s for shared libraries (which come in via haskell_cc_import).
Interestingly this bug can be only triggered if we have a haskell_library depending on a cc_library
that in turn depends on another cc_library. With that we get the following error:
<command line>: user specified .o/.so/.DLL could not be loaded (libtests_Slibrary-with-cbits_Sourclibrary-indirect_libourclibrary.so: cannot open shared object file: No such file or directory) Whilst trying to load: (dynamic) tests_Slibrary-with-cbits_Sourclibrary-indirect_libourclibrary