Repository navigation
Conversation
libcurl.pc unless found via pkg-configlibcurl.pc unless found via pkg-config
|
@haampie, @Thom1b, @diizzyy, @citrus-it: Can you give this a test and report if it improves your build case? |
|
Hi, I just applied these both patches to curl-8.11.0.tar.xz tarball: Then I built and installed curl (using ./configure, not cmake). I understand the patch avoid adding ldap in Requires.private but it's still there: So php still can't build with openldap2.4 which has no .pc file. |
Thanks for testing! It's odd because this patch unconditionally disables adding Did you run |
I forgot of course. ;) |
|
I tested this PR on OmniOS and it works - the Thanks @vszakats ! |
|
@vszakats |
e6ad1ba to
ce4ea70
Compare
Make the Find modules set and return their respective `pkg-config` module name(s) to the CMake build process, which then adds those to the `Requires:` list. Before this patch, `pkg-config` module names were maintainted in two separate places. After this patch, they are maintained in the Find modules for dependencies that have one (most do). Re-align existing modules with this change: msh3, mbedtls, rustls. These modules return their `pkg-config` module name only when detected via `pkg-config`. Follow-up to d511ec8 #15573 Closes #15800
The idea of linking dependencies found to `libcurl.pc` turns out not to work in practice in some cases. Specifically: gss, ldap, mbedtls, libmsh3, rustls A `.pc` may not work or be missing for a couple of reasons: - not all build methods generate it: mbedTLS, Rustls - generated file is broken: msh3 Ref: nibanks/msh3#225 - installed package flavour isn't shipping with one: FreeBSD GSS, OmniOS LDAP, macOS LDAP The effect of such issues shall be subtle in theory, because `libcurl.pc` normally lists these dependencies in the `Requires.private` section meant for static linking. But, e.g. `pkg-config --exists` requires these to be present, and builds sometimes use this check regardless of build type. This bug is not present in `pkgconf`; it only checks for them when `--static` is also passed. Fix these by adding affected `.pc` references to `libcurl.pc` only when we detected the dependency via `pkg-config`. There are a few side-effects of this solution: - references are never added for dependencies where curl doesn't implement `pkg-config` detection. These are: - autotools: ldap, mbedtls, msh3 - cmake: ldap (pending curl#15273) - generated `libcurl.pc` depends on the build-time environment. - generated `libcurl.pc` depends on curl build tool (cmake, autotools). - generated `libcurl.pc` depends on curl build implementation details. Make an exception for GNU GSS, where I blindly guess that `gss.pc` is always available, as no issues were reported. Other, not mentioned, dependencies continue to be added regardless of the detection method. Reported-by: Harmen Stoppels, Thomas, Daniel Engberg, Andy Fiddaman Fixes curl#15469 Fixes curl#15507 Fixes curl#15535 Fixes curl#15163 (comment) Closes curl#15573
Make the Find modules set and return their respective `pkg-config` module name(s) to the CMake build process, which then adds those to the `Requires:` list. Before this patch, `pkg-config` module names were maintainted in two separate places. After this patch, they are maintained in the Find modules for dependencies that have one (most do). Re-align existing modules with this change: msh3, mbedtls, rustls. These modules return their `pkg-config` module name only when detected via `pkg-config`. Follow-up to d511ec8 curl#15573 Closes curl#15800
The idea of linking dependencies found to
libcurl.pcturns out notto work in practice in some cases.
Specifically: gss, ldap, mbedtls, libmsh3, rustls
A
.pcmay not work or be missing for a couple of reasons:Ref: fix generated
libmsh3.pcfile nibanks/msh3#225FreeBSD GSS, OmniOS LDAP, macOS LDAP
The effect of such issues shall be subtle in theory, because
libcurl.pcnormally lists these dependencies in theRequires.privatesection meant for static linking. But, e.g.
pkg-config --existsrequires these to be present, and builds sometimes use this check
regardless of build type. This bug is not present in
pkgconf; it onlychecks for them when
--staticis also passed.Fix these by adding affected
.pcreferences tolibcurl.pconly whenwe detected the dependency via
pkg-config.There are a few side-effects of this solution:
implement
pkg-configdetection. These are:libcurl.pcdepends on the build-time environment.libcurl.pcdepends on curl build tool (cmake, autotools).libcurl.pcdepends on curl build implementation details.Make an exception for GNU GSS, where I blindly guess that
gss.pcisalways available, as no issues were reported.
Other, not mentioned, dependencies continue to be added regardless
of the detection method.
Reported-by: Harmen Stoppels, Thomas, Daniel Engberg, Andy Fiddaman
Fixes #15469
Fixes #15507
Fixes #15535
Fixes #15163 (comment)
pkg-configdetection for remaining Find modules #15408