Repository navigation
Conversation
Only refer to pkg-config files if they're found otherwise omit adding reference to Requires.private in curl's .pc file
|
@vszakats This is for example true if you're on FreeBSD and use "base" GSS-API (the version included in the distro itself) |
|
Thanks for your report and patch. Do I understand correctly that GSS is correctly detected, but you don't want this detection to trigger adding This case in CI: |
|
@vszakats Edit: |
Would it be a solution to skip adding this reference when the target OS is FreeBSD? Something like: --- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1246,7 +1246,9 @@ if(CURL_USE_GSSAPI)
elseif(GSS_FLAVOUR STREQUAL "MIT")
list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "mit-krb5-gssapi")
else() # Heimdal
- list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "heimdal-gssapi")
+ if(NOT CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
+ list(APPEND LIBCURL_PC_REQUIRES_PRIVATE "heimdal-gssapi")
+ endif()
endif()
else()
message(WARNING "GSSAPI has been requested, but no supporting libraries found. Skipping.")
--- a/configure.ac
+++ b/configure.ac
@@ -2071,7 +2071,13 @@ if test x"$want_gss" = xyes; then
if test -n "$gnu_gss"; then
LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE gss"
elif test "x$not_mit" = "x1"; then
- LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE heimdal-gssapi"
+ case $host_os in
+ freebsd*)
+ ;;
+ *)
+ LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE heimdal-gssapi"
+ ;;
+ esac
else
LIBCURL_PC_REQUIRES_PRIVATE="$LIBCURL_PC_REQUIRES_PRIVATE mit-krb5-gssapi"
fi |
|
That would break if you use the port which is a valid configuration, |
There a "base-gssapi" package on FreeBSD which is installed by default, and a port that is If so, perhaps we should make a new "base-gssapi" GSS flavour, adjust detections to detect and return this flavour, then skip adding it to the pc dependency list for this flavour? |
|
No, "base" refers to the bundled version included in the OS which is the one you see get detected in the CI logs. |
That is what I meant, so I don't understand the "no". Is there is isn't two distinct kind of GSS implementations on FreeBSD? One with |
|
You have 3 variants, |
We want to depend on the Except on FreeBSD where there seem to be multiple flavours of heimdal, one with a If that's the case we have not 3 but 4 "flavours". |
|
I really don't see where this would be an issue in practice where you'd have a "desynced" build root/host compaed to run host, if you insist make it a toggle instead of adding os/distro specific hacks? |
Thinking in generic terms, are you saying that a |
|
Yes, that's what I'm suggesting |
|
This might be a way to deal with, but it assumes that curl itself and its dependents are It also flies in the face of idea that a Such solution will also result in different In practice it also means that implementation details of curl's autotools and cmake CMake doesn't yet have Assuming we want to go with this solution, this is important to merge first, otherwise Such change will be a relatively large one because we'd need to keep track of the A lighter solution is to implement this solely for the problematic ones, which seem Of these, LDAP is also pending a detection overhaul in CMake: #15273, adding |
|
Patch proposal: #15573 |
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
Only refer to pkg-config files if they're found otherwise omit adding reference to Requires.private in curl's .pc file