ros2 / rosidl_python

rosidl support for Python
Apache License 2.0
19 stars 45 forks source link

Fix rhel and windows builds #164

Open ivanpauno opened 2 years ago

ivanpauno commented 2 years ago

Fixes:

It undoes most of #160. Instead of making libraries and headers private, it exports FindPython3 dependency correctly. Unfortunately, ament_export_dependencies() doesn't support configuring components, so I have exported it manually using an extra config file.


Old post:

~Nothing should depend on them (they are meant only to be loaded as python extensions).~

~Issue was introduced in https://github.com/ros2/rosidl_python/pull/160.~

~This was causing build issues in rhel https://ci.ros2.org/view/nightly/job/nightly_linux-rhel_release/1139/console#console-section-12.~ ~It didn't cause issues in other platforms as they realize the library they're linking agains isn't being used for anything, so they don't look at the missing symbols.~ ~But rhel linker seems to be more picky.~

ivanpauno commented 2 years ago
ivanpauno commented 2 years ago

Using the NumPy component of FindPython3 introduced an issue in our Windows debug build, I will fix that one separately https://ci.ros2.org/view/nightly/job/nightly_win_deb/2357/console.

clalancette commented 2 years ago

Just as an FYI, before this PR asan builds are also broken (that is, colcon build --mixin asan-gcc fails to link). With this PR, asan builds now work again. I haven't tested @sloretz 's suggestion yet.

ivanpauno commented 2 years ago
ivanpauno commented 2 years ago
ivanpauno commented 2 years ago
wolfv commented 2 years ago

This would be a very useful change for our cross-compiled builds for macOS ARM64 in RoboStack (currently facing an issue with absolute paths to numpy include dir that are exported from here): https://github.com/RoboStack/ros-humble/runs/7052219327?check_suite_focus=true

tobiasneumann commented 9 months ago

What is the status of this PR? As @wolfv said, this package is broken for cross compiling (I think the problem was introduced with 0f43ffc490b7e4ec08022361bced5fa274246dfd) and this might fix it?

clalancette commented 9 months ago

What is the status of this PR?

It's on hiatus at the moment. At the very least it needs to be rebased and retested with the latest, and then it would also need to be reviewed.

As @wolfv said, this package is broken for cross compiling (I think the problem was introduced with 0f43ffc) and this might fix it?

Can you please confirm that it actually does fix it?

tobiasneumann commented 9 months ago

I'm working with meta-ros and there with the humble PR 4, hence I've tested it based on 0.14.4. To avoid conflicts I reapplied https://github.com/ros2/rosidl_python/pull/160 (after it was reverted in the master) and then this PR.

This does not work.

It fails with cmake for rmw-cyclonedds-cpp not been able to find python3-numpy correctly.

Could NOT find Python3 (missing: Python3_NumPy_INCLUDE_DIRS NumPy) (found version "3.10.4")

For context (not directly relevant for this PR), 0.14.4 with https://github.com/ros2/rosidl_python/pull/149 reverted works.