I ran into this same issue today, and would like to confirm the bug:
1) The workaround suggested by Andrej is not functional, because
x86_64-linux-gnu-pkgconf (or pkg-config) is really just a symlink to whatever
pkgconf binaries are installed on the system.
2) The binary architecture of the pkgconf application itself has no relation
whatsoever to the binary architecture of libraries available on the system, and
therefore the search path for packet configuration files (.pc) should never
make assumptions about the architecture of the library on a multiarch system
Expected behavior
-----------------
Regardless of whether pkgconf is installed in i386 or amd64 (or whatever
architecture, really), it should include in the default search paths for
libraries ALL architectures that are in use on the system.
(Or, if that leads to packet configuration file conflicts: Provide a command line option
--64 / --32 to select one set of search paths. Keep in mind that these are not include
paths themselves, just paths to search for .pc files - so I believe the "search in
all" solution should be conflict-free)
Actual behavior
---------------
When pkgconf-bin:i386 is installed:
$ pkgconf --variable pc_path pkgconf
/usr/local/lib/i386-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/i386-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
When pkgconf-bin:amd64 is installed:
$ pkgconf --variable pc_path pkgconf
/usr/local/lib/x86_64-linux-gnu/pkgconfig:/usr/local/lib/pkgconfig:/usr/local/share/pkgconfig:/usr/lib/x86_64-linux-gnu/pkgconfig:/usr/lib/pkgconfig:/usr/share/pkgconfig
Note: Switching between the two versions works on both debian testing (trixie)
and stable (bookworm) via
$ aptitude purge pkgconf-bin:i386
and
$ aptitude purge pkgconf-bin:amd64
, accepting the aptitude proposed solution that replaces *only* libpgkconf3 and
pkgconf-bin with the respective other architecture.
A fix would be very much appreciated!
/Lars
On Thu, 25 May 2023 09:59:31 +0200 Andrej Shadura <[email protected]> wrote:
On Fri, 6 Jan 2023 20:50:30 -0300 Allan <[email protected]> wrote:
> When I try to check for a package using pkg-config it is not
> able to find the package even that it is properly installed.
> Workaround
> $ env PKG_CONFIG_PATH="$PKG_CONFIG_PATH:/usr/lib/x86_64-linux-gnu/pkgconfig/"
pkg-config --modversion gthread-2.0
> 2.74.4
You didn’t use reportbug to file this bug report, so I cannot verify it
from the list of dependencies, but it seems that you have
pkgconf-bin:i386 installed on your system instead of pkgconf-bin:amd64.
This is what causes pkgconf or pkg-config to default to the i386 flags.
A better workaround would be to call pkg-config or pkgconf but
annotating the command with the architecture name, in your case
x86_64-linux-gnu-pkg-config or x86_64-linux-gnu-pkgconf.
--
Cheers,
Andrej