From: Viktor Szakats Date: Wed, 19 Mar 2025 17:42:54 +0000 (+0100) Subject: GHA: extend clang-tidy jobs with more build options, add Windows job X-Git-Tag: curl-8_13_0~82 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e7944fb3dadcde1d701466848b6adcbcea5a37ba;p=thirdparty%2Fcurl.git GHA: extend clang-tidy jobs with more build options, add Windows job - linux: wolfssl, wolfssh (replacing libssh2), ech, kerberos/GSSAPI, ssls-export (libssh2 remains tested on macos.) - macos: brotli, zstd, c-ares, gnutls, mbedtls, gsasl, rtmp, ssls-export - windows: new job with schannel, sspi, winidn, winldap, ssls-export - unit3205: fix/silence remaining NULL dereferences. Commits fixing the issues found: cbbccb8b3aa357926131375e7082b2579fa3fe82 #16766 554e4c14bee82a604e08d51767f49fe11580e700 #16777 Closes #16764 --- diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index ab48f13e9f..13f280185c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -215,9 +215,9 @@ jobs: configure: --without-ssl --enable-debug --disable-http --disable-smtp --disable-imap --disable-unity - name: clang-tidy - install_packages: clang-tidy libssl-dev libssh2-1-dev - install_steps: skipall - configure: --with-openssl --with-libssh2 + install_packages: clang-tidy zlib1g-dev libssl-dev libkrb5-dev + install_steps: skipall wolfssl-opensslextra wolfssh + configure: LDFLAGS="-Wl,-rpath,$HOME/wolfssl-opensslextra/lib" --with-wolfssl=$HOME/wolfssl-opensslextra --with-wolfssh=$HOME/wolfssh --with-openssl --enable-ech --with-gssapi --enable-ssls-export make-custom-target: tidy - name: scanbuild diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 3d55125e89..6285c4af22 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -133,9 +133,9 @@ jobs: - name: 'OpenSSL gsasl rtmp AppleIDN' install: gsasl rtmpdump generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON -DUSE_APPLE_IDN=ON - - name: 'OpenSSL AppleIDN clang-tidy +examples' - install: llvm - generate: -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DUSE_APPLE_IDN=ON -DCURL_CLANG_TIDY=ON -DCLANG_TIDY=$(brew --prefix llvm)/bin/clang-tidy + - name: 'MultiSSL AppleIDN clang-tidy +examples' + install: llvm brotli zstd gnutls nettle mbedtls gsasl rtmpdump + generate: -DCURL_USE_OPENSSL=ON -DOPENSSL_ROOT_DIR=$(brew --prefix openssl) -DCURL_DEFAULT_SSL_BACKEND=openssl -DCURL_USE_GNUTLS=ON -DCURL_USE_MBEDTLS=ON -DENABLE_ARES=ON -DCURL_USE_GSASL=ON -DUSE_LIBRTMP=ON -DUSE_APPLE_IDN=ON -DUSE_SSLS_EXPORT=ON -DCURL_CLANG_TIDY=ON -DCLANG_TIDY=$(brew --prefix llvm)/bin/clang-tidy clang-tidy: true chkprefill: _chkprefill - name: 'quictls +static libssh +examples' diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 90f713b235..9a82cdb685 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -538,12 +538,17 @@ jobs: strategy: fail-fast: false matrix: - build: [autotools, cmake] - compiler: [gcc] + include: + - { build: 'autotools', compiler: 'gcc' } + - { build: 'cmake' , compiler: 'gcc' } + - { build: 'cmake' , compiler: 'clang-tidy' } steps: - name: 'install packages' timeout-minutes: 5 - run: sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64 ${{ matrix.build == 'cmake' && 'ninja-build' || '' }} + run: | + sudo apt-get -o Dpkg::Use-Pty=0 install mingw-w64 \ + ${{ matrix.build == 'cmake' && 'ninja-build' || '' }} \ + ${{ matrix.compiler == 'clang-tidy' && 'clang' || '' }} - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4 with: @@ -556,14 +561,22 @@ jobs: - name: 'configure' run: | if [ '${{ matrix.build }}' = 'cmake' ]; then + if [ '${{ matrix.compiler }}' = 'clang-tidy' ]; then + options+=' -DCURL_CLANG_TIDY=ON' + options+=' -DENABLE_UNICODE=ON -DUSE_SSLS_EXPORT=ON' + options+=' -DCMAKE_C_COMPILER=clang' + options+=" -DCMAKE_RC_COMPILER=llvm-windres-$(clang -dumpversion | cut -d '.' -f 1)" + else + options+=" -DCMAKE_C_COMPILER=${TRIPLET}-gcc" + fi cmake -B bld -G Ninja \ -DCMAKE_SYSTEM_NAME=Windows \ -DCMAKE_C_COMPILER_TARGET="${TRIPLET}" \ - -DCMAKE_C_COMPILER="${TRIPLET}-gcc" \ -DCMAKE_UNITY_BUILD=ON -DCURL_TEST_BUNDLES=ON \ -DCURL_WERROR=ON \ -DCURL_USE_SCHANNEL=ON -DUSE_WIN32_IDN=ON \ - -DCURL_USE_LIBPSL=OFF + -DCURL_USE_LIBPSL=OFF \ + ${options} else mkdir bld && cd bld && ../configure --enable-unity --enable-test-bundles --enable-warnings --enable-werror \ --host="${TRIPLET}" \ @@ -593,7 +606,7 @@ jobs: run: find . \( -name '*.exe' -o -name '*.dll' -o -name '*.a' \) -exec file '{}' \; - name: 'build tests' - if: ${{ matrix.build == 'cmake' }} # Save time by skipping this for autotools + if: ${{ matrix.build == 'cmake' && matrix.compiler != 'clang-tidy' }} # Save time by skipping this for autotools and clang-tidy run: | if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --target testdeps @@ -602,6 +615,7 @@ jobs: fi - name: 'build examples' + if: ${{ matrix.compiler != 'clang-tidy' }} # Save time by skipping this for clang-tidy run: | if [ '${{ matrix.build }}' = 'cmake' ]; then cmake --build bld --target curl-examples diff --git a/tests/unit/unit3205.c b/tests/unit/unit3205.c index 825b8000e4..1ed0f2005b 100644 --- a/tests/unit/unit3205.c +++ b/tests/unit/unit3205.c @@ -722,7 +722,7 @@ UNITTEST_START Curl_cipher_suite_get_str(test->id, buf, sizeof(buf), true); - if(strcmp(buf, expect) != 0) { + if(expect && strcmp(buf, expect) != 0) { fprintf(stderr, "Curl_cipher_suite_get_str FAILED for 0x%04x, " "result = \"%s\", expected = \"%s\"\n", test->id, buf, expect); @@ -737,13 +737,13 @@ UNITTEST_START /* suites matched by EDH alias will return the DHE name */ if(test->id >= 0x0011 && test->id < 0x0017) { - if(memcmp(expect, "EDH-", 4) == 0) + if(expect && memcmp(expect, "EDH-", 4) == 0) expect = (char *) memcpy(strcpy(alt, expect), "DHE-", 4); - if(memcmp(expect + 4, "EDH-", 4) == 0) + if(expect && memcmp(expect + 4, "EDH-", 4) == 0) expect = (char *) memcpy(strcpy(alt, expect) + 4, "DHE-", 4) - 4; } - if(strcmp(buf, expect) != 0) { + if(expect && strcmp(buf, expect) != 0) { fprintf(stderr, "Curl_cipher_suite_get_str FAILED for 0x%04x, " "result = \"%s\", expected = \"%s\"\n", test->id, buf, expect);