micro-ROS / rmw_microxrcedds

RMW implementation using Micro XRCE-DDS middleware.
Apache License 2.0
35 stars 27 forks source link

Enforce power-of-two for history setting in CMakeLists #271

Closed gavanderhoorn closed 1 year ago

gavanderhoorn commented 1 year ago

As per subject.

Context: https://github.com/ros2/rmw_fastrtps/issues/644#issuecomment-1315187178 and #270.

This will abort the configuration phase if RMW_UXRCE_STREAM_HISTORY, RMW_UXRCE_STREAM_HISTORY_INPUT or RMW_UXRCE_STREAM_HISTORY_OUTPUT is not a power-of-two:

--- stderr: rmw_microxrcedds
CMake Error at CMakeLists.txt:101 (message):
  STREAM_HISTORY must be a power-of-two (not: 255)

---
Failed   <<< rmw_microxrcedds [0.95s, exited with code 1]
gavanderhoorn commented 1 year ago

Would be even better to (also) check this in uxr_create_output_reliable_stream(..), but this could/should already prevent issues like https://github.com/ros2/rmw_fastrtps/issues/644.

pablogs9 commented 1 year ago

@gavanderhoorn have you confirmed that this was your issue at https://github.com/ros2/rmw_fastrtps/issues/644?

gavanderhoorn commented 1 year ago

No, not yet.

I'll update https://github.com/ros2/rmw_fastrtps/issues/644 when/if I know.

gavanderhoorn commented 1 year ago

Seems the cmake_lint test fails:

test 4
      Start  4: lint_cmake

4: Test command: /usr/bin/python3.10 "-u" "/opt/ros/humble/share/ament_cmake_test/cmake/run_test.py" "/__w/rmw_microxrcedds/rmw_microxrcedds/build/rmw_microxrcedds/test_results/rmw_microxrcedds/lint_cmake.xunit.xml" "--package-name" "rmw_microxrcedds" "--output-file" "/__w/rmw_microxrcedds/rmw_microxrcedds/build/rmw_microxrcedds/ament_lint_cmake/lint_cmake.txt" "--command" "/opt/ros/humble/bin/ament_lint_cmake" "--xunit-file" "/__w/rmw_microxrcedds/rmw_microxrcedds/build/rmw_microxrcedds/test_results/rmw_microxrcedds/lint_cmake.xunit.xml"
4: Test timeout computed to be: 60
4: -- run_test.py: invoking following command in '/__w/rmw_microxrcedds/rmw_microxrcedds/src/rmw-microxrcedds/rmw_microxrcedds_c':
4:  - /opt/ros/humble/bin/ament_lint_cmake --xunit-file /__w/rmw_microxrcedds/rmw_microxrcedds/build/rmw_microxrcedds/test_results/rmw_microxrcedds/lint_cmake.xunit.xml
4: CMakeLists.txt:87: Lines should be <= 140 characters long [linelength]
4: 
4: 
4: 1 errors
4: -- run_test.py: return code 1
4: -- run_test.py: verify result file '/__w/rmw_microxrcedds/rmw_microxrcedds/build/rmw_microxrcedds/test_results/rmw_microxrcedds/lint_cmake.xunit.xml'
 4/17 Test  #4: lint_cmake .......................***Failed    0.16 sec

I'll fix it.

pablogs9 commented 1 year ago

@mergify backport main foxy galactic

mergify[bot] commented 1 year ago

backport main foxy galactic

✅ Backports have been created

* [#272 Enforce power-of-two for history setting in CMakeLists (backport #271)](https://github.com/micro-ROS/rmw_microxrcedds/pull/272) has been created for branch `main` * [#273 Enforce power-of-two for history setting in CMakeLists (backport #271)](https://github.com/micro-ROS/rmw_microxrcedds/pull/273) has been created for branch `foxy` * [#274 Enforce power-of-two for history setting in CMakeLists (backport #271)](https://github.com/micro-ROS/rmw_microxrcedds/pull/274) has been created for branch `galactic`
gavanderhoorn commented 1 year ago

Friendly ping.