ros-tooling / action-ros-ci

Github Action to build and test ROS 2 packages using colcon
Apache License 2.0
145 stars 53 forks source link

macOS cannot run rclcpp::init in tests #81

Open piraka9011 opened 4 years ago

piraka9011 commented 4 years ago

The ros2_control repo recently added GH actions.

Any of the tests that use rclcpp::init() in the setup fail on macOS with the following stack trace:

unknown file: Failure
  2: C++ exception with description
"failed to initialized rcl init options: failed to find shared library of rmw implementation.
Searched rmw_fastrtps_cpp,
at /Users/runner/runners/2.164.0/work/ros2_control/ros2_control/ros_ws/src/ros2/rmw_implementation/rmw_implementation/src/functions.cpp:61,
at /Users/runner/runners/2.164.0/work/ros2_control/ros2_control/ros_ws/src/ros2/rcl/rcl/src/rcl/init_options.c:55"
thrown in SetUpTestCase()

An example stacktrace can be found in the run here.

The error cannot be reproduced locally on both Ubuntu and macOS systems. This seems to be a GH Action specific issue.

thomas-moulard commented 4 years ago

I actually ran into it in the past, but didn't have the bandwidth to actually go and understand/fix the underlying issue.

Karsten1987 commented 4 years ago

Is there any news on this? It's still holding back the use of github actions on repos such as ros2_control, ros2_controllers and diagnostics.

@thomas-moulard if you could give me a few pointers on where to start digging into it, I am happy to help here.

thomas-moulard commented 4 years ago

No progress here, unfortunately. A PR would be very much appreciated.

The problem happens here: https://github.com/ros-tooling/action-ros-ci/blob/master/src/action-ros-ci.ts#L252-L256

Somehow, it seems that the environment is not properly setup on OS X, when we invoke colcon test. I'd probably start by adding env && on my fork, open a PR from my fork to my fork, to get the CI running (don't forget to update the TS code by running npm run build, you should modify the TS code in src/, but the JS code in dist/ is what's getting used).

Happy to jump on a call if you have the bandwidth to take a look at it.

piraka9011 commented 4 years ago

I've found this action to be helpful for debugging: mxschmitt/action-tmate