Skip to content

Commit 4e0e9ae

Browse files
authored
Pre-build msg packages with micro-ROS typesupport before full build (#820)
Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
1 parent 0f5651c commit 4e0e9ae

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

config/host/generic/build.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,25 @@ set +o nounset
66
. install/local_setup.bash
77
set -o nounset
88

9+
# Pre-build foundational message packages with the workspace microxrcedds type supports
10+
# already in the path. These packages are implicit dependencies of many interface
11+
# packages (added by rosidl's action/service expansion), but are NOT declared in those
12+
# packages' package.xml files. Without pre-building them in the workspace, cmake would
13+
# find the system /opt/ros/jazzy versions (which have no microxrcedds type support) and
14+
# the generated libraries would fail to link.
15+
#
16+
# Build order matters:
17+
# builtin_interfaces - no workspace deps
18+
# unique_identifier_msgs - no workspace deps (UUID.msg only)
19+
# service_msgs - depends on builtin_interfaces (ServiceEventInfo.msg)
20+
# action_msgs - depends on all three above; has CancelGoal.srv
21+
colcon build --packages-select builtin_interfaces unique_identifier_msgs service_msgs action_msgs --metas src --cmake-args -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON $@
22+
23+
# Re-source so the pre-built packages appear in CMAKE_PREFIX_PATH *before* the system
24+
# /opt/ros/jazzy path. This ensures cmake prefers workspace versions (with microxrcedds
25+
# type support) when configuring packages in the full workspace build below.
26+
set +o nounset
27+
. install/local_setup.bash
28+
set -o nounset
29+
930
colcon build --metas src --cmake-args -DBUILD_TESTING=OFF -DBUILD_SHARED_LIBS=ON $@

0 commit comments

Comments
 (0)