curl-curl/.github/workflows
Viktor Szakats 38107d3354
configure: fix --with-ngtcp2=<path> option for crypto libs
ngtcp2 1.14.0 added module dependencies to `ngtcp2_crypto_*.pc` files.
This broke certain build cases in curl, because configure was is
querying pkg-config modules by setting `PKG_CONFIG_LIBDIR` to the
directory specified via `--with-*=` options, including `--with-ngtcp2=`.
Setting `PKG_CONFIG_LIBDIR` tells pkg-config (and pkgconf) to ignore
system locations. This caused that `ngtcp2_crypto_gnutls.pc` could no
longer find its indirect dependencies, if those were present at system
locations (where they typically are). Another fallout was BoringSSL,
because it does not provide `openssl.pc` on its own, and successful
detection relied on finding a non-BoringSSL copy, typically at a system
location (also fixed in ngtcp2 main branch).

Fix `ngtcp2_crypto_*` detections to not touch `PKG_CONFIG_LIBDIR` and
instead prepend `<path>` set via `--with-ngtcp2=` to `PKG_CONFIG_PATH`.
This ensures to pick up any dependent modules from system locations.

Note the side-effect is that potentially undesired modules may be
detected this way from system locations, i.e. it makes this particular
detection less "hermetic" than the rest used in curl configure.

(Configurations using a bare `--with-ngtcp2` with no path were not
affected, and served as a workaround before this patch. It remains a
valid way of configuration after.)

Both `pkgconf` and `pkg-config` use this logic to calculate their search
directory list:
```pseudo
search = {}
if PKG_CONFIG_PATH is set
  search += PKG_CONFIG_PATH
endif
if PKG_CONFIG_LIBDIR is set (even if empty)
  search += PKG_CONFIG_LIBDIR
else
  search += built-in-pkg-config-dirs
endif
```

Refs:
https://github.com/curl/curl/pull/18028/commits (earlier attempt. Failed due to using `PKG_CONFIG_DIR` instead of the correct `PKG_CONFIG_PATH`)
c0874ce824
https://man.archlinux.org/man/pkgconf.1.en
https://manpages.debian.org/unstable/pkgconf/pkgconf.1.en.html
https://manpages.debian.org/unstable/pkg-config/pkg-config.1.en.html
10e27fd63c

Bug: https://github.com/curl/curl/pull/18022#issuecomment-3120587041
Bug: https://github.com/ngtcp2/ngtcp2/pull/1689#issuecomment-3120593664
Follow-up to 04d90b5deb #20931
Follow-up to 3c64ffaff4 #18415 #18188
Follow-up to 99500660af #18028 #18022

Closes #20920
2026-03-17 14:37:53 +01:00
..
appveyor-status.yml GHA: switch 12 Linux jobs to arm64 2026-01-09 19:35:16 +01:00
checkdocs.yml badwords: dedupe invocation into a runnable script 2026-03-10 17:44:15 +01:00
checksrc.yml badwords: dedupe invocation into a runnable script 2026-03-10 17:44:15 +01:00
checkurls.yml GHA: bump GHA and pip dependencies 2026-02-01 16:40:37 +01:00
codeql.yml GHA: bump actions and pip dependencies 2026-03-01 19:06:39 +01:00
configure-vs-cmake.yml GHA: bump GHA and pip dependencies 2026-02-01 16:40:37 +01:00
curl-for-win.yml GHA: bump GHA and pip dependencies 2026-02-01 16:40:37 +01:00
distcheck.yml cmake: fix building with CMAKE_FIND_PACKAGE_PREFER_CONFIG=ON 2026-03-03 16:33:21 +01:00
fuzz.yml GHA: silence fresh zizmor 1.21.0 warnings 2026-01-16 13:48:28 +01:00
http3-linux.yml configure: fix --with-ngtcp2=<path> option for crypto libs 2026-03-17 14:37:53 +01:00
label.yml GHA: use ubuntu-slim image in 3 jobs 2026-01-25 18:54:12 +01:00
linux-old.yml GHA/linux-old: use tilde where possible and consistent 2026-02-05 13:12:10 +01:00
linux.yml cmake: add CURL_GCC_ANALYZER option, enable in CI, fix/silence 2026-03-16 11:49:34 +01:00
macos.yml cmake: add CURL_GCC_ANALYZER option, enable in CI, fix/silence 2026-03-16 11:49:34 +01:00
non-native.yml GHA: bump actions and pip dependencies 2026-03-01 19:06:39 +01:00
windows.yml cmake: add CURL_GCC_ANALYZER option, enable in CI, fix/silence 2026-03-16 11:49:34 +01:00