Skip to content

Fix static c-ares detection for c-ares >= 1.27#3025

Open
madeye wants to merge 2 commits intomasterfrom
fix/cares-static-lib-name
Open

Fix static c-ares detection for c-ares >= 1.27#3025
madeye wants to merge 2 commits intomasterfrom
fix/cares-static-lib-name

Conversation

@madeye
Copy link
Contributor

@madeye madeye commented Feb 10, 2026

Summary

  • c-ares >= 1.27 (as shipped in Ubuntu 24.04) renamed the static library from libcares.a to libcares_static.a
  • The find_library(LIBUDNS libcares.a) call fails on these newer systems, breaking the static build
  • Use find_library(LIBUDNS NAMES libcares.a libcares_static.a) to search for both names, maintaining backward compatibility with older distros

Fixes #3024

Test plan

  • Verify static build succeeds on Ubuntu 24.04 (c-ares >= 1.27, libcares_static.a)
  • Verify static build still succeeds on Ubuntu 22.04 (c-ares 1.18, libcares.a)
  • CI passes on both ubuntu-latest and macos-latest

🤖 Generated with Claude Code

madeye and others added 2 commits February 10, 2026 15:43
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 <noreply@anthropic.com>
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 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LIBUDNS in src/CMakeLists.txt pointing to libcares.a may not work for newer Debian releases

1 participant