From 59e3b693f7b47858445cb140b8d786a52664ab83 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Wed, 21 Jan 2026 13:55:32 +0100 Subject: [PATCH] windows: test non-verbose builds, fix fallouts - schannel: fix mixed-up declaration. (originally fenced infof for verbose, then changed to failf with the fence kept, then fence removed and variable marked as verbose, when in fact it's not, but not tested and caught in CI. - fix two other fallouts. - GHA/windows: disable verbose strings in a mingw job. - appveyor: disable verbose strings in an MSVC job. - appveyor: add way to pass any CMake option per-job. Cherry-picked from #20387 Follow-up to 61093e2a819d26b7ddf309baef264b9e50c6c56f #20353 Closes #20388 --- .github/workflows/windows.yml | 2 +- appveyor.sh | 1 + appveyor.yml | 8 +++++--- lib/mqtt.c | 2 +- lib/multi.c | 1 + lib/vtls/schannel.c | 2 +- 6 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8f10faf62f..a9f823af8e 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -436,7 +436,7 @@ jobs: env: 'x86_64' ver: '9.5.0' url: 'https://github.com/brechtsanders/winlibs_mingw/releases/download/9.5.0-10.0.0-msvcrt-r1/winlibs-x86_64-posix-seh-gcc-9.5.0-mingw-w64msvcrt-10.0.0-r1.7z' - config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF' + config: '-DENABLE_DEBUG=ON -DBUILD_SHARED_LIBS=OFF -DCURL_USE_SCHANNEL=ON -DENABLE_UNICODE=OFF -DCURL_DISABLE_VERBOSE_STRINGS=ON' type: 'Release' tflags: 'skiprun' - name: 'schannel mbedtls U' # mingw-w64 6.0 diff --git a/appveyor.sh b/appveyor.sh index a5af2ef308..732d803d35 100644 --- a/appveyor.sh +++ b/appveyor.sh @@ -89,6 +89,7 @@ if [ "${BUILD_SYSTEM}" = 'CMake' ]; then -DCURL_USE_SCHANNEL="${SCHANNEL}" \ -DCURL_USE_OPENSSL="${OPENSSL}" \ -DCURL_USE_LIBPSL=OFF \ + ${CMAKE_OPTIONS:-} \ ${options} \ || { cat "${root}"/_bld/CMakeFiles/CMake* 2>/dev/null; false; } [ "${APPVEYOR_BUILD_WORKER_IMAGE}" = 'Visual Studio 2013' ] && cd .. diff --git a/appveyor.yml b/appveyor.yml index a0e21b2e1e..79eb9094b8 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -41,6 +41,7 @@ environment: HTTP_ONLY: 'OFF' TFLAGS: 'skiprun' EXAMPLES: 'OFF' + CMAKE_OPTIONS: '' matrix: @@ -53,7 +54,7 @@ environment: PRJ_CFG: Release OPENSSL: 'ON' SHARED: 'ON' - - job_name: 'CM VS2022, Release, arm64, Schannel, Static, no-DEBUGBUILD, Build-tests' + - job_name: 'CM VS2022, Release, arm64, Schannel, Static, !DEBUGBUILD, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A ARM64' @@ -101,7 +102,7 @@ environment: SCHANNEL: 'ON' SHARED: 'ON' TFLAGS: 'skipall' - - job_name: 'CM VS2019, Debug, x64, OpenSSL 3.0 + Schannel, Shared, Build-tests' + - job_name: 'CM VS2019, Debug, x64, OpenSSL 3.0 + Schannel, Shared, !verbose, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2019' PRJ_GEN: 'Visual Studio 16 2019' TARGET: '-A x64' @@ -109,6 +110,7 @@ environment: OPENSSL: 'ON' SCHANNEL: 'ON' SHARED: 'ON' + CMAKE_OPTIONS: '-DCURL_DISABLE_VERBOSE_STRINGS=ON' - job_name: 'CM VS2022, Debug, x64, OpenSSL 3.5 + Schannel, Static, Unicode, Build-tests & examples, clang-cl' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' @@ -119,7 +121,7 @@ environment: ENABLE_UNICODE: 'ON' EXAMPLES: 'ON' TOOLSET: 'ClangCl' - - job_name: 'CM VS2022, Release, x64, Schannel, Shared, Unicode, no-DEBUGBUILD, Build-tests' + - job_name: 'CM VS2022, Release, x64, Schannel, Shared, Unicode, !DEBUGBUILD, Build-tests' APPVEYOR_BUILD_WORKER_IMAGE: 'Visual Studio 2022' PRJ_GEN: 'Visual Studio 17 2022' TARGET: '-A x64' diff --git a/lib/mqtt.c b/lib/mqtt.c index f5c8353a9f..cabafa3383 100644 --- a/lib/mqtt.c +++ b/lib/mqtt.c @@ -614,7 +614,7 @@ static int mqtt_decode_len(size_t *lenp, unsigned char *buf, size_t buflen) return 0; } -#ifdef DEBUGBUILD +#if defined(DEBUGBUILD) && defined(CURLVERBOSE) static const char *statenames[] = { "MQTT_FIRST", "MQTT_REMAINING_LENGTH", diff --git a/lib/multi.c b/lib/multi.c index 84956e182d..b847f81a7a 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -160,6 +160,7 @@ static void mstate(struct Curl_easy *data, CURLMstate state return; #ifdef DEBUGBUILD + NOVERBOSE((void)lineno); CURL_TRC_M(data, "-> [%s] (line %d)", CURL_MSTATE_NAME(state), lineno); #else CURL_TRC_M(data, "-> [%s]", CURL_MSTATE_NAME(state)); diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index 027d28e045..fd268c92a3 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -2259,7 +2259,7 @@ static CURLcode schannel_recv(struct Curl_cfilter *cf, struct Curl_easy *data, goto cleanup; } else { - VERBOSE(char buffer[STRERROR_LEN]); + char buffer[STRERROR_LEN]; failf(data, "schannel: failed to read data from server: %s", Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer))); result = CURLE_RECV_ERROR;