Skip to content

Commit ca212c9

Browse files
authored
Inject custom vendor packages for Harmonic to avoid Python ABI problems (#840)
Signed-off-by: Jose Luis Rivero <jrivero@honurobotics.com>
1 parent 18f716a commit ca212c9

2 files changed

Lines changed: 66 additions & 3 deletions

File tree

docker/Dockerfile.base

Lines changed: 45 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# Ubuntu 24.04
2-
FROM osrf/ros:jazzy-desktop-full AS vrx-base
1+
# Ubuntu 24.04
2+
FROM ros:jazzy-ros-base AS vrx-base
33

44
# Workaround from https://discourse.ros.org/t/ros-signing-key-migration-guide/43937
55
RUN rm -f /etc/apt/sources.list.d/ros2-latest.list \
@@ -31,9 +31,51 @@ RUN echo $TZ > /etc/timezone && \
3131
RUN curl -s https://packages.osrfoundation.org/gazebo.gpg -o /usr/share/keyrings/pkgs-osrf-archive-keyring.gpg && \
3232
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/pkgs-osrf-archive-keyring.gpg] http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/gazebo-stable.list > /dev/null
3333

34-
# Install some 'standard' ROS packages and utilities.
34+
# Install gz-harmonic
3535
RUN apt update \
3636
&& apt install -y --no-install-recommends \
3737
gz-harmonic \
38+
equivs \
3839
&& rm -rf /var/lib/apt/lists/* \
3940
&& apt clean -qq
41+
42+
# Solution for problem https://github.com/osrf/vrx/issues/839
43+
# Create fake providers for the ROS Gazebo vendor packages of the Gz libraries
44+
# that support Python bindings and use a colcon workspace to inject
45+
# the real ROS packages.
46+
47+
# Create the dummy package control file for ROS Jazzy Gazebo vendor packages
48+
COPY <<EOF /tmp/fake-ros-jazzy-gz-vendor
49+
Package: fake-ros-jazzy-gz-vendor
50+
Version: 999.999
51+
Architecture: all
52+
Description: Fake ROS Jazzy Gazebo vendor packages for containers
53+
This package provides dummy implementations to satisfy
54+
ROS Jazzy Gazebo vendor package dependencies without actual functionality.
55+
Provides: ros-jazzy-gz-math-vendor, ros-jazzy-gz-msgs-vendor, ros-jazzy-gz-transport-vendor, ros-jazzy-gz-sim-vendor, ros-jazzy-sdformat-vendor
56+
EOF
57+
58+
# Build and install the dummy package
59+
RUN cd /tmp \
60+
&& cat fake-ros-jazzy-gz-vendor \
61+
&& equivs-build fake-ros-jazzy-gz-vendor \
62+
&& dpkg -i fake-ros-jazzy-gz-vendor_*_all.deb \
63+
&& rm -f /tmp/fake-ros-jazzy-gz-vendor /tmp/fake-ros-jazzy-gz-vendor_*_all.deb
64+
65+
ADD gz.repos /tmp/gz.repos
66+
67+
RUN mkdir -p /opt/ros_gz_ws/src \
68+
&& cd /opt/ros_gz_ws \
69+
&& vcs import src < /tmp/gz.repos \
70+
&& apt update \
71+
&& rosdep install -r --from-paths . --ignore-src --rosdistro jazzy -y --skip-keys="gz_math_vendor gz_msgs_vendor gz_sim_vendor gz_transport_vendor sdformat_vendor" \
72+
&& . /opt/ros/jazzy/setup.sh \
73+
&& colcon build --merge-install --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release
74+
75+
# Source for interactive shells (both login and non-login)
76+
RUN echo "source /opt/ros_gz_ws/install/setup.bash" > /etc/profile.d/ros_gz_pythons.sh \
77+
&& echo "export GZ_CONFIG_PATH=\$GZ_CONFIG_PATH:/usr/share/gz/" > /etc/profile.d/ros_gz_pythons.sh \
78+
&& chmod +x /etc/profile.d/ros_gz_pythons.sh \
79+
&& echo "source /etc/profile.d/ros_gz_pythons.sh" >> /etc/bash.bashrc
80+
# Source for non-interactive shells
81+
ENV BASH_ENV=/etc/profile.d/ros_gz_pythons.sh

docker/gz.repos

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
repositories:
2+
gz_libs/gz_math_vendor:
3+
type: git
4+
url: https://github.com/gazebo-release/gz_math_vendor.git
5+
version: jazzy
6+
gz_libs/gz_msgs_vendor:
7+
type: git
8+
url: https://github.com/gazebo-release/gz_msgs_vendor.git
9+
version: jazzy
10+
gz_libs/gz_sim_vendor:
11+
type: git
12+
url: https://github.com/gazebo-release/gz_sim_vendor.git
13+
version: jazzy
14+
gz_libs/gz_transport_vendor:
15+
type: git
16+
url: https://github.com/gazebo-release/gz_transport_vendor.git
17+
version: jazzy
18+
gz_libs/sdformat_vendor:
19+
type: git
20+
url: https://github.com/gazebo-release/sdformat_vendor.git
21+
version: jazzy

0 commit comments

Comments
 (0)