Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use the system `libffi` (`ie` nixpkgs's) instead of built-in libffi from ghc source tree. This will prevent library conflict when ghc dynamically links haskell packages (linked with ghc built-in libffi) and any external library which uses nixpkgs `libffi`. Closes #55208.
- Loading branch information
Showing
1 changed file
with
5 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
a7c7743
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sets the wrong --with-ffi-include path. This is quite a problem for developing GHC with a Nix provided boot compiler (https://ghc.haskell.org/trac/ghc/ticket/16368).
I'm not sure what the Nix-way of accessing the proper path is. Here is the derivation for libffi, so
${libffi.out}
for lib and${libffi.dev}
maybe?a7c7743
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#56573
a7c7743
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The most idiomatic way is
stdenv.lib.getLib libffi
for libraries andstdenv.lib.getDev libffi
for development headers. The solution you've used in your PR now is fine, too, though. Accessingout
explicitly is typically unnecessary becausefoo == foo.out
by convention.a7c7743
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
a7c7743
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for finding that!
a7c7743
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Two things on this: