-
Notifications
You must be signed in to change notification settings - Fork 841
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
Cabal 2's 'foreign-library' doesn't work with HEAD #3364
Comments
Head version of stack only recently started using Cabal 2.0, there isn't yet support for these new features. |
Can you provide any information on how Cabal's command line interface (the |
The functionality is exposed by a new stanza in the .cabal file. See http://cabal.readthedocs.io/en/latest/developing-packages.html#foreign-libraries. No custom Example stanza:
Not sure to what extent this addresses your question. I don't have experience customizing |
What I'm trying to understand is what changes Stack needs to make in order to make this functionality work. In order to build a package, Stack uses the |
One way to figure it out is to run |
It looks like this is almost identical to the internal library issue: there's a new list of extra libraries that are simply not being accounted for by the current logic. It's going to require, in all places where we deal with library and executable components, piping through these extra library components too. |
This should resolve both #3364 and #3361. There is a test case included that should address both of them as well. This is still relatively hacky. We will eventually be overhauling the component system more dramatically to support Backpack with #2540 (CC @ezyang). This may still have some problems due to the upstream issue haskell/cabal#4763, but at least in theory we're matching the behavior of upstream. We can consider workarounds after that issue comes to a conclusion.
This should be resolved by #3430. It would be great if you could test that branch before this gets merged to master. |
Both the simple repo referenced in the description as well as my more complicated project build successfully on both OS X and Windows, generating a |
Awesome, thanks for the quick response! I'm going to merge that PR and close out this issue. Thanks again for the report. |
General summary/comments (optional)
Stack HEAD (aa5003a) does not produce a "foreign library" as specified by the
foreign-library
stanza in the .cabal file. This stanza is a new feature of Cabal-2.0.0.*.I have tested this only on Windows.Steps to reproduce
stack build
this example repository: https://github.com/bjornbm/cabal-flib-invalid-cache-repro.gitThis has been tested only on i386-windows.
Expected
I expected a DLL named myflib.dll to be produced.
For comparison this the result of building with cabal-install 2.0.0.0:
Actual
Stack complained:
No
.stack-work\dist\9cd999cb\build\myflib
directory was created, and of course nomyflib.dll
was created in that directory.The log of
stack build --verbose --cabal-verbose
can be found in this Gist.Stack version
Built from commit aa5003a.
Method of installation
Built from clean checkout of HEAD from github.
The text was updated successfully, but these errors were encountered: