Skip to content

fix(rmw_service): build against Rolling's const rmw_send_response (rmw 7.11.4) - #104

Merged
benaliabderrahmane merged 1 commit into
develfrom
fix/rolling-send-response-const
Nov 30, 2026
Merged

benaliabderrahmane merged 1 commit into
develfrom
fix/rolling-send-response-const

Conversation

@benaliabderrahmane

@benaliabderrahmane benaliabderrahmane commented Nov 30, 2026 •

Copy link
Copy Markdown
Owner

Description

The Rolling build farm job Rbin_unv8_uRv8__rmw_unix_socket_cpp__ubuntu_resolute_arm64__binary #2 fails. No source change on our side: it was an automatic rebuild after upstream rmw was re-released.

ros2/rmw#437, released in rmw 7.11.4 (Rolling, 2026-11-30), changed:

rmw_send_response(const rmw_service_t *, rmw_request_id_t *, void * ros_response);        // before
rmw_send_response(const rmw_service_t *, rmw_request_id_t *, const void * ros_response);  // 7.11.4

Our definition in src/rmw_service.cpp is inside extern "C", so it is now a hard error:

src/rmw_service.cpp:232:11: error: conflicting declaration of C function
  'rmw_ret_t rmw_send_response(const rmw_service_t*, rmw_request_id_t*, void*)'
rmw/rmw.h:2435:1: note: previous declaration '... const void*)'

We release one branch to three distros, so the parameter is gated on the installed rmw:

  • CMakeLists.txt: rmw_VERSION >= 7.11.4 sets RMW_SEND_RESPONSE_CONST (same pattern as RMW_HAS_LOCALHOST_ONLY).
  • src/rmw_service.cpp: #ifdef picks const void * or void *. The body is unchanged: it only hands the pointer to shm_serialize_prepare_send, which already takes const void *.
distro rmw signature
jazzy 7.3.4 void *
lyrical 7.10.3 void *
rolling 7.11.4 const void *

The core RMWs (fastrtps, cyclonedds, zenoh, connextdds) changed in lockstep with #437 and are green on the farm again; this package was the first non-core RMW to rebuild against it.

Is this user-facing behavior change?

No. Runtime behaviour is identical; Rolling binaries build again.

How was this tested?

  • Reproduced the farm error by compiling rmw_service.cpp against jazzy headers with rmw.h patched to the 7.11.4 signature: same conflicting declaration of C function.
  • Rolling + rmw 7.11.4 (ros:rolling container, rmw 7.11.4 overlaid from its release tag, --shm-size=2g): builds, RMW_SEND_RESPONSE_CONST=1 is set, service|cross_process tests: 14 passed, 0 failures.
  • Rolling + rmw 7.11.3 (what ros2-testing amd64 serves today): builds, define off.
  • Jazzy (local /opt/ros/jazzy, rmw 7.3.4): configure + build OK, define off.
  • Compiling with the define forced on against the jazzy header fails, so the switch is what selects the signature.

After merge, the farm needs a release (0.6.1, --bump patch) on the rolling track; jazzy and lyrical don't need one.

Did you use Generative AI?

Yes: Claude Code (Claude Opus 5.5) diagnosed the farm failure, wrote the patch and ran the checks above.

Additional Information

rmw_int2dds (same extern "C" + void *) will hit the same error when its queued Rolling job runs. rmw_desert builds only because its definition is not extern "C", so it exports a mangled rmw_send_response instead of the C symbol.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Compatibility
    • Updated Rolling support to match the newer response API. Jazzy and Lyrical behavior remains unchanged.

…w 7.11.4)

ros2/rmw#437, released in rmw 7.11.4 on Rolling, changed the response
parameter of rmw_send_response from `void *` to `const void *`. Our
definition sits in an extern "C" block, so the old signature is now a
"conflicting declaration of C function" and the Rolling build farm job
(Rbin_unv8_uRv8 rmw_unix_socket_cpp #2) fails.

Gate the parameter on rmw_VERSION >= 7.11.4. jazzy (7.3.4) and lyrical
(7.10.3) keep `void *`; the body already passes the pointer to
shm_serialize_prepare_send, which takes `const void *`.
@benaliabderrahmane

Copy link
Copy Markdown
Owner Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

Changes: Response parameter compatibility

Layer / File(s) Summary
Version-gated parameter and changelog
rmw_unix_socket_cpp/CMakeLists.txt, rmw_unix_socket_cpp/src/rmw_service.cpp, rmw_unix_socket_cpp/CHANGELOG.rst
For rmw version 7.11.4 or later, CMake defines RMW_SEND_RESPONSE_CONST, and rmw_send_response uses const void *. Otherwise, it uses void *. The changelog documents this Rolling change and notes that Jazzy and Lyrical are unchanged.

Change: Bug fix

Merge Risk: Minimal · up to b58af

This change lets the package build against the newer rmw header without changing behavior on older distributions. No merge-blocking risk was identified.

Architecture risk: Low · up to b58af

The change affects 1 source area.

When the installed rmw version is 7.11.4 or newer, the build selects a const response parameter so rmw_unix_socket_cpp matches that rmw header; older versions retain the mutable parameter.

Changed areas: rmw_unix_socket_cpp

Review details

Systems and components

  • observed — 3 changed files mapped to rmw_unix_socket_cpp.
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 802db715-d612-452f-b891-0fb29556e5b5
Commits

Reviewing files that changed from the base of the PR and between 26bc3cb and b58af50.

Files selected for processing: 3

  • rmw_unix_socket_cpp/CHANGELOG.rst
  • rmw_unix_socket_cpp/CMakeLists.txt
  • rmw_unix_socket_cpp/src/rmw_service.cpp

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 9 remain after this review.

@coderabbitai

coderabbitai Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@benaliabderrahmane
benaliabderrahmane merged commit 0d03a4f into devel Nov 30, 2026
12 checks passed
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