Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix repl rule with indirect cc_library deps #576

Merged
merged 2 commits into from Jan 21, 2019
Merged

Fix repl rule with indirect cc_library deps #576

merged 2 commits into from Jan 21, 2019

Conversation

ghost
Copy link

@ghost ghost commented Jan 16, 2019

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

@Profpatsch Profpatsch added this to the REPL improvements milestone Jan 18, 2019
)

haskell_binary(
name = "binary-indirect-cbits-partially-static",
srcs = ["Main.hs"],
linkstatic = False,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we actually set linkstatic to True here, doesn’t that change the meaning of the test?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIK True is the default value.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, this shouldn't be removed. I'll add it back and rebase the PR.

Jussi Maki added 2 commits January 21, 2019 17:20
The repl target added "-l" for each external_libraries dependency,
but that included also static library dependencies on which ghci choked.
@mboes mboes merged commit 8221d03 into tweag:master Jan 21, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants