From 7ac8694aaea7af76d5ab5db52ad392878ada5f8f Mon Sep 17 00:00:00 2001 From: Max Lv Date: Tue, 10 Feb 2026 15:43:42 +0800 Subject: [PATCH 1/2] Fix static c-ares detection for newer Debian/Ubuntu releases c-ares >= 1.27 renamed the static library from libcares.a to libcares_static.a. Search for both names so the static build works on older distros (libcares.a) and newer ones (libcares_static.a). Fixes #3024 Co-Authored-By: Claude Opus 4.6 --- src/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 80503cb22..e12daccf6 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -105,7 +105,7 @@ find_library(LIBMBEDTLS libmbedtls.a) find_library(LIBMBEDCRYPTO libmbedcrypto.a HINTS ${_MBEDTLS_LIB_DIR} NO_DEFAULT_PATH) find_library(LIBMBEDCRYPTO libmbedcrypto.a) find_library(LIBEV libev.a) -find_library(LIBUDNS libcares.a) +find_library(LIBUDNS NAMES libcares.a libcares_static.a) find_library(LIBPCRE2 libpcre2-8.a) # Dependencies we need for static and shared From 716269d020e9c2b398c24234ee31cf61d1b65372 Mon Sep 17 00:00:00 2001 From: Max Lv Date: Tue, 10 Feb 2026 16:13:44 +0800 Subject: [PATCH 2/2] CI: enable static build to catch static-linking issues WITH_STATIC defaults to ON in CMakeLists.txt but CI was explicitly disabling it. Remove -DWITH_STATIC=OFF so the static targets are also built and linked, catching issues like the c-ares static library rename (#3024). Co-Authored-By: Claude Opus 4.6 --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9c905a6b3..2b13d7f95 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,7 +31,7 @@ jobs: - name: Build run: | mkdir -p build && cd build - cmake .. -DCMAKE_BUILD_TYPE=Release -DWITH_STATIC=OFF + cmake .. -DCMAKE_BUILD_TYPE=Release make -j$(nproc 2>/dev/null || sysctl -n hw.ncpu) - name: Unit tests