Skip to content

fix(build): stop Rolling CMake configure aborting in the localhost_only probe - #10

Merged
benaliabderrahmane merged 1 commit into
mainfrom
fix/rolling-cmake-probe
Jun 3, 2026
Merged

benaliabderrahmane merged 1 commit into
mainfrom
fix/rolling-cmake-probe

Conversation

@benaliabderrahmane

Copy link
Copy Markdown
Owner

Problem

On Rolling, colcon build aborts at CMake configure time, before any source compiles:

-- Performing Test RMW_HAS_LOCALHOST_ONLY
No known features for C compiler
  "" version .
Failed to generate test project build system.

The RMW_HAS_LOCALHOST_ONLY probe (commit fb9ee3d) runs check_cxx_source_compiles(...) with CMAKE_REQUIRED_LIBRARIES = rmw::rmw rcutils::rcutils, which links those imported targets into a CXX-only scratch project. rcutils is a C library whose exported target now carries a C INTERFACE_COMPILE_FEATURES; resolving a C compile feature in a project where the C language was never enabled makes the inner try_compile fail to generate. This is upstream drift — the same CMakeLists.txt passed Rolling on 2026-06-01, and jazzy/kilted are unaffected.

Fix

The probe only needs the rmw headers (it references the type + a macro and links nothing). Feed it the rmw and rcutils include dirs via CMAKE_REQUIRED_INCLUDES instead of linking the targets — no imported target is linked, so no C compile-feature is pulled into the CXX scratch project. (rmw/init_options.h transitively includes rcutils/allocator.h, hence both include dirs.)

Verified

  • Local clean build on jazzy (rmw 7.3.3, field present): probe correctly detects it → -DRMW_HAS_LOCALHOST_ONLY=1, builds clean with 0 warnings.
  • Field presence by distro: jazzy 7.3.3 has localhost_only; kilted 7.8.2 and rolling 7.10.1 do not (removed at rmw 7.8) — the probe resolves correctly on each.

Independent of the audit-fix PRs (#4–#9); fixes Rolling CI for all of them once merged.

@benaliabderrahmane
benaliabderrahmane merged commit 2ed0026 into main Jun 3, 2026
3 checks passed
@benaliabderrahmane
benaliabderrahmane deleted the fix/rolling-cmake-probe branch June 17, 2026 08:47
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.

1 participant