Describe the bug
When the .cabal package being built contains pkgconfig-depends, the cabal-install tool checks for every pkg-config package installed. If any of these packages are broken for some reason the build fails even if the Cabal package doesn't use it.
To Reproduce
Find out which directories are searched by pkg-config:
% pkg-config --variable pc_path pkg-config
/usr/local/libdata/pkgconfig:/usr/libdata/pkgconfig:/usr/local/share/pkgconfig
Create an invalid aaa.pc package description for pkg-config in one of those dirs:
Name: aaa
Version: 123
Description: asdasd
Requires: asdasd
Trying to get an information for this package will result in error:
% pkg-config --modversion aaa
Package asdasd was not found in the pkg-config search path.
Perhaps you should add the directory containing `asdasd.pc'
to the PKG_CONFIG_PATH environment variable
Package 'asdasd', required by 'aaa', not found
Now try to build any Cabal package with pkgconfig-depends:
cabal unpack gi-atk
cd gi-atk-2.0.24
cabal build --dry-run -v2
It fails claiming that gi-atk.pc wasn't found even if it is installed:
Error: cabal: Could not resolve dependencies:
[__0] next goal: gi-atk (user goal)
[__0] rejecting: gi-atk-2.0.24 (conflict: pkg-config package atk>=2.0 && <3,
not found in the pkg-config database)
Expected behavior
Package configuration should be successful since the package isn't using aaa.
System information
- FreeBSD 14-CURRENT
cabal 3.8.1.0
ghc 9.2.4
Additional context
#8446
Describe the bug
When the
.cabalpackage being built containspkgconfig-depends, thecabal-installtool checks for everypkg-configpackage installed. If any of these packages are broken for some reason the build fails even if the Cabal package doesn't use it.To Reproduce
Find out which directories are searched by
pkg-config:Create an invalid
aaa.pcpackage description forpkg-configin one of those dirs:Trying to get an information for this package will result in error:
Now try to build any Cabal package with
pkgconfig-depends:It fails claiming that
gi-atk.pcwasn't found even if it is installed:Expected behavior
Package configuration should be successful since the package isn't using
aaa.System information
cabal3.8.1.0ghc9.2.4Additional context
#8446