5959mkdir -p " ${ART_DIR} "
6060rm -f " ${DEB_PATH} " " ${ART_DIR} /pkg_files.txt" " ${BUILD_LOG} "
6161
62+ for required_dir in dls2 robotlib gluecode; do
63+ if [[ ! -f " ${ROOT_DIR} /${required_dir} /CMakeLists.txt" ]]; then
64+ echo " ERROR: missing ${required_dir} /CMakeLists.txt under ${ROOT_DIR} ."
65+ echo " Hint: submodules are not checked out on this runner."
66+ exit 1
67+ fi
68+ done
69+
6270run_pipeline () {
6371 local build_dir=" ${ROOT_DIR} /build"
6472 local stage_dir=" ${ROOT_DIR} /.deb_stage"
@@ -89,19 +97,8 @@ run_pipeline() {
8997 cmake --build " ${build_dir} " -- " ${build_user_args[@]} "
9098 fi
9199
92- # Expected setcap warnings during staged install are tolerated.
93100 DESTDIR=" ${stage_dir} " cmake --install " ${build_dir} "
94101
95- # Ensure robot description assets are packaged when available.
96- if [[ -d " ${ROOT_DIR} /robots/aliengo/aliengo-description" ]]; then
97- mkdir -p " ${stage_dir} /usr/include/aliengo_description"
98- for dir in gazebo launch meshes robcogen robots rviz urdfs yarf foxglove default_postures kinematics; do
99- if [[ -d " ${ROOT_DIR} /robots/aliengo/aliengo-description/${dir} " ]]; then
100- cp -a " ${ROOT_DIR} /robots/aliengo/aliengo-description/${dir} " " ${stage_dir} /usr/include/aliengo_description/"
101- fi
102- done
103- fi
104-
105102 strip " ${stage_dir} /usr/bin/dls2/dynamic_legged_systems_framework" || true
106103 strip " ${stage_dir} /usr/bin/dls2/child_process_launcher" || true
107104 strip " ${stage_dir} /usr/lib/librobotlib.so" || true
@@ -128,7 +125,7 @@ run_pipeline() {
128125 [[ -e " ${target} " ]] || return 0
129126 (ldd " ${target} " 2> /dev/null || true) \
130127 | awk '
131- /=> \// {print $3}
128+ /=> \/ {print $3}
132129 /^\// {print $1}
133130 ' \
134131 | sort -u \
@@ -150,7 +147,6 @@ run_pipeline() {
150147 copy_into_stage " ${lib} "
151148 ;;
152149 * )
153- # Avoid bundling core distro libs from /lib and /usr/lib.
154150 ;;
155151 esac
156152 done
@@ -177,9 +173,6 @@ run_pipeline() {
177173 copy_ldd_closure " ${stage_dir} /usr/bin/dls"
178174 fi
179175
180- # Patch launcher script:
181- # - prioritize packaged runtime paths
182- # - make FastDDS cleanup best-effort
183176 if [[ -f " ${stage_dir} /usr/bin/dls" ]]; then
184177 awk '
185178 NR == 1 {
@@ -224,8 +217,12 @@ EOCONTROL
224217set -e
225218
226219if command -v setcap >/dev/null 2>&1; then
227- setcap cap_sys_nice=eip /usr/bin/dls2/dynamic_legged_systems_framework || true
228- setcap cap_sys_nice=eip /usr/bin/dls2/child_process_launcher || true
220+ if [ -f /usr/bin/dls2/dynamic_legged_systems_framework ]; then
221+ setcap cap_sys_nice=eip /usr/bin/dls2/dynamic_legged_systems_framework || true
222+ fi
223+ if [ -f /usr/bin/dls2/child_process_launcher ]; then
224+ setcap cap_sys_nice=eip /usr/bin/dls2/child_process_launcher || true
225+ fi
229226fi
230227
231228if command -v ldconfig >/dev/null 2>&1; then
@@ -255,17 +252,21 @@ EOPOSTINST
255252
256253echo " [build] building and packaging on host in ${ROOT_DIR} "
257254if [[ " ${LIVE_BUILD_OUTPUT} " == " 1" ]]; then
258- if ! run_pipeline 2>&1 | tee " ${BUILD_LOG} " ; then
259- echo " ERROR: build/package failed. See ${BUILD_LOG} "
260- tail -n 120 " ${BUILD_LOG} " || true
261- exit 1
262- fi
255+ set +e
256+ run_pipeline > >( tee " ${BUILD_LOG} " ) 2>&1
257+ rc=$?
258+ set -e
263259else
264- if ! run_pipeline > " ${BUILD_LOG} " 2>&1 ; then
265- echo " ERROR: build/package failed. See ${BUILD_LOG} "
266- tail -n 120 " ${BUILD_LOG} " || true
267- exit 1
268- fi
260+ set +e
261+ run_pipeline > " ${BUILD_LOG} " 2>&1
262+ rc=$?
263+ set -e
264+ fi
265+
266+ if [[ ${rc} -ne 0 ]]; then
267+ echo " ERROR: build/package failed. See ${BUILD_LOG} "
268+ tail -n 120 " ${BUILD_LOG} " || true
269+ exit ${rc}
269270fi
270271
271272if [[ ! -f " ${DEB_PATH} " ]]; then
0 commit comments