Skip to content

Commit c2e7fe5

Browse files
authored
Fix filesystem linking on GCC 8 and add RHEL CI workflow (UniversalRobots#454)
On GCC 8, the <filesystem> implementation is not included in the standard library by default. It must be explicitly linked via: `target_link_libraries(urcl PUBLIC stdc++fs)` Newer GCC versions perform this automatically, which is why the issue only appears on RHEL 8 buildfarm jobs. This PR adds the explicit link dependency for `stdc++fs` in the CMake to ensure the linking for GCC8 To prevent regressions and ensure URCL builds correctly on all supported RHEL toolchains, this PR introduces a new GitHub Actions workflow: - Runs URCL builds inside RHEL containers as in https://github.com.mcas.ms/ros-controls/ros2_control_ci/tree/master?tab=readme-ov-file#ros2_rhel - Covers multiple ROS2 distributions (Humble, Jazzy, Kilted, Rolling). The workflow performs a minimal workspace build using colcon inside the container, matching the RHEL buildfarm configuration.
1 parent 59db585 commit c2e7fe5

2 files changed

Lines changed: 34 additions & 0 deletions

File tree

.github/workflows/rhel_build.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: RHEL Build
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
push:
6+
branches:
7+
- master
8+
jobs:
9+
rhel_build:
10+
name: ${{matrix.ROS_DISTRO.NAME}} (RHEL)
11+
runs-on: ubuntu-latest
12+
container: ghcr.io/ros-controls/ros:${{ matrix.ROS_DISTRO.NAME }}-rhel
13+
env:
14+
path: src/${{ github.repository }}
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
ROS_DISTRO:
19+
- NAME: humble
20+
- NAME: jazzy
21+
- NAME: kilted
22+
- NAME: rolling
23+
24+
steps:
25+
- uses: actions/checkout@v6
26+
with:
27+
path: ${{ env.path }}
28+
- name: Build workspace
29+
shell: bash
30+
run: |
31+
source /opt/ros/${{ matrix.ROS_DISTRO.NAME }}/setup.bash
32+
source /opt/ros2_ws/install/local_setup.bash
33+
colcon build --event-handlers console_direct+ --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ else()
8484
target_compile_options(urcl PUBLIC -fsanitize=address)
8585
target_link_options(urcl PUBLIC -fsanitize=address)
8686
endif()
87+
target_link_libraries(urcl PUBLIC stdc++fs)
8788
endif()
8889

8990
target_include_directories(urcl PUBLIC

0 commit comments

Comments
 (0)