-
Notifications
You must be signed in to change notification settings - Fork 697
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
Make it possible to directly link a haskell library with an external static C library(.a). #4042
Comments
This end goal seems reasonable, but we need some clear UI design and also what is "this actually going to do" upwork before someone can tackle this bug. |
Currently, only executables are linked with Also, GHCi fails to load
http://codinginfinity.me/post/2015-04-18/haskell_and_cpp for details The goal is to emulate what node-gyp does. node-gyp builds C libraries locally and binds them to binding libraries so that C libraries don't have to be installed globally. This is clean. Cabal currently doesn't have a clean support for embedding C libraries into haskell bindings.
|
I've just hit this using https://github.com/serokell/rocksdb-haskell/. If it's linked dynamically, for some reason the .so is linked as relative. |
I also hit this issue yesterday, also with hlibsass. |
I've extracted the dynamically linked C dep problems to #4183, this issue can be about the statically linked part. |
If I understand the goal correctly, we could accomplish this by introducing a build info field |
I think the ideal we want is that packages providing bindings can link statically or dynamically with the foreign library. I rather have something like "extra-static-libraries" be a property of the build rather than the (binding) library. |
For the case that @crocket described, the package provides a static library to use with the bindings. That's not something the user can select at build time; the package has to be created with that in mind. What you are describing is the user selecting whether to statically or dynamically link system libraries, and I agree that is something that should be determined at build-time. |
Any progress on this issue? |
Just checking in to say that I've run into this as well -- ended up just generating a (Rust) |
Since it's not possible, https://github.com/jakubfijalkowski/hlibsass#static-shared-or-external-version-of-libsass says
This issue is also related to jakubfijalkowski/hlibsass#4
If a haskell binding to a C/C++ library is directly linked with a static library, we can avoid this issue.
The text was updated successfully, but these errors were encountered: