From a323f2a1b269bb88b9c26d8d26906007e2491dc5 Mon Sep 17 00:00:00 2001 From: David Laseca Perez Date: Fri, 21 Aug 2026 16:38:07 +0200 Subject: [PATCH 1/6] Update build and CI Signed-off-by: David Laseca Perez --- .github/workflows/ci.yml | 62 --------- .github/workflows/ubuntu-ci.yml | 172 +++++++++++++++++++++++++ .github/workflows/weekly-ubuntu-ci.yml | 27 ++++ rmw_microxrcedds_c/CMakeLists.txt | 13 +- rmw_microxrcedds_c/test/CMakeLists.txt | 2 +- 5 files changed, 210 insertions(+), 66 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/ubuntu-ci.yml create mode 100644 .github/workflows/weekly-ubuntu-ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index e0ca5128..00000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,62 +0,0 @@ -name: CI rmw_microxrcedds_c - -on: - push: - branches: - - humble - - iron - - rolling - pull_request: - branches: - - '**' - -jobs: - rmw_microxrcedds_ci: - runs-on: ubuntu-latest - container: microros/micro-ros-agent:rolling - - steps: - - uses: actions/checkout@v3 - with: - path: src/rmw-microxrcedds - - - name: Download dependencies - run: | - apt update && apt install -y python3-pip git python3-rosdep python3-colcon-common-extensions curl ros-$ROS_DISTRO-performance-test-fixture gcovr - git clone -b ros2 https://github.com/eProsima/Micro-CDR src/Micro-CDR - git clone -b ros2 https://github.com/eProsima/Micro-XRCE-DDS-Client src/Micro-XRCE-DDS-Client - git clone -b rolling https://github.com/micro-ROS/rosidl_typesupport_microxrcedds src/rosidl_typesupport_microxrcedds - git clone -b rolling https://github.com/ros2/rmw src/rmw - touch src/rosidl_typesupport_microxrcedds/test/COLCON_IGNORE - - # Install coverage tools - . /opt/ros/$ROS_DISTRO/setup.sh - rosdep init && rosdep update - rosdep install --from-paths src -r - - - name: Build - run: . /opt/ros/$ROS_DISTRO/setup.sh && colcon build --symlink-install --cmake-args -DBUILD_SHARED_LIBS=ON -DCMAKE_CXX_FLAGS="-ftest-coverage --coverage -fno-inline -fno-inline-small-functions -fno-default-inline" -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON -DCMAKE_C_FLAGS="-ftest-coverage --coverage -fno-inline -fno-inline-small-functions -fno-default-inline" -DCMAKE_C_OUTPUT_EXTENSION_REPLACE=ON - - - name: Test - run: | - . /opt/ros/$ROS_DISTRO/setup.sh && . /uros_ws/install/local_setup.sh && ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 -d -v4 & - sleep 1 - . /opt/ros/$ROS_DISTRO/setup.sh && . install/local_setup.sh - colcon test --event-handlers console_direct+ --packages-select=rmw_microxrcedds --return-code-on-test-failure - ./build/rmw_microxrcedds/test/test-sizes 2> memanalisys_out - - # - name: Static memory - # continue-on-error: true - # if: github.event_name == 'pull_request' - # uses: machine-learning-apps/pr-comment@master - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - # with: - # path: memanalisys_out - - - name: Coverage - run: | - cd src/rmw-microxrcedds/ - gcovr -x -r . -o coverage.xml ../../build --exclude-unreachable-branches --exclude rmw_microxrcedds_c/test - curl -s https://codecov.io/bash -o codecov.bash && chmod +x codecov.bash - ./codecov.bash -t ${{ secrets.CODECOV_TOKEN }} diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml new file mode 100644 index 00000000..8d785659 --- /dev/null +++ b/.github/workflows/ubuntu-ci.yml @@ -0,0 +1,172 @@ +name: ubuntu CI micro-ROS rmw_microxrcedds + +# The container image is derived from the branch under test, which works because the +# branch names are the distro names: +# - kilted -> microros/micro-ros-agent:kilted +# - lyrical -> microros/micro-ros-agent:lyrical +# - rolling -> microros/micro-ros-agent:rolling +# +# The Agent image is used rather than ros:-ros-base because these tests need a +# live micro-ROS Agent on udp4:8888, which the image already ships under /uros_ws. +# +# Besides push and pull_request, this is callable via workflow_call so a scheduled +# workflow on the default branch can run it once per distro branch. Note that +# `uses: ./.github/workflows/ubuntu-ci.yml` always resolves to the *caller's* copy of +# this file, so the default branch's copy is what runs for every branch it tests; only +# the container image and the checked-out sources follow `inputs.branch`. + +on: + push: + branches: + - kilted + - lyrical + - rolling + pull_request: + branches: + - kilted + - lyrical + - rolling + workflow_call: + inputs: + branch: + description: > + Distro branch to check out and test. Leave unset for push and + pull_request, where the triggering ref is used instead. + type: string + required: false + default: '' + # To enable manual trigger + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ inputs.branch }} + cancel-in-progress: true + +env: + # Single source of truth for what gets tested. + TESTED_PACKAGES: rmw_microxrcedds + # Coverage instrumentation: --coverage/-ftest-coverage emit the .gcno and .gcda files + # gcovr reads, and the -fno-inline flags keep the counts mapped onto the original + # source lines instead of onto inlined copies. + COVERAGE_FLAGS: >- + -ftest-coverage --coverage -fno-inline -fno-inline-small-functions -fno-default-inline + +defaults: + run: + shell: bash + +jobs: + rmw_microxrcedds_ci: + runs-on: ubuntu-latest + # inputs.branch is used when this workflow is called + # github.base_ref covers pull requests + # github.ref_name is the branch on a push + container: microros/micro-ros-agent:${{ inputs.branch || github.base_ref || github.ref_name }} + timeout-minutes: 90 + + steps: + - uses: actions/checkout@v5 + with: + # Empty on push and pull_request, which leaves checkout's own behaviour + # intact — importantly the PR merge ref, so PRs keep testing the merge + # result rather than the base branch. + ref: ${{ inputs.branch }} + path: src/rmw-microxrcedds + + - name: Download dependencies + run: | + . /opt/ros/$ROS_DISTRO/setup.bash + + # The image ships no apt lists + apt-get update + # The Agent image is a runtime image: it ships cmake but no compiler and no + # make, so build-essential is required before anything can be built + apt-get install -y \ + build-essential \ + git \ + gcovr \ + python3-colcon-common-extensions \ + python3-rosdep \ + ros-$ROS_DISTRO-performance-test-fixture + + git clone -b v2.0.2 https://github.com/eProsima/Micro-CDR src/Micro-CDR + git clone -b v3.0.1 https://github.com/eProsima/Micro-XRCE-DDS-Client src/Micro-XRCE-DDS-Client + git clone -b $ROS_DISTRO https://github.com/micro-ROS/rosidl_typesupport_microxrcedds src/rosidl_typesupport_microxrcedds + git clone -b $ROS_DISTRO https://github.com/ros2/rmw src/rmw + touch src/rosidl_typesupport_microxrcedds/test/COLCON_IGNORE + + # in case rosdep is not yet initialised + rosdep init 2>/dev/null || true + rosdep update --rosdistro $ROS_DISTRO + rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -r -y + + - name: Build + id: build + # GitHub replaces the image's entrypoint for container jobs, so + # /ros_entrypoint.sh never runs and each step must source ROS itself. + run: | + . /opt/ros/$ROS_DISTRO/setup.bash + colcon build \ + --symlink-install \ + --event-handlers console_direct+ \ + --cmake-args \ + -DBUILD_SHARED_LIBS=ON \ + -DCMAKE_C_FLAGS="$COVERAGE_FLAGS" \ + -DCMAKE_CXX_FLAGS="$COVERAGE_FLAGS" \ + -DCMAKE_C_OUTPUT_EXTENSION_REPLACE=ON \ + -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON + + - name: Test + run: | + . /opt/ros/$ROS_DISTRO/setup.bash + . /uros_ws/install/local_setup.bash + + # The tests establish real XRCE sessions, so an Agent has to be listening + # before colcon test starts. + ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 -d -v4 & + sleep 1 + + . install/local_setup.bash + colcon test \ + --event-handlers console_direct+ \ + --return-code-on-test-failure \ + --packages-select $TESTED_PACKAGES + + - name: Static memory report + # Kept separate from the test step so it still runs when a test fails, + # but needs the build to succeed + if: ${{ !cancelled() && steps.build.outcome == 'success' }} + run: | + . /opt/ros/$ROS_DISTRO/setup.bash + ./build/rmw_microxrcedds/test/test-sizes 2> memanalisys_out + + # - name: Static memory + # continue-on-error: true + # if: github.event_name == 'pull_request' + # uses: machine-learning-apps/pr-comment@master + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # with: + # path: memanalisys_out + + - name: Test results + if: ${{ !cancelled() }} + run: | + . /opt/ros/$ROS_DISTRO/setup.bash + colcon test-result --verbose + + - name: Coverage report + # gcovr has no .gcda files to read if the build never produced any + if: ${{ !cancelled() && steps.build.outcome == 'success' }} + run: | + cd src/rmw-microxrcedds + gcovr -x -r . -o coverage.xml ../../build \ + --exclude-unreachable-branches \ + --exclude rmw_microxrcedds_c/test + + - name: Upload coverage + uses: codecov/codecov-action@v5 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: src/rmw-microxrcedds/coverage.xml + fail_ci_if_error: false diff --git a/.github/workflows/weekly-ubuntu-ci.yml b/.github/workflows/weekly-ubuntu-ci.yml new file mode 100644 index 00000000..86ebcfbc --- /dev/null +++ b/.github/workflows/weekly-ubuntu-ci.yml @@ -0,0 +1,27 @@ +name: Weekly ubuntu CI micro-ROS rmw_microxrcedds + +on: + schedule: + # Mondays at 02:00 UTC + - cron: '0 2 * * 1' + # To enable manual trigger + workflow_dispatch: + +jobs: + ubuntu_ci: + name: ${{ matrix.branch }} + strategy: + # Without this, one distro failing would cancel the others and + # hide if they are fine + fail-fast: false + matrix: + branch: + - kilted + - lyrical + - rolling + uses: ./.github/workflows/ubuntu-ci.yml + with: + branch: ${{ matrix.branch }} + # Reusable workflows do not receive the caller's secrets automatically, and the + # called workflow needs CODECOV_TOKEN for the coverage upload. + secrets: inherit diff --git a/rmw_microxrcedds_c/CMakeLists.txt b/rmw_microxrcedds_c/CMakeLists.txt index e5eff9b5..0780772c 100644 --- a/rmw_microxrcedds_c/CMakeLists.txt +++ b/rmw_microxrcedds_c/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) cmake_policy(SET CMP0057 NEW) set(PACKAGE_VERSION "1.0.0") @@ -20,7 +20,7 @@ project(rmw_microxrcedds VERSION ${PACKAGE_VERSION} LANGUAGES - C + C CXX ) find_package(ament_cmake_ros REQUIRED) @@ -237,6 +237,11 @@ set(SRCS add_library(${PROJECT_NAME} ${SRCS}) +target_compile_options(${PROJECT_NAME} + PRIVATE + -fvisibility=default +) + if(RMW_UXRCE_GRAPH) add_library(micro_ros_msgs_lib SHARED IMPORTED) @@ -286,7 +291,9 @@ target_link_libraries(${PROJECT_NAME} microxrcedds_client ) -configure_rmw_library(${PROJECT_NAME}) +# LANGUAGE C is required: the default (CXX) adds -fvisibility-inlines-hidden, which gcc rejects +# for the C sources this library is built from. +configure_rmw_library(${PROJECT_NAME} LANGUAGE C) target_include_directories(${PROJECT_NAME} PUBLIC diff --git a/rmw_microxrcedds_c/test/CMakeLists.txt b/rmw_microxrcedds_c/test/CMakeLists.txt index 4e3a3eca..0be24fc8 100644 --- a/rmw_microxrcedds_c/test/CMakeLists.txt +++ b/rmw_microxrcedds_c/test/CMakeLists.txt @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -cmake_minimum_required(VERSION 3.5) +cmake_minimum_required(VERSION 3.10) find_package(ament_cmake_gtest REQUIRED) From 74901e875cdbca928f85ca93ba856eda68e03936 Mon Sep 17 00:00:00 2001 From: David Laseca Perez Date: Fri, 21 Aug 2026 17:35:57 +0200 Subject: [PATCH 2/6] Change base image Signed-off-by: David Laseca Perez --- .github/workflows/ubuntu-ci.yml | 54 +++++++++++++++++++++++---------- 1 file changed, 38 insertions(+), 16 deletions(-) diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 8d785659..c08f5ace 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -2,12 +2,15 @@ name: ubuntu CI micro-ROS rmw_microxrcedds # The container image is derived from the branch under test, which works because the # branch names are the distro names: -# - kilted -> microros/micro-ros-agent:kilted -# - lyrical -> microros/micro-ros-agent:lyrical -# - rolling -> microros/micro-ros-agent:rolling +# - kilted -> ros:kilted-ros-base +# - lyrical -> ros:lyrical-ros-base +# - rolling -> ros:rolling-ros-base # -# The Agent image is used rather than ros:-ros-base because these tests need a -# live micro-ROS Agent on udp4:8888, which the image already ships under /uros_ws. +# The plain distro image is used rather than microros/micro-ros-agent: so that +# nothing depends on those Agent tags existing per distro, and so that the whole +# workspace is built from one consistent set of sources. The tests need a live Agent on +# udp4:8888, so microxrcedds_agent and micro_ros_agent are built here: neither is +# released into any ROS distro, so there is no binary to install. # # Besides push and pull_request, this is callable via workflow_call so a scheduled # workflow on the default branch can run it once per distro branch. Note that @@ -61,7 +64,7 @@ jobs: # inputs.branch is used when this workflow is called # github.base_ref covers pull requests # github.ref_name is the branch on a push - container: microros/micro-ros-agent:${{ inputs.branch || github.base_ref || github.ref_name }} + container: ros:${{ inputs.branch || github.base_ref || github.ref_name }}-ros-base timeout-minutes: 90 steps: @@ -79,8 +82,6 @@ jobs: # The image ships no apt lists apt-get update - # The Agent image is a runtime image: it ships cmake but no compiler and no - # make, so build-essential is required before anything can be built apt-get install -y \ build-essential \ git \ @@ -89,16 +90,25 @@ jobs: python3-rosdep \ ros-$ROS_DISTRO-performance-test-fixture + # Micro-CDR and the XRCE Client and Agent are distro independent and pinned; + # the type support and the Agent wrapper track the distro under test. git clone -b v2.0.2 https://github.com/eProsima/Micro-CDR src/Micro-CDR git clone -b v3.0.1 https://github.com/eProsima/Micro-XRCE-DDS-Client src/Micro-XRCE-DDS-Client + git clone -b v3.0.1 https://github.com/eProsima/Micro-XRCE-DDS-Agent src/Micro-XRCE-DDS-Agent + git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro-ROS-Agent src/micro-ROS-Agent git clone -b $ROS_DISTRO https://github.com/micro-ROS/rosidl_typesupport_microxrcedds src/rosidl_typesupport_microxrcedds - git clone -b $ROS_DISTRO https://github.com/ros2/rmw src/rmw touch src/rosidl_typesupport_microxrcedds/test/COLCON_IGNORE + # rmw is taken from the image rather than built from source + # in case rosdep is not yet initialised rosdep init 2>/dev/null || true rosdep update --rosdistro $ROS_DISTRO - rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -r -y + # microxrcedds_agent is declared by micro_ros_agent but is a plain CMake package + # (colcon.pkg, no package.xml), so rosdep cannot see it in the workspace and + # cannot resolve it as a system dependency either. + rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -r -y \ + --skip-keys microxrcedds_agent - name: Build id: build @@ -106,9 +116,13 @@ jobs: # /ros_entrypoint.sh never runs and each step must source ROS itself. run: | . /opt/ros/$ROS_DISTRO/setup.bash + + # The package under test first, so a failure here is reported before the several + # minutes the Agent takes to build. colcon build \ --symlink-install \ --event-handlers console_direct+ \ + --packages-up-to $TESTED_PACKAGES \ --cmake-args \ -DBUILD_SHARED_LIBS=ON \ -DCMAKE_C_FLAGS="$COVERAGE_FLAGS" \ @@ -116,24 +130,32 @@ jobs: -DCMAKE_C_OUTPUT_EXTENSION_REPLACE=ON \ -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON + # The Agent is only test infrastructure, so it is built optimised and without + # coverage instrumentation. microxrcedds_agent picks up fastcdr and fastdds from + # the image through the cmake-args in its colcon.pkg. + colcon build \ + --symlink-install \ + --event-handlers console_direct+ \ + --packages-up-to micro_ros_agent \ + --cmake-args -DCMAKE_BUILD_TYPE=Release + - name: Test run: | . /opt/ros/$ROS_DISTRO/setup.bash - . /uros_ws/install/local_setup.bash + . install/local_setup.bash - # The tests establish real XRCE sessions, so an Agent has to be listening - # before colcon test starts. - ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 -d -v4 & + # The tests establish real XRCE sessions, so an Agent has to be listening before colcon + # test starts. The Agent must not pick up the implementation under test as its own middleware. + RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 -d -v4 & sleep 1 - . install/local_setup.bash colcon test \ --event-handlers console_direct+ \ --return-code-on-test-failure \ --packages-select $TESTED_PACKAGES - name: Static memory report - # Kept separate from the test step so it still runs when a test fails, + # Kept separate from the test step so it still runs when a test fails, # but needs the build to succeed if: ${{ !cancelled() && steps.build.outcome == 'success' }} run: | From 66187ed99a1a1de6a00380a6f14ab83088e72fc4 Mon Sep 17 00:00:00 2001 From: David Laseca Perez Date: Fri, 21 Aug 2026 17:56:01 +0200 Subject: [PATCH 3/6] Fix build in CI Signed-off-by: David Laseca Perez --- .github/workflows/ubuntu-ci.yml | 18 ++++++++++++++++++ rmw_microxrcedds_c/CMakeLists.txt | 11 ++++++----- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index c08f5ace..ceb941bf 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -154,6 +154,24 @@ jobs: --return-code-on-test-failure \ --packages-select $TESTED_PACKAGES + # TEMPORARY: a link failure on rmw_uros_* symbols reproduces here but not in a local + # ros:rolling-desktop container with the same cmake args, so this dumps what the runner + # actually did. Remove once the cause is known. + - name: Diagnose build failure + if: failure() + run: | + echo "=== cmake / gcc ===" + cmake --version | head -1 + gcc --version | head -1 + echo "=== library compile flags ===" + grep '^C_FLAGS' build/rmw_microxrcedds/CMakeFiles/rmw_microxrcedds.dir/flags.make || true + echo "=== exported rmw_uros symbols ===" + nm -D --defined-only build/rmw_microxrcedds/librmw_microxrcedds.so | grep rmw_uros || true + echo "=== exported rmw_ symbol count ===" + nm -D --defined-only build/rmw_microxrcedds/librmw_microxrcedds.so | grep -c ' T rmw_' || true + echo "=== test-publisher link line ===" + cat build/rmw_microxrcedds/test/CMakeFiles/test-publisher.dir/link.txt || true + - name: Static memory report # Kept separate from the test step so it still runs when a test fails, # but needs the build to succeed diff --git a/rmw_microxrcedds_c/CMakeLists.txt b/rmw_microxrcedds_c/CMakeLists.txt index 0780772c..82d5c467 100644 --- a/rmw_microxrcedds_c/CMakeLists.txt +++ b/rmw_microxrcedds_c/CMakeLists.txt @@ -237,11 +237,6 @@ set(SRCS add_library(${PROJECT_NAME} ${SRCS}) -target_compile_options(${PROJECT_NAME} - PRIVATE - -fvisibility=default -) - if(RMW_UXRCE_GRAPH) add_library(micro_ros_msgs_lib SHARED IMPORTED) @@ -295,6 +290,12 @@ target_link_libraries(${PROJECT_NAME} # for the C sources this library is built from. configure_rmw_library(${PROJECT_NAME} LANGUAGE C) +# configure_rmw_library() hides every symbol by default, but this package annotates no public +# API, so the whole RMW would become invisible and nothing could link against it. The property +# is cleared instead of appending -fvisibility=default, because that only worked as long as the +# compiler took the last -fvisibility on a command line whose order CMake does not guarantee. +set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "") + target_include_directories(${PROJECT_NAME} PUBLIC $ From d0abb3a7e83ded0ce78b3c0ff398712d7794b7f3 Mon Sep 17 00:00:00 2001 From: David Laseca Perez Date: Fri, 21 Aug 2026 18:08:49 +0200 Subject: [PATCH 4/6] Fix build visibility Signed-off-by: David Laseca Perez --- rmw_microxrcedds_c/CMakeLists.txt | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/rmw_microxrcedds_c/CMakeLists.txt b/rmw_microxrcedds_c/CMakeLists.txt index 82d5c467..d5f021c1 100644 --- a/rmw_microxrcedds_c/CMakeLists.txt +++ b/rmw_microxrcedds_c/CMakeLists.txt @@ -290,11 +290,11 @@ target_link_libraries(${PROJECT_NAME} # for the C sources this library is built from. configure_rmw_library(${PROJECT_NAME} LANGUAGE C) -# configure_rmw_library() hides every symbol by default, but this package annotates no public -# API, so the whole RMW would become invisible and nothing could link against it. The property -# is cleared instead of appending -fvisibility=default, because that only worked as long as the -# compiler took the last -fvisibility on a command line whose order CMake does not guarantee. -set_target_properties(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS "") +# configure_rmw_library() adds -fvisibility=hidden, this must stay *after* configure_rmw_library() +target_compile_options(${PROJECT_NAME} + PRIVATE + -fvisibility=default +) target_include_directories(${PROJECT_NAME} PUBLIC From 0c6a61fbe4a97cd4e888544f4786465b25cf87cf Mon Sep 17 00:00:00 2001 From: David Laseca Perez Date: Fri, 21 Aug 2026 18:43:43 +0200 Subject: [PATCH 5/6] Fix agent build Signed-off-by: David Laseca Perez --- .github/workflows/ubuntu-ci.yml | 28 +++++++--------------------- 1 file changed, 7 insertions(+), 21 deletions(-) diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index ceb941bf..91c88132 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -132,12 +132,15 @@ jobs: # The Agent is only test infrastructure, so it is built optimised and without # coverage instrumentation. microxrcedds_agent picks up fastcdr and fastdds from - # the image through the cmake-args in its colcon.pkg. + # the image through the cmake-args in its colcon.pkg. The logger profile is off + # because spdlog causes build issues and the logger profile is not needed here colcon build \ --symlink-install \ --event-handlers console_direct+ \ --packages-up-to micro_ros_agent \ - --cmake-args -DCMAKE_BUILD_TYPE=Release + --cmake-args \ + -DCMAKE_BUILD_TYPE=Release \ + -DUAGENT_LOGGER_PROFILE=OFF - name: Test run: | @@ -145,7 +148,8 @@ jobs: . install/local_setup.bash # The tests establish real XRCE sessions, so an Agent has to be listening before colcon - # test starts. The Agent must not pick up the implementation under test as its own middleware. + # test starts. The Agent must not pick up the implementation under test as its own + # middleware. -v4 is accepted but inert while UAGENT_LOGGER_PROFILE is off. RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 -d -v4 & sleep 1 @@ -154,24 +158,6 @@ jobs: --return-code-on-test-failure \ --packages-select $TESTED_PACKAGES - # TEMPORARY: a link failure on rmw_uros_* symbols reproduces here but not in a local - # ros:rolling-desktop container with the same cmake args, so this dumps what the runner - # actually did. Remove once the cause is known. - - name: Diagnose build failure - if: failure() - run: | - echo "=== cmake / gcc ===" - cmake --version | head -1 - gcc --version | head -1 - echo "=== library compile flags ===" - grep '^C_FLAGS' build/rmw_microxrcedds/CMakeFiles/rmw_microxrcedds.dir/flags.make || true - echo "=== exported rmw_uros symbols ===" - nm -D --defined-only build/rmw_microxrcedds/librmw_microxrcedds.so | grep rmw_uros || true - echo "=== exported rmw_ symbol count ===" - nm -D --defined-only build/rmw_microxrcedds/librmw_microxrcedds.so | grep -c ' T rmw_' || true - echo "=== test-publisher link line ===" - cat build/rmw_microxrcedds/test/CMakeFiles/test-publisher.dir/link.txt || true - - name: Static memory report # Kept separate from the test step so it still runs when a test fails, # but needs the build to succeed From 9eb03adc6759d0ebdfd34249faa6458db86c10d8 Mon Sep 17 00:00:00 2001 From: David Laseca Perez Date: Fri, 21 Aug 2026 22:54:56 +0200 Subject: [PATCH 6/6] Fix agent build 2 Signed-off-by: David Laseca Perez --- .github/workflows/ubuntu-ci.yml | 42 +++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/ubuntu-ci.yml b/.github/workflows/ubuntu-ci.yml index 91c88132..8898ea63 100644 --- a/.github/workflows/ubuntu-ci.yml +++ b/.github/workflows/ubuntu-ci.yml @@ -6,10 +6,10 @@ name: ubuntu CI micro-ROS rmw_microxrcedds # - lyrical -> ros:lyrical-ros-base # - rolling -> ros:rolling-ros-base # -# The plain distro image is used rather than microros/micro-ros-agent: so that +# The plain distro image is used rather than microros/micro-ROS-Agent: so that # nothing depends on those Agent tags existing per distro, and so that the whole # workspace is built from one consistent set of sources. The tests need a live Agent on -# udp4:8888, so microxrcedds_agent and micro_ros_agent are built here: neither is +# udp4:8888, so microxrcedds_agent and micro-ROS-Agent are built here: neither is # released into any ROS distro, so there is no binary to install. # # Besides push and pull_request, this is callable via workflow_call so a scheduled @@ -90,25 +90,34 @@ jobs: python3-rosdep \ ros-$ROS_DISTRO-performance-test-fixture - # Micro-CDR and the XRCE Client and Agent are distro independent and pinned; + # Micro-CDR and the XRCE Client are distro independent and pinned; # the type support and the Agent wrapper track the distro under test. git clone -b v2.0.2 https://github.com/eProsima/Micro-CDR src/Micro-CDR git clone -b v3.0.1 https://github.com/eProsima/Micro-XRCE-DDS-Client src/Micro-XRCE-DDS-Client - git clone -b v3.0.1 https://github.com/eProsima/Micro-XRCE-DDS-Agent src/Micro-XRCE-DDS-Agent git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro-ROS-Agent src/micro-ROS-Agent git clone -b $ROS_DISTRO https://github.com/micro-ROS/rosidl_typesupport_microxrcedds src/rosidl_typesupport_microxrcedds touch src/rosidl_typesupport_microxrcedds/test/COLCON_IGNORE # rmw is taken from the image rather than built from source + # micro-ROS-Agent runs its own superbuild + # The logger has to be disabled because it causes build issues and is not needed for the tests, + # the superbuild is patched here for that reason + agent_superbuild=src/micro-ROS-Agent/micro_ros_agent/cmake/SuperBuild.cmake + grep -q 'UAGENT_USE_SYSTEM_LOGGER:BOOL' "$agent_superbuild" + sed -i 's|\(-DUAGENT_USE_SYSTEM_LOGGER:BOOL=.*\)|\1\n -DUAGENT_LOGGER_PROFILE:BOOL=OFF|' \ + "$agent_superbuild" + grep -q 'UAGENT_LOGGER_PROFILE:BOOL=OFF' "$agent_superbuild" + # in case rosdep is not yet initialised rosdep init 2>/dev/null || true rosdep update --rosdistro $ROS_DISTRO - # microxrcedds_agent is declared by micro_ros_agent but is a plain CMake package - # (colcon.pkg, no package.xml), so rosdep cannot see it in the workspace and - # cannot resolve it as a system dependency either. - rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -r -y \ - --skip-keys microxrcedds_agent + + # micro-ROS-Agent declares a dependency on microxrcedds_agent, but it, together + # with microxrcedds_client and microcdr, are built from source in this workflow, + # so skip those keys here + rosdep install --from-paths src --ignore-src --rosdistro $ROS_DISTRO -y \ + --skip-keys "microcdr microxrcedds_client microxrcedds_agent" - name: Build id: build @@ -131,25 +140,22 @@ jobs: -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON # The Agent is only test infrastructure, so it is built optimised and without - # coverage instrumentation. microxrcedds_agent picks up fastcdr and fastdds from - # the image through the cmake-args in its colcon.pkg. The logger profile is off - # because spdlog causes build issues and the logger profile is not needed here + # coverage instrumentation. micro-ROS-Agent's superbuild clones and builds the XRCE + # Agent itself, taking fastcdr and fastdds from the image; the logger is disabled by + # the patch applied in the previous step. colcon build \ --symlink-install \ --event-handlers console_direct+ \ --packages-up-to micro_ros_agent \ - --cmake-args \ - -DCMAKE_BUILD_TYPE=Release \ - -DUAGENT_LOGGER_PROFILE=OFF + --cmake-args -DCMAKE_BUILD_TYPE=Release #-DUAGENT_LOGGER_PROFILE=OFF - name: Test run: | . /opt/ros/$ROS_DISTRO/setup.bash . install/local_setup.bash - # The tests establish real XRCE sessions, so an Agent has to be listening before colcon - # test starts. The Agent must not pick up the implementation under test as its own - # middleware. -v4 is accepted but inert while UAGENT_LOGGER_PROFILE is off. + # The tests establish real XRCE sessions, so an Agent has to be running before colcon test starts + # The Agent must not pick up the implementation under test as its own middleware RMW_IMPLEMENTATION=rmw_fastrtps_cpp ros2 run micro_ros_agent micro_ros_agent udp4 --port 8888 -d -v4 & sleep 1