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

cc_haskell_import should work with haskell_binary #179

Closed
mboes opened this issue Mar 12, 2018 · 1 comment
Closed

cc_haskell_import should work with haskell_binary #179

mboes opened this issue Mar 12, 2018 · 1 comment
Labels
P2 major: an upcoming release type: feature request

Comments

@mboes
Copy link
Member

mboes commented Mar 12, 2018

Given a haskell_library, it's currently possible to export it for consumption by the CC rules using cc_haskell_import. But a haskell_binary sometimes looks pretty similar to a haskell_library. It might not have a ghc-pkg database entry associated to it, but if it's compiled with -dynamic -pie, then it looks and smells so much like any odd shared library that the file command would be fooled. We use this property in sparkle, where we routinely compile PIE binaries and then dlopen() them like any other shared object.

This problem perhaps points to a deeper one: HaskellPackageInfo is likely too monolithic. It could make sense to split it out into multiple providers focused on specific aspects of the produced artifact, much like the Go rules do (GoLibrary, GoArchive, GoArchiveData etc). See https://github.com/bazelbuild/rules_go/blob/master/go/providers.rst.

@mboes
Copy link
Member Author

mboes commented Mar 25, 2018

The original problem was fixed pretty much entirely, as a side effect of #186. There does remain another problem, which is that cc_haskell_import should ensure the result is always named as a library. Otherwise cc_* rules won't accept the output in the srcs attribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 major: an upcoming release type: feature request
Projects
None yet
Development

No branches or pull requests

1 participant