-
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 pkgconfig-depends usable #7448
Comments
There are related issues:
If these are implemented, then both first and second @bgamari suggestions will be possible. |
I think I can have a go at option 1. Would appreciate someone pointing me to the simplest possible package that uses pkgconfig-depends they can think of so I can use it as a test case :-) (And ideally this would have a cabal file example of how to build it in the no pkg-config case too!) |
About any, e.g. https://hackage.haskell.org/package/zlib-0.6.2.3/zlib.cabal has manual flag to select
(I forgot to install https://hackage.haskell.org/package/HsOpenSSL is more complicated, where you start to wish
|
Describe the bug
Cabal has for a long time supported discovering native library dependencies through
pkgconfig-depends
. This is extremely useful as:cabal-install
(e.g. see nix-pkgconfig)However, due to the fact that
pkg-config
is not available by default on some platforms, libraries tend to either not usepkgconfig-depends
(e.g. seeregex-posix
) or guard it behind a default-off flag (e.g. seezlib
). This severely cripples the usefulness of the mechanism.Even worse, the tendency for packages to assume library non-availability on Windows can blow up catastrophically in some cases. This was the case in GHC #19945 where an ABI mismatch triggered by the assumption that Windows environments do not offer a POSIX regex implementation caused an innocuous-looking program to segfault, requiring many hours of debugging.
Proposed design
Users avoid using
pkgconfig-depends
by default because it can cause builds to fail whenpkg-config
is not available. I suggest one of the following (roughly in order of decreasing desirability):cabal-install
learn to backtrack if apkg-config
probe fails due to the executable not being availablecabal-install
implement support for setting/clearing thepkgconfig
flag on its own depending upon whether thepkg-config
executable is available, sanctioning the current flag-based conventioncabal-install
assume that thepkgconfig-depends
are available in the event thatpkg-config
is not availableThe text was updated successfully, but these errors were encountered: