Skip to content

Commit ac894e6

Browse files
committed
barebone-specific deb creation fix
1 parent 3f090d9 commit ac894e6

2 files changed

Lines changed: 36 additions & 34 deletions

File tree

.github/workflows/create-release-deb.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,20 @@ name: Create Release and .deb Files Project
22

33
on:
44
push:
5-
tags:
6-
- 'v*.*.*'
7-
- 'v*.*.*-rc*'
8-
pull_request:
9-
branches: [ "main" ]
5+
tags:
6+
- 'v*.*.*'
7+
- 'v*.*.*-rc*'
108

119
env:
1210
GNUTLS_CPUID_OVERRIDE: 0x1
1311

14-
1512
jobs:
1613
create-release-ci-cd:
14+
permissions:
15+
contents: write
16+
packages: write
1717
uses: iit-DLSLab/cicd_tools/.github/workflows/create-release-deb.yml@main
1818
with:
1919
package-name: "dls2"
2020
deb-script-path: "scripts/create-deb-deploy.sh"
21+
secrets: inherit

scripts/create-deb-deploy.sh

Lines changed: 29 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@ done
5959
mkdir -p "${ART_DIR}"
6060
rm -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+
6270
run_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
224217
set -e
225218
226219
if 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
229226
fi
230227
231228
if command -v ldconfig >/dev/null 2>&1; then
@@ -255,17 +252,21 @@ EOPOSTINST
255252

256253
echo "[build] building and packaging on host in ${ROOT_DIR}"
257254
if [[ "${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
263259
else
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}
269270
fi
270271

271272
if [[ ! -f "${DEB_PATH}" ]]; then

0 commit comments

Comments
 (0)