mirror of
https://github.com/curl/curl.git
synced 2026-05-01 15:17:51 +03:00
To aid debugging cases when dependency detection acts unexpectedly. Sprung from spending days trying to figure out behavior of ngtcp2 crypto modules and their dependencies. You can enable by setting env `CURL_TRACE_PKG_CONFIG` to a non-empty value. When enabled, details are logged for both successful and unsuccessful detections. Logging of unsuccessful ones is automatically enabled when `CURL_CI` env is set, which is the case for all CI jobs. It works by asking for `--debug` output and grepping for lines that seem useful for this purpose. Output is different for classic pkg-config and pkgconf, and may depending on tool version. Also append `--print-errors` output if any. Examples (with pkgconf): Fail, before: ``` checking for libngtcp2_crypto_boringssl options with pkg-config... no configure: error: --with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file. ``` Fail, after: ``` checking for libngtcp2_crypto_boringssl options with pkg-config... no configure: pkg-config --exists libngtcp2_crypto_boringssl trace: ---- begin trying path: /home/runner/nghttp3/build/lib/pkgconfig for libngtcp2_crypto_boringssl trying path: /home/runner/ngtcp2-boringssl/build/lib/pkgconfig for libngtcp2_crypto_boringssl trying path: /home/runner/nghttp3/build/lib/pkgconfig for libngtcp2 trying path: /home/runner/ngtcp2-boringssl/build/lib/pkgconfig for libngtcp2 trying path: /home/runner/nghttp3/build/lib/pkgconfig for openssl trying path: /home/runner/ngtcp2-boringssl/build/lib/pkgconfig for openssl trying path: /home/runner/nghttp2/build/lib/pkgconfig for openssl ==== error: Package openssl was not found in the pkg-config search path. Perhaps you should add the directory containing `openssl.pc' to the PKG_CONFIG_PATH environment variable Package 'openssl', required by 'libngtcp2_crypto_boringssl', not found ---- end configure: error: --with-ngtcp2 was specified but could not find ngtcp2_crypto_boringssl pkg-config file. ``` Success, after: ``` checking for libngtcp2_crypto_boringssl options with pkg-config... found configure: pkg-config --exists libngtcp2_crypto_boringssl trace: ---- begin trying path: /home/runner/awslc/build/lib/pkgconfig for libngtcp2_crypto_boringssl trying path: /home/runner/nghttp3/build/lib/pkgconfig for libngtcp2_crypto_boringssl trying path: /home/runner/nghttp2/build/lib/pkgconfig for libngtcp2_crypto_boringssl trying path: /home/runner/ngtcp2/build/lib/pkgconfig for libngtcp2_crypto_boringssl trying path: /home/runner/awslc/build/lib/pkgconfig for libngtcp2 trying path: /home/runner/nghttp3/build/lib/pkgconfig for libngtcp2 trying path: /home/runner/nghttp2/build/lib/pkgconfig for libngtcp2 trying path: /home/runner/ngtcp2/build/lib/pkgconfig for libngtcp2 trying path: /home/runner/awslc/build/lib/pkgconfig for openssl trying path: /home/runner/awslc/build/lib/pkgconfig for libssl trying path: /home/runner/awslc/build/lib/pkgconfig for libcrypto ---- end ``` More examples: https://github.com/curl/curl/pull/20926#issuecomment-4064259935 If there is an externally enablable, built-in feature like this in classic pkg-config or pkgconf, I could not find it. Also: - GHA/http3-linux: set `CURL_TRACE_PKG_CONFIG` to log detection details. H3 builds are prone to hard-to-debug dependency issues. Ref: #20920 Follow-up to |
||
|---|---|---|
| .. | ||
| ISSUE_TEMPLATE | ||
| scripts | ||
| workflows | ||
| CODEOWNERS | ||
| CONTRIBUTING.md | ||
| dependabot.yml | ||
| FUNDING.yml | ||
| labeler.yml | ||
| lock.yml | ||
| stale.yml | ||