From 20f32773b79ec1222603ece6bfe1b06b61e54ad4 Mon Sep 17 00:00:00 2001 From: Xudong Han <42986190+han-xudong@users.noreply.github.com> Date: Sat, 25 Jul 2026 01:46:30 +0800 Subject: [PATCH 1/2] fix: require libcurl 7.63 for URL handles --- CHANGELOG.md | 6 ++++ CMakeLists.txt | 4 +-- README.md | 2 +- cmake/netftConfig.cmake.in | 2 +- pixi.toml | 4 +-- test/CMakeLists.txt | 5 +++ test/curl_minimum_test.sh | 64 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 81 insertions(+), 6 deletions(-) create mode 100644 test/curl_minimum_test.sh diff --git a/CHANGELOG.md b/CHANGELOG.md index 86d6a10..b24a7cd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,12 @@ All notable changes to this project are documented in this file. +## 0.2.2 - 2026-07-25 + +### Fixed + +- Require libcurl 7.63.0 or newer, matching the first release that provides the `CURLOPT_CURLU` API used by sensor discovery. + ## 0.2.1 - 2026-07-25 ### Fixed diff --git a/CMakeLists.txt b/CMakeLists.txt index 6caf0a1..a2017a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.16) -project(netft VERSION 0.2.1 LANGUAGES CXX) +project(netft VERSION 0.2.2 LANGUAGES CXX) include(CTest) include(GNUInstallDirs) @@ -22,7 +22,7 @@ if(NETFT_SANITIZERS) endif() find_package(Threads REQUIRED) -find_package(CURL 7.62 REQUIRED) +find_package(CURL 7.63.0 REQUIRED) add_library(netft src/types.cpp diff --git a/README.md b/README.md index c9e3602..08db306 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ configuration discovery, stream health reporting, and explicit recovery policies ## Supported platforms The supported platforms are 64-bit Linux on x86-64 and AArch64. Building requires a C++17 -compiler, CMake 3.16 or newer, POSIX threads, and libcurl 7.62 or newer. GoogleTest is required +compiler, CMake 3.16 or newer, POSIX threads, and libcurl 7.63.0 or newer. GoogleTest is required only when `BUILD_TESTING=ON`. The checked-in Pixi environment supports both `linux-64` and `linux-aarch64` and provides the development toolchain. diff --git a/cmake/netftConfig.cmake.in b/cmake/netftConfig.cmake.in index fb2a3d1..0a9d809 100644 --- a/cmake/netftConfig.cmake.in +++ b/cmake/netftConfig.cmake.in @@ -2,7 +2,7 @@ include(CMakeFindDependencyMacro) find_dependency(Threads) -find_dependency(CURL 7.62) +find_dependency(CURL 7.63.0) include("${CMAKE_CURRENT_LIST_DIR}/netftTargets.cmake") diff --git a/pixi.toml b/pixi.toml index a9c9e25..589b12b 100644 --- a/pixi.toml +++ b/pixi.toml @@ -1,6 +1,6 @@ [workspace] name = "netft-cpp" -version = "0.2.1" +version = "0.2.2" channels = ["conda-forge"] platforms = ["linux-64", "linux-aarch64"] @@ -9,7 +9,7 @@ cmake = "*" ninja = "*" cxx-compiler = "*" gtest = "*" -libcurl = "*" +libcurl = ">=7.63.0" clang = "*" clangxx = "*" clang-tools = "*" diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 5a741b0..c5557ca 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -160,3 +160,8 @@ add_test( -DARGUMENTS=invalid-command -P ${CMAKE_CURRENT_SOURCE_DIR}/assert_exit_code.cmake ) + +add_test( + NAME netft_curl_minimum + COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/curl_minimum_test.sh +) diff --git a/test/curl_minimum_test.sh b/test/curl_minimum_test.sh new file mode 100644 index 0000000..827978b --- /dev/null +++ b/test/curl_minimum_test.sh @@ -0,0 +1,64 @@ +#!/usr/bin/env bash + +set -euo pipefail + +repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd -P)" +test_root="$(mktemp -d)" +trap 'rm -rf -- "${test_root}"' EXIT + +make_curl_fixture() { + local version="$1" + local fixture="$2" + + mkdir -p "${fixture}/include/curl" "${fixture}/lib" + printf '#define LIBCURL_VERSION "%s"\n' "${version}" \ + >"${fixture}/include/curl/curlver.h" + : >"${fixture}/include/curl/curl.h" + : >"${fixture}/lib/libcurl.a" +} + +configure_with_curl() { + local fixture="$1" + local build_dir="$2" + + cmake -S "${repo_root}" -B "${build_dir}" -G Ninja \ + -DBUILD_TESTING=OFF \ + -DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON \ + -DCURL_NO_CURL_CMAKE=ON \ + -DCURL_INCLUDE_DIR="${fixture}/include" \ + -DCURL_LIBRARY="${fixture}/lib/libcurl.a" +} + +make_curl_fixture 7.62.0 "${test_root}/curl-7.62" +if configure_with_curl \ + "${test_root}/curl-7.62" "${test_root}/build-7.62" \ + >"${test_root}/curl-7.62.log" 2>&1; then + printf '%s\n' 'libcurl 7.62.0 unexpectedly satisfied the project requirement' >&2 + exit 1 +fi + +make_curl_fixture 7.63.0 "${test_root}/curl-7.63" +if ! configure_with_curl \ + "${test_root}/curl-7.63" "${test_root}/build-7.63" \ + >"${test_root}/curl-7.63.log" 2>&1; then + printf '%s\n' 'libcurl 7.63.0 did not satisfy the project requirement' >&2 + sed 's/^/ /' "${test_root}/curl-7.63.log" >&2 + exit 1 +fi + +cmake_version="$( + sed -nE \ + 's/^project\(netft VERSION ([0-9]+\.[0-9]+\.[0-9]+).*$/\1/p' \ + "${repo_root}/CMakeLists.txt" +)" +pixi_version="$( + sed -nE \ + 's/^version = "([0-9]+\.[0-9]+\.[0-9]+)"$/\1/p' \ + "${repo_root}/pixi.toml" +)" +test "${cmake_version}" = "0.2.2" +test "${pixi_version}" = "${cmake_version}" + +grep -Eq '^find_dependency\(CURL 7\.63(\.0)?\)$' \ + "${repo_root}/cmake/netftConfig.cmake.in" +grep -Eq '^[[:space:]]*SOVERSION 1$' "${repo_root}/CMakeLists.txt" From 5778aec918f933dfaa6ddf46cb716ade2d8f016c Mon Sep 17 00:00:00 2001 From: Xudong Han <42986190+han-xudong@users.noreply.github.com> Date: Sat, 25 Jul 2026 01:59:17 +0800 Subject: [PATCH 2/2] test: lock the Pixi libcurl minimum --- test/curl_minimum_test.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/curl_minimum_test.sh b/test/curl_minimum_test.sh index 827978b..82c38f0 100644 --- a/test/curl_minimum_test.sh +++ b/test/curl_minimum_test.sh @@ -61,4 +61,6 @@ test "${pixi_version}" = "${cmake_version}" grep -Eq '^find_dependency\(CURL 7\.63(\.0)?\)$' \ "${repo_root}/cmake/netftConfig.cmake.in" +grep -Eq '^[[:space:]]*libcurl = ">=7\.63\.0"$' \ + "${repo_root}/pixi.toml" grep -Eq '^[[:space:]]*SOVERSION 1$' "${repo_root}/CMakeLists.txt"