Open jpsamper2009 opened 6 years ago
Thanks, it looks great and I will have a deeper look.
It is great that you also gave the steps to enable not only python but also OpenSSL to possibly enable secure ROS2. I also have a hacky solution which uses Qemu instead of Docker (but the result should be similar), however your steps looks more clear. I will try to merge both solution and remove (if possible) the hacky parts.
I think that creating the file-system can be considered as a normal step as we need lots of dependencies for python/openssl support.
About the "Cleanup some references to rootfs (i.e. The Hackiest Step)", I was looking at https://stackoverflow.com/questions/38523941/change-cythons-naming-rules-for-so-files but your solution looks simpler.
@filiperinaldi since you just mentioned this topic in the TSC meeting today. Will any of the issues described above be tackled for Crystal?
Hi @dejanpan, yes, that is the goal. Here is the thread @lmayencourt started on Discourse: https://discourse.ros.org/t/ros2-cross-compilation/6834
I've been meaning to create this post for a while since
I have added "Notes:" for the steps where I'm definitely doing something questionable.
For completeness, I have copied the existing documentation and made the necessary changes:
ros2_ws
in home (i.e ~/ros2_ws)Setup the development environment
The normal setup described in the following link is required for the cross-compilation -> https://github.com/ros2/ros2/wiki/Linux-Development-Setup
Get the source
Create a workspace and clone all repos:
Get an aarch64 toolchain and export it
Ignore packages that won't build with Python/Security
The following command disables the build of such packages by adding an empty file called COLCON_IGNORE in their base directory:
Create a target filesystem
Note: This is the first hacky step. Maybe someone has a better idea on how to create this target filesystem.
On an aarch64 machine:
docker build
the imagedocker export
to get a tar-ball with an aarch64 filesystemrootfs
, delete all non-Python, non-OpenSSL filesmake
inrootfs
which were not executable since they were built aarch64 executablesrootfs
and copy it to an x86_64 machineros2_ws
(ie.~/rootfs/
)Trigger a build
--merge-install
-DCMAKE_BUILD_RPATH=...
to workCleanup some references to rootfs (i.e. The Hackiest Step)
for f in ...
) is required becausecython
generates some dynamic libraries and names them based on the architecture of the current machine and not the target architecture_rclpy.cpython-x86_64-linux-gnu.so
, but if you runfile _rclpy.cpython-x86_64-linux-gnu.so
, it saysELF 64-bit LSB shared object, ARM aarch64
rootfs
such that the paths to OpenSSL libraries match the paths on the aarch64 machineRunning Tests
"/home/<your-username>/ros2_ws/
) and copy thesrc
,build
, andinstall
folders.Installation
/opt/ros2/bouncy/
/opt/ros2/bouncy/setup.bash
to use itros2 run
to start nodes