Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix rhel and windows builds #164

Open
wants to merge 5 commits into
base: rolling
Choose a base branch
from

Conversation

ivanpauno
Copy link
Member

@ivanpauno ivanpauno commented May 16, 2022

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 #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.

…hould depend on them (they are meant only to be loaded as python extensions)

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno ivanpauno added the enhancement New feature or request label May 16, 2022
@ivanpauno ivanpauno self-assigned this May 16, 2022
@ivanpauno
Copy link
Member Author

  • rhel Build Status

@ivanpauno
Copy link
Member Author

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.

@ivanpauno ivanpauno added bug Something isn't working and removed enhancement New feature or request labels May 16, 2022
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)

# Export this target so downstream interface packages can depend on it
rosidl_export_typesupport_targets("${rosidl_generator_py_suffix}" "${_target_name_lib}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downstream interface packages depend on them. I'm not 100% sure they have to depend on them though.

target_link_libraries(${_target_name_lib} PRIVATE ${${_pkg_name}_TARGETS${rosidl_generator_py_suffix}})

That's using the special rosidl suffix'd targets variable. How about removing only the ament_export_targets()? That way downstream targets won't accidentally link against them if using pkg_name_TARGETS or ament_target_dependencies().

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downstream interface packages depend on them. I'm not 100% sure they have to depend on them though.

Ah, I see.
I'm pretty sure that's not needed, but let me double check.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downstream interface packages depend on them. I'm not 100% sure they have to depend on them though.

I checked the generated code, and yes a downstream interface package depends on the generated library.

How about removing only the ament_export_targets()? That way downstream targets won't accidentally link against them if using pkg_name_TARGETS or ament_target_dependencies().

Agreed.
I will run CI again to see if it actually fixes the problem, I think it should.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked the generated code, and yes a downstream interface package depends on the generated library.

Based on this, it seems that a bunch of stuff that I moved to PRIVATE in #160 is not correct.
Why I did that is because ament_export_dependencies() doesn't allow you to specify components, so I worked that arround by not having to export anything at all.
But in retrospective that seems incorrect.

I have now exported the dependency of FindPython3 manually, creating a config file.

That's using the special rosidl suffix'd targets variable. How about removing only the ament_export_targets()? That way downstream targets won't accidentally link against them if using pkg_name_TARGETS or ament_target_dependencies().

Unfortunately rosidl_export_typesupport_targets() requires you to also ament_export_targets().
It would be nice if ament_export_targets() had an option to not append the target to pkg_name_TARGETS.
But considering that I have undone most of what I did in #160, I think we don't need to worry about that now.

@clalancette
Copy link
Contributor

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.

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
…s that's needed when messages depend on each other

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Member Author

  • rhel Build Status

Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
Signed-off-by: Ivan Santiago Paunovic <ivanpauno@ekumenlabs.com>
@ivanpauno
Copy link
Member Author

  • rhel Build Status

@ivanpauno
Copy link
Member Author

  • Windows Build Status

@ivanpauno ivanpauno changed the title Don't export the generated libraries as targets anymore Fix rhel and windows builds May 16, 2022
@wolfv
Copy link

wolfv commented Jun 25, 2022

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

@wolfv wolfv mentioned this pull request Jun 26, 2022
11 tasks
@audrow audrow changed the base branch from master to rolling June 28, 2022 14:24
@tobiasneumann
Copy link

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

@clalancette
Copy link
Contributor

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
Copy link

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 #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 #149 reverted works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants