-
Notifications
You must be signed in to change notification settings - Fork 81
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
Enable compiling cbits directly into Haskell targets #678
Comments
I think this is a GHC misfeature. I think rules should be as focused as possible, not bring along the kitchen sink. We already have a rule ( I don't understand the MACH-O header size limit argument. Whether the arguments are passed to GCC via GHC or to GCC directly shouldn't make a difference. In both cases you just end up with a collection of object files, which you then have to link with the rest. You can force this static linking of |
That's a good point. Indeed, handling those flags right would require additional work in rules_haskell, which would probably duplicate
The issue appears further down the line when something else depends on such a library. Assuming Hackage packages Fortunately, with the latest work on shortening the length of RPATH entries (#614) and reducing the amount of RPATH entries (#663, #686) we're well below the MACH-O header size limit even for large dependency graphs. So, the current |
Currently
haskell_library
and the other Haskell rules only take Haskell source files (.hs
,.lhs
,.hsc
, ...) as input to thesrcs
attribute. In particular, it is not allowed to pass.c
files to thesrcs
attribute, or alternatively a dedicatedcsrcs
attribute.This forces Hazel to generate separate
cc_library
targets for any cbits in Hackage packages, introducing additional C library dependencies. These quickly add up, and increase the risk of exceeding the MACH-O header size limit on MacOS on dynamic linking.GHC itself accepts
.c
files as sources, and it looks like Cabal passesc-sources
directly toghc
. Does anything speak against also accepting.c
files as sources in rules_haskell, either insrcs
, or a separatecsrcs
?The text was updated successfully, but these errors were encountered: