Skip to content

Comments

fix(cmake): require cpp-httplib >= 0.14 in pkg-config check#230

Merged
bburda merged 1 commit intomainfrom
fix/225-cpp-httplib-version-check
Feb 20, 2026
Merged

fix(cmake): require cpp-httplib >= 0.14 in pkg-config check#230
bburda merged 1 commit intomainfrom
fix/225-cpp-httplib-version-check

Conversation

@bburda
Copy link
Collaborator

@bburda bburda commented Feb 19, 2026

Pull Request

Summary

Add minimum version constraint (>=0.14) to pkg_check_modules() in medkit_find_cpp_httplib() so that old system packages (e.g. 0.10.x on Ubuntu 22.04 Jammy) are rejected and the cmake/source-build fallback path is used instead.

Also improves error reporting with a clear FATAL_ERROR message when no suitable cpp-httplib is found, and updates installation docs with prerequisites and troubleshooting guidance.


Issue


Type

  • Bug fix
  • New feature or tests
  • Breaking change
  • Documentation only

Testing

  • On Jazzy/Noble: no behavior change - pkg-config finds the system package (0.18.x) which satisfies >=0.14
  • On Humble/Jammy with libcpp-httplib-dev installed: pkg-config now rejects 0.10.x, falls through to cmake config path (source-built cpp-httplib)
  • On Humble/Jammy without any cpp-httplib: clear FATAL_ERROR with installation instructions instead of a cryptic find_package(httplib REQUIRED) failure

Checklist

  • Breaking changes are clearly described (and announced in docs / changelog if needed)
  • Tests were added or updated if needed
  • Docs were updated if behavior or public API changed

Add minimum version constraint to pkg_check_modules() so that old
system packages (e.g. 0.10.x on Ubuntu 22.04 Jammy) are rejected
and the cmake/source-build fallback path is used instead.

Without this, building on Humble with libcpp-httplib-dev installed
fails due to missing StatusCode enum and std::string overloads
that were added in cpp-httplib 0.14.

Also improves error reporting:
- FATAL_ERROR with clear diagnosis and fix instructions when neither
  pkg-config nor cmake config finds a suitable cpp-httplib
- Updated installation.rst prerequisites and troubleshooting sections

Closes #225
Copilot AI review requested due to automatic review settings February 19, 2026 20:34
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes a build failure on ROS 2 Humble (Ubuntu 22.04) when the system libcpp-httplib-dev package is installed. The system package provides cpp-httplib 0.10.x, which lacks the httplib::StatusCode enum and std::string API overloads that ros2_medkit requires (available in cpp-httplib >= 0.14). The fix adds a minimum version constraint to the pkg-config check so that old versions are rejected and the CMake/source-build fallback path is used instead. It also improves error reporting with clear installation instructions.

Changes:

  • Add >=0.14 version constraint to pkg_check_modules() in the cpp-httplib finder macro
  • Convert find_package(httplib REQUIRED) to QUIET mode with explicit error handling and helpful FATAL_ERROR message containing installation instructions
  • Update installation documentation to explain the version requirement and provide clear removal/installation steps for Humble users
  • Add troubleshooting section for the specific httplib::StatusCode has not been declared error

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
cmake/ROS2MedkitCompat.cmake Adds version constraint to pkg-config check, converts to QUIET mode with explicit error handling, improves status messages
docs/installation.rst Updates prerequisites note and adds troubleshooting section with clear installation instructions for cpp-httplib >= 0.14

@bburda bburda self-assigned this Feb 19, 2026
@bburda bburda added the bug Something isn't working label Feb 19, 2026
@bburda bburda requested a review from mfaferek93 February 19, 2026 21:08
@bburda bburda merged commit acc8ad1 into main Feb 20, 2026
11 checks passed
@bburda bburda deleted the fix/225-cpp-httplib-version-check branch February 20, 2026 08:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] Build fails on Humble when system libcpp-httplib-dev is installed - old cpp-httplib version lacks StatusCode and std::string overloads

2 participants