From 943ac04fc4d7d554d9064c7cd03fbe1830ff25d4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 11 Aug 2026 10:31:55 +0200 Subject: [PATCH] CI: dump `libcurl.pc` (and `curl-config`) to log, verify `.pc` with `pccritic` tool `pccritic` is available on the latest macOS runner revision (not every job runs get it yet), Cygwin, MSYS2/mingw-w64 (one job, others will follow on the next msys2/setup-msys2 Action bump). It will be automatically used on BSDs, once they start offering it. Missing from Linux jobs. Also: - GHA/windows: convert `libcurl.pc` to Unix newlines to bump score 96 to 100 in mingw-w64 jobs. CMake-specific fix pending in: #22556 - GHA: verify with minimum `pccritic` score 94 to 100 (depending on CI job). - build: fill `Maintainer:` `libcurl.pc` property when run curl CI. Issues remaining: macOS: ``` [info ] Cflags adds an include path already on the default search path (pkgconf strips it): -I/usr/local/include (cflags/PC031) [info ] Libs adds a library path already on the default search path (pkgconf strips it): -L/usr/local/lib (libs/PC040) [minor ] Libs.private contains an unexpected flag: /Applications/Xcode_26.6.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX26.5.sdk/System/Library/Frameworks/GSS.framework (libs/PC041) ``` Windows: ``` [minor ] file uses CRLF line endings (style/PC061) ``` Ref: #22556 Follow-up to b9254da6175360102176303ecf9dbb5519b0ffcf #22548 Follow-up to 852f5d34da772de65d057897278aa1e75dd060d1 #22553 Follow-up to 4d9ba9fef48e43903815e0c0e96f917eaf9f185c #22545 Follow-up to 6c7993d4d9f8722a869207f86a31f20fa9e8780d #22536 Follow-up to 3f1c033afe008123680306663cc01279e831ac2d #22519 Closes #22543 --- .github/workflows/configure-vs-cmake.yml | 10 ++++--- .github/workflows/http3-linux.yml | 6 +++++ .github/workflows/linux.yml | 6 +++++ .github/workflows/macos.yml | 30 +++++++++++++++++++++ .github/workflows/non-native.yml | 34 +++++++++++++++++++----- .github/workflows/windows.yml | 16 +++++++++-- CMakeLists.txt | 4 +++ appveyor.sh | 1 + configure.ac | 5 ++++ libcurl.pc.in | 1 + 10 files changed, 102 insertions(+), 11 deletions(-) diff --git a/.github/workflows/configure-vs-cmake.yml b/.github/workflows/configure-vs-cmake.yml index 9f296c1c9f..3c569301fb 100644 --- a/.github/workflows/configure-vs-cmake.yml +++ b/.github/workflows/configure-vs-cmake.yml @@ -37,6 +37,7 @@ concurrency: permissions: {} env: + CURL_CI: github DO_NOT_TRACK: '1' HOMEBREW_NO_INSTALL_CLEANUP: '1' @@ -65,7 +66,7 @@ jobs: - name: 'cmake log' run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true - - name: 'dump generated files' + - name: 'generated libcurl.pc files' run: | for f in libcurl.pc curl-config; do echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::' @@ -127,12 +128,15 @@ jobs: - name: 'cmake log' run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true - - name: 'dump generated files' + - name: 'generated libcurl.pc files' run: | for f in libcurl.pc curl-config; do echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::' echo "::group::CM ${f}"; grep -v '^#' bld-cm/"${f}" || true; echo '::endgroup::' done + pccritic --version + pccritic --min-score 98 bld-am/libcurl.pc + pccritic --min-score 98 bld-cm/libcurl.pc - name: 'compare generated curl_config.h files' run: ./.github/scripts/cmp-config.pl bld-am/lib/curl_config.h bld-cm/lib/curl_config.h @@ -181,7 +185,7 @@ jobs: - name: 'cmake log' run: cat bld-cm/CMakeFiles/CMakeConfigureLog.yaml 2>/dev/null || true - - name: 'dump generated files' + - name: 'generated libcurl.pc files' run: | for f in libcurl.pc curl-config; do echo "::group::AM ${f}"; grep -v '^#' bld-am/"${f}" || true; echo '::endgroup::' diff --git a/.github/workflows/http3-linux.yml b/.github/workflows/http3-linux.yml index f08013950b..0f16d1c006 100644 --- a/.github/workflows/http3-linux.yml +++ b/.github/workflows/http3-linux.yml @@ -815,6 +815,12 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + - name: 'test configs' run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 20b0ab78a2..8a05b7105e 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -886,6 +886,12 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + - name: 'test configs' run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index bd7ca4a266..838590a331 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -181,6 +181,16 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + if command -v pccritic >/dev/null 2>&1; then + pccritic --version + pccritic --min-score 98 bld/libcurl.pc + fi + - name: 'build' run: | if [ "${MATRIX_BUILD}" = 'cmake' ]; then @@ -511,6 +521,16 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + if command -v pccritic >/dev/null 2>&1; then + pccritic --version + pccritic --min-score 96 bld/libcurl.pc + fi + - name: 'test configs' run: grep -H -v '^#' bld/tests/config bld/tests/http/config.ini || true @@ -774,6 +794,16 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + if command -v pccritic >/dev/null 2>&1; then + pccritic --version + pccritic --min-score 94 bld/libcurl.pc + fi + - name: 'build / ${{ matrix.build }}' run: | if [ "${MATRIX_BUILD}" = 'cmake' ]; then diff --git a/.github/workflows/non-native.yml b/.github/workflows/non-native.yml index 1ab4a88044..29663c726e 100644 --- a/.github/workflows/non-native.yml +++ b/.github/workflows/non-native.yml @@ -183,6 +183,16 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + if command -v pccritic >/dev/null 2>&1; then + pccritic --version + pccritic --min-score 98 bld/libcurl.pc + fi + - name: 'build' run: | if [ "${MATRIX_BUILD}" = 'cmake' ]; then @@ -315,6 +325,12 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + - name: 'build' run: | if [ "${MATRIX_BUILD}" = 'cmake' ]; then @@ -407,17 +423,17 @@ jobs: if: ${{ !cancelled() }} run: cat bld/config.log bld/CMakeFiles/CMake*.yaml 2>/dev/null || true - - name: 'dump config files' - run: | - for f in libcurl.pc curl-config; do - echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' - done - - name: 'curl_config.h' run: | echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + - name: 'build' run: | if [ "${MATRIX_BUILD}" = 'cmake' ]; then @@ -533,6 +549,12 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + - name: 'build' run: | if [ "${MATRIX_BUILD}" = 'cmake' ]; then diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 660479cdef..c3ed0c42da 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -105,7 +105,7 @@ jobs: # https://cygwin.com/cgi-bin2/package-grep.cgi packages: >- ${{ matrix.build == 'autotools' && 'autoconf automake libtool make' || 'cmake ninja' }} - gcc-core binutils perl + gcc-core binutils perl pkgconf openssh libpsl-devel zlib-devel @@ -161,6 +161,8 @@ jobs: for f in libcurl.pc curl-config; do echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' done + pccritic --version + pccritic --min-score 100 bld/libcurl.pc - name: 'build' timeout-minutes: 10 @@ -423,13 +425,17 @@ jobs: run: | echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true - cat bld/cmake_install.cmake || true - name: 'libcurl.pc, curl-config, cmake_install.cmake' run: | for f in libcurl.pc curl-config cmake_install.cmake; do echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' done + if command -v pccritic >/dev/null 2>&1; then + sed -i.bak 's/\x0d//g' bld/libcurl.pc # to suppress pccritic warning: style/PC061 + pccritic --version + pccritic --min-score 100 bld/libcurl.pc + fi - name: 'build' timeout-minutes: 10 @@ -1128,6 +1134,12 @@ jobs: echo '::group::raw'; cat bld/lib/curl_config.h || true; echo '::endgroup::' grep -F '#define' bld/lib/curl_config.h | sort || true + - name: 'libcurl.pc, curl-config' + run: | + for f in libcurl.pc curl-config; do + echo "::group::${f}"; grep -v '^#' bld/"${f}" || true; echo '::endgroup::' + done + - name: 'build' timeout-minutes: 5 run: cmake --build bld --config "${MATRIX_TYPE}" --parallel 5 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5805391bc3..6ca969539a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2341,6 +2341,7 @@ if(NOT CURL_DISABLE_INSTALL) # Generate a pkg-config file matching this config. # Consumed variables: + # CURL_PACKAGE_MAINTAINER # CURLVERSION # exec_prefix # includedir @@ -2360,6 +2361,9 @@ if(NOT CURL_DISABLE_INSTALL) # https://manpages.debian.org/unstable/pkgconf/pkg-config.1.en.html # https://manpages.debian.org/unstable/pkg-config/pkg-config.1.en.html # https://www.msys2.org/docs/pkgconfig/ + if(NOT "$ENV{CURL_CI}" STREQUAL "") + set(CURL_PACKAGE_MAINTAINER "https://curl.se/") + endif() configure_file( "${PROJECT_SOURCE_DIR}/libcurl.pc.in" "${PROJECT_BINARY_DIR}/libcurl.pc" @ONLY) diff --git a/appveyor.sh b/appveyor.sh index 0a40dd2812..64e8b6d131 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -89,6 +89,7 @@ if [ -n "${CMAKE_GENERATOR:-}" ]; then false fi echo 'curl_config.h'; grep -F '#define' _bld/lib/curl_config.h | sort || true + echo 'libcurl.pc'; grep -v '^#' '_bld/libcurl.pc' || true time cmake --build _bld --config "${PRJ_CFG}" --parallel 2 [[ "${CMAKE_GENERATE:-}" != *'-DBUILD_SHARED_LIBS=OFF'* ]] && PATH="$(pwd)/_bld/lib/${PRJ_CFG}:$PATH" [[ "${CMAKE_GENERATE:-}" = *'-DCURL_USE_OPENSSL=ON'* ]] && { PATH="${openssl_root}:$PATH"; cp "${openssl_root}"/*.dll "_bld/src/${PRJ_CFG}"; } diff --git a/configure.ac b/configure.ac index b0394ddecb..0c085a85e8 100644 --- a/configure.ac +++ b/configure.ac @@ -5217,6 +5217,11 @@ fi AC_SUBST(LIBCURL_PC_REQUIRES) AC_SUBST(LIBCURL_PC_LIBS) +if test -n "$CURL_CI"; then + CURL_PACKAGE_MAINTAINER=https://curl.se/ + AC_SUBST(CURL_PACKAGE_MAINTAINER) +fi + rm "$compilersh" dnl diff --git a/libcurl.pc.in b/libcurl.pc.in index e13b647828..66296f5e57 100644 --- a/libcurl.pc.in +++ b/libcurl.pc.in @@ -33,6 +33,7 @@ Name: libcurl URL: https://curl.se/ Description: Library to transfer files with HTTP, FTP, etc. License: curl +Maintainer: @CURL_PACKAGE_MAINTAINER@ Version: @CURLVERSION@ Source: https://curl.se/download/curl-@CURLVERSION@.tar.gz Requires: @LIBCURL_PC_REQUIRES@