From b9254da6175360102176303ecf9dbb5519b0ffcf Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 11 Aug 2026 16:32:07 +0200 Subject: [PATCH] build: clear `Require.private` for static-only builds in `libcurl.pc` Before this patch static-only libcurl builds stored the list of module dependencies in both `Require` and `Require.private`. The new `pccritic` tool flagged this as an issue. Having (or not) a duplicate in `Require.private` does not change the output created by `pkgconf` and `pkg-config`, as tested with both with and without `--static` option. Thus, fix by deleting the private copy. Fixing: ``` $ pccritic libcurl.pc bld/libcurl.pc score: 63/100 grade: D (0 critical, 0 major, 9 minor, 1 info) [minor ] 'libssh2' appears in both Requires and Requires.private (requires/PC051) [minor ] 'libidn2' appears in both Requires and Requires.private (requires/PC051) [minor ] 'openssl' appears in both Requires and Requires.private (requires/PC051) [...] ``` Ref: https://github.com/curl/curl/actions/runs/31495008715/job/93790403026#step:10:210 (macOS, CM clang OpenSSL torture) Ref: https://github.com/curl/curl/actions/runs/31495008825/job/93790433646#step:9:216 (mingw, AM ucrt-x86_64 wolfssl c-ares U) Follow-up to f057de5a1a950a90d1920021db152a4b695f1a8a #13911 Follow-up to 98e5904165859679cd78825bcccb52306ee3bb66 #5373 Cherry-picked from #22543 Closes #22548 --- CMakeLists.txt | 1 + configure.ac | 1 + 2 files changed, 2 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index d2e2951823..f85f44fe83 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2301,6 +2301,7 @@ if(NOT CURL_DISABLE_INSTALL) set(LIBCURL_PC_REQUIRES "${LIBCURL_PC_REQUIRES_PRIVATE}") set(LIBCURL_PC_LIBS "${LIBCURL_PC_LIBS_PRIVATE}") set(LIBCURL_PC_CFLAGS "${LIBCURL_PC_CFLAGS_PRIVATE}") + set(LIBCURL_PC_REQUIRES_PRIVATE "") endif() if(BUILD_STATIC_LIBS) set(ENABLE_STATIC "yes") diff --git a/configure.ac b/configure.ac index 8e991dda54..96c515a313 100644 --- a/configure.ac +++ b/configure.ac @@ -5209,6 +5209,7 @@ dnl Merge pkg-config private fields into public ones when static-only if test "$enable_shared" = "no"; then LIBCURL_PC_REQUIRES=$LIBCURL_PC_REQUIRES_PRIVATE LIBCURL_PC_LIBS=$LIBCURL_PC_LIBS_PRIVATE + LIBCURL_PC_REQUIRES_PRIVATE= else LIBCURL_PC_REQUIRES= LIBCURL_PC_LIBS=