Skip to content
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

Add a private dependency on zck to librepo.pc if zchunk support is enabled #307

Merged
merged 1 commit into from
Apr 15, 2024

Conversation

ppisar
Copy link
Contributor

@ppisar ppisar commented Apr 5, 2024

Add a private dependency on zck to librepo.pc if zchunk support is enabled

If librepo is built with zchunk support, zchunk's zck.h header file is
included from librepo public header files, thus applications building
against librepo needs zchunk header files available at build time.
Those who only use pkg-config for tracking dependencies, reported
build failures:

    /usr/include/librepo/downloadtarget.h:27:10: fatal error: zck.h: No such file or directory

This patch adds the dependency on zck to librepo.pc.

It enhances Requires.private instead of Requires to prevent from
contaminating "pkgconf --libs librepo" with -lzck. Contrary, "pkgconf
--cflags librepo" correctly appends include path to zck header files.
The dependency on zck.pc is only checked and enforced with "pkgconf
--cflags librepo" invocation. This behaviour is a feature. See
pkgconf/pkgconf#352 and
pkgconf/pkgconf#300.

Fixes: #305

@kloczek
Copy link

kloczek commented Apr 5, 2024

LGTM 👍

@ppisar ppisar changed the title RFC: Add a dependency on zck to librepo.pc if zchunk support is enabled RFC: Add a private dependency on zck to librepo.pc if zchunk support is enabled Apr 8, 2024
@ppisar
Copy link
Contributor Author

ppisar commented Apr 8, 2024

I found a proper fix. pkgconf supports this kind of header-only dependency by adding it to Requires.private.

@ppisar ppisar changed the title RFC: Add a private dependency on zck to librepo.pc if zchunk support is enabled Add a private dependency on zck to librepo.pc if zchunk support is enabled Apr 8, 2024
@kontura kontura self-assigned this Apr 11, 2024
…abled

If librepo is built with zchunk support, zchunk's zck.h header file is
included from librepo public header files, thus applications building
against librepo needs zchunk header files available at build time.
Those who only use pkg-config for tracking dependencies, reported
build failures:

    /usr/include/librepo/downloadtarget.h:27:10: fatal error: zck.h: No such file or directory

This patch adds the dependency on zck to librepo.pc.

It enhances Requires.private instead of Requires to prevent from
contaminating "pkgconf --libs librepo" with -lzck. Contrary, "pkgconf
--cflags librepo" correctly appends include path to zck header files.
The dependency on zck.pc is only checked and enforced with "pkgconf
--cflags librepo" invocation. This behaviour is a feature. See
<pkgconf/pkgconf#352> and
<pkgconf/pkgconf#300>.

Fixes: rpm-software-management#305
@kontura kontura merged commit b411895 into rpm-software-management:master Apr 15, 2024
5 of 6 checks passed
@kloczek
Copy link

kloczek commented Apr 15, 2024

That PR of course is wrong because 'zck` dependency is not used only on static linking.
(Look on explanation #305)

@ppisar
Copy link
Contributor Author

ppisar commented Apr 15, 2024

That PR is good because "pkfconf --cflags" reports an error if zck is not installed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

If zchunk is supported, librepo pkgconfig is missing a dependency on zchunk
3 participants