pkgconf looks for Requires.private even if shared linking is requested #248

Closed
opened 2022-09-01 13:46:45 +00:00 by tachi · 2 comments

Hi, I don't know if this is a bug or not, but when looking for a package with pkgconf --cflags pcname dependency resolution fails if one of the packages listed in Requries.private is not found, even if --static is not passed.

Example:

$ pkgconf --version        
1.8.0

$ cat /usr/lib/x86_64-linux-gnu/pkgconfig/zarchive.pc 
prefix=/usr
includedir=${prefix}/include
libdir=${prefix}/lib/x86_64-linux-gnu

Name: ZArchive
Description: Library for creating and reading zstd-compressed file archives
URL: https://github.com/Exzap/ZArchive
Version: 0.1.1
Requires.private: libzstd
Libs: -L${libdir} -lzarchive
Cflags: -I${includedir}

$ pkgconf --exists libzstd || echo not found
not found

$ pkgconf --cflags zarchive
Package libzstd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libzstd.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libzstd', required by 'zarchive', not found
Hi, I don't know if this is a bug or not, but when looking for a package with `pkgconf --cflags pcname` dependency resolution fails if one of the packages listed in `Requries.private` is not found, even if `--static` is not passed. Example: $ pkgconf --version 1.8.0 $ cat /usr/lib/x86_64-linux-gnu/pkgconfig/zarchive.pc prefix=/usr includedir=${prefix}/include libdir=${prefix}/lib/x86_64-linux-gnu Name: ZArchive Description: Library for creating and reading zstd-compressed file archives URL: https://github.com/Exzap/ZArchive Version: 0.1.1 Requires.private: libzstd Libs: -L${libdir} -lzarchive Cflags: -I${includedir} $ pkgconf --exists libzstd || echo not found not found $ pkgconf --cflags zarchive Package libzstd was not found in the pkg-config search path. Perhaps you should add the directory containing `libzstd.pc' to the PKG_CONFIG_PATH environment variable Package 'libzstd', required by 'zarchive', not found

This is a design defect in the Requires.private feature, it assumes that the headers for the private SDK will be referenced, and therefore an implementation must always assume --static when looking for CFLAGS.

This is a design defect in the `Requires.private` feature, it assumes that the headers for the private SDK will be referenced, and therefore an implementation must always assume `--static` when looking for CFLAGS.

Oh ok, thanks for the explanation.
Is this documented somewhere? If not, I may add it as part of #245

Oh ok, thanks for the explanation. Is this documented somewhere? If not, I may add it as part of #245
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: ariadne/pkgconf#248
There is no content yet.