mirror of
https://github.com/curl/curl.git
synced 2026-04-11 12:01:42 +08:00
GHA/codeql: add tweak to successfully build libtests for CodeQL
Turns out the cause of CodeQL hangs (or probably just extreme long compile) is the header `curl/typecheck-gcc.h`. By accident I noticed that the preprocessed output of libtests.c is 75 MB (megabytes). This is much higher than the amounf of source code hinted, also compared to e.g. units.c or other build targets. The reason for the extreme size is each easy option call pulling in the large checker logic defined in this header. By compiling with `-DCURL_DISABLE_TYPECHECK`, preprocessed output drops to 2.2 MB (34x), and the libtests target builds without issues. Also build all tests and examples with the Linux HTTP/3 config, covering 3 more files. With these, CodeQL C coverage is 893 out of 930 (96%) (was: 645 69%) Follow-up to71fc11e6bb#18695 Follow-up toa333fd4411#18557 Follow-up tob4922b1295#18564 Closes https://github.com/vszakats/curl/pull/11 Closes #19632
This commit is contained in:
parent
27a7cf40bb
commit
fdacf34aae
10
.github/workflows/codeql.yml
vendored
10
.github/workflows/codeql.yml
vendored
@ -109,24 +109,24 @@ jobs:
|
||||
# MultiSSL
|
||||
export PKG_CONFIG_PATH; PKG_CONFIG_PATH="$(brew --prefix c-ares)/lib/pkgconfig:$(brew --prefix mbedtls)/lib/pkgconfig:$(brew --prefix rustls-ffi)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig"
|
||||
cmake -B _bld1 -G Ninja -DENABLE_DEBUG=ON \
|
||||
-DCMAKE_C_FLAGS=-DCURL_DISABLE_TYPECHECK \
|
||||
-DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DCURL_USE_RUSTLS=ON -DCURL_USE_WOLFSSL=ON \
|
||||
-DUSE_LIBRTMP=ON -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON -DUSE_ECH=ON -DENABLE_ARES=ON \
|
||||
-DCURL_DISABLE_VERBOSE_STRINGS=ON
|
||||
cmake --build _bld1
|
||||
cmake --build _bld1 --target curlinfo
|
||||
cmake --build _bld1 --target servers
|
||||
cmake --build _bld1 --target tunits
|
||||
cmake --build _bld1 --target units
|
||||
cmake --build _bld1 --target testdeps
|
||||
cmake --build _bld1 --target curl-examples-build
|
||||
|
||||
# HTTP/3
|
||||
export PKG_CONFIG_PATH; PKG_CONFIG_PATH="$(brew --prefix libnghttp3)/lib/pkgconfig:$(brew --prefix libngtcp2)/lib/pkgconfig:$(brew --prefix gsasl)/lib/pkgconfig"
|
||||
cmake -B _bld2 -G Ninja \
|
||||
-DCMAKE_C_FLAGS=-DCURL_DISABLE_TYPECHECK \
|
||||
-DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR="$(brew --prefix openssl)" -DUSE_NGTCP2=ON \
|
||||
-DCURL_USE_LIBSSH2=OFF -DCURL_USE_LIBSSH=ON \
|
||||
-DUSE_LIBRTMP=ON -DCURL_USE_GSASL=ON -DCURL_USE_GSSAPI=ON -DUSE_SSLS_EXPORT=ON
|
||||
cmake --build _bld2
|
||||
cmake --build _bld2 --target servers
|
||||
cmake --build _bld2 --target testdeps
|
||||
cmake --build _bld2 --target curl-examples-build
|
||||
|
||||
_bld1/src/curl --disable --version
|
||||
_bld2/src/curl --disable --version
|
||||
|
||||
Loading…
Reference in New Issue
Block a user