Skip to content

Commit 07e7fed

Browse files
committed
docs: update installation guide for vendored cpp-httplib fallback
Remove manual source install instructions for Humble - the vendored fallback handles this automatically. Update troubleshooting section and cmake error message accordingly.
1 parent 645829d commit 07e7fed

4 files changed

Lines changed: 20 additions & 47 deletions

File tree

docs/installation.rst

Lines changed: 8 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,25 +36,10 @@ for your distribution:
3636

3737
.. note::
3838

39-
On Ubuntu 22.04 (Humble), the ``libcpp-httplib-dev`` system package is either not
40-
available or too old (0.10.x). ros2_medkit requires cpp-httplib >= 0.14 for the
41-
``httplib::StatusCode`` enum and ``std::string`` API overloads.
42-
43-
If ``libcpp-httplib-dev`` is installed, **remove it first** to avoid version conflicts:
44-
45-
.. code-block:: bash
46-
47-
sudo apt remove libcpp-httplib-dev
48-
49-
Then install cpp-httplib >= 0.14 from source:
50-
51-
.. code-block:: bash
52-
53-
sudo apt install cmake g++ libssl-dev
54-
git clone --depth 1 --branch v0.14.3 https://github.com/yhirose/cpp-httplib.git /tmp/cpp-httplib
55-
cd /tmp/cpp-httplib && mkdir build && cd build
56-
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DHTTPLIB_REQUIRE_OPENSSL=ON
57-
sudo make install
39+
On Ubuntu 22.04 (Humble), the system ``libcpp-httplib-dev`` package provides
40+
cpp-httplib 0.10.x which is too old. ros2_medkit requires >= 0.14 but ships a
41+
vendored copy as a fallback - no manual installation is needed. The build system
42+
automatically uses the vendored header when the system package is insufficient.
5843

5944
Installation from Source
6045
------------------------
@@ -176,19 +161,11 @@ Troubleshooting
176161
177162
gcc --version # Should show 13.x or higher
178163
179-
**Build fails on Humble with** ``httplib::StatusCode has not been declared``
180-
181-
The system ``libcpp-httplib-dev`` package on Ubuntu 22.04 provides cpp-httplib 0.10.x,
182-
which is too old. ros2_medkit requires cpp-httplib >= 0.14. Remove the system package
183-
and install from source:
184-
185-
.. code-block:: bash
164+
**Build fails on Humble with** ``Could not find cpp-httplib >= 0.14``
186165

187-
sudo apt remove libcpp-httplib-dev
188-
git clone --depth 1 --branch v0.14.3 https://github.com/yhirose/cpp-httplib.git /tmp/cpp-httplib
189-
cd /tmp/cpp-httplib && mkdir build && cd build
190-
cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DHTTPLIB_REQUIRE_OPENSSL=ON
191-
sudo make install
166+
This should not happen with current builds - a vendored copy of cpp-httplib 0.14.3
167+
is included as an automatic fallback. If you see this error, ensure ``ros2_medkit_cmake``
168+
is built before the gateway (``colcon build`` handles this automatically).
192169

193170
**Cannot find ros2_medkit packages after build**
194171

scripts/pixi-install-cpp-httplib.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515

1616
# Install cpp-httplib v0.14.3 into the Pixi prefix ($CONDA_PREFIX).
1717
# cpp-httplib is not available on conda-forge, so we build from source.
18-
# This is the same approach used in CI for ROS 2 Humble.
18+
# Standard CI uses the vendored copy in ros2_medkit_gateway; this script
19+
# is only needed for Pixi environments where conda-forge is the package source.
1920
set -euo pipefail
2021

2122
VERSION="v0.14.3"

src/ros2_medkit_cmake/cmake/ROS2MedkitCompat.cmake

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,13 @@ endmacro()
7272
# ---------------------------------------------------------------------------
7373
# medkit_find_cpp_httplib()
7474
# ---------------------------------------------------------------------------
75-
# On Jazzy/Noble, libcpp-httplib-dev is available via apt and provides a
76-
# pkg-config .pc file. On Humble/Jammy, cpp-httplib must be built from
77-
# source, which installs a CMake config file (httplibConfig.cmake).
75+
# Finds cpp-httplib >= 0.14 through a multi-tier fallback chain:
76+
# 1. pkg-config (Jazzy/Noble system package)
77+
# 2. cmake find_package(httplib) (source builds, Pixi)
78+
# 3. VENDORED_DIR parameter (bundled header-only copy)
7879
#
79-
# Requires cpp-httplib >= 0.14 (StatusCode enum, std::string overloads).
80-
# Older system packages (e.g. 0.10.x on Jammy) are rejected by pkg-config
81-
# so the fallback cmake/source path is used instead.
80+
# On Humble/Jammy the system package is 0.10.x (too old); the vendored
81+
# fallback in ros2_medkit_gateway handles this automatically.
8282
#
8383
# Creates a unified alias target `cpp_httplib_target` for consumers.
8484
# ---------------------------------------------------------------------------
@@ -104,14 +104,9 @@ macro(medkit_find_cpp_httplib)
104104
else()
105105
message(FATAL_ERROR
106106
"[MedkitCompat] Could not find cpp-httplib >= 0.14.\n"
107-
" The system libcpp-httplib-dev package on Ubuntu 22.04 provides 0.10.x which is too old.\n"
108-
" ros2_medkit requires cpp-httplib >= 0.14 for httplib::StatusCode and std::string overloads.\n"
109-
" Fix: remove the old system package and install from source:\n"
110-
" sudo apt remove libcpp-httplib-dev\n"
111-
" git clone --depth 1 --branch v0.14.3 https://github.com/yhirose/cpp-httplib.git /tmp/cpp-httplib\n"
112-
" cd /tmp/cpp-httplib && mkdir build && cd build\n"
113-
" cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DHTTPLIB_REQUIRE_OPENSSL=ON\n"
114-
" sudo make install\n"
107+
" Tried: pkg-config, cmake find_package(httplib), VENDORED_DIR.\n"
108+
" ros2_medkit_gateway vendors cpp-httplib 0.14.3 - ensure ros2_medkit_gateway\n"
109+
" is built first, or pass VENDORED_DIR to medkit_find_cpp_httplib().\n"
115110
" See: https://selfpatch.github.io/ros2_medkit/installation.html")
116111
endif()
117112
endif()

src/ros2_medkit_cmake/design/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The package provides four CMake modules installed to the ament index:
3838
4. **ROS2MedkitCompat.cmake** - Multi-distro compatibility layer
3939

4040
- ``medkit_find_yaml_cpp()`` - Resolves yaml-cpp across Humble (no cmake target) and Jazzy (namespaced target)
41-
- ``medkit_find_cpp_httplib()`` - Finds cpp-httplib via pkg-config (Jazzy/Noble) or cmake config (source build on Humble)
41+
- ``medkit_find_cpp_httplib()`` - Finds cpp-httplib >= 0.14 via pkg-config, cmake config, or vendored fallback (``VENDORED_DIR`` param)
4242
- ``medkit_detect_compat_defs()`` - Detects rclcpp and rosbag2 versions, sets ``MEDKIT_RCLCPP_VERSION_MAJOR`` and ``MEDKIT_ROSBAG2_OLD_TIMESTAMP``
4343
- ``medkit_apply_compat_defs(target)`` - Applies compile definitions based on detected versions
4444
- ``medkit_target_dependencies(target ...)`` - Drop-in replacement for ``ament_target_dependencies`` that also works on Rolling (where ``ament_target_dependencies`` was removed)

0 commit comments

Comments
 (0)