@@ -101,12 +101,27 @@ jobs:
101101 ghcr.io/78/tenbox-build:bullseye-${{ matrix.arch }} \
102102 bash -lc '
103103 set -euo pipefail
104+ # Keep -O3 for runtime, but add -g so we can split debuginfo
105+ # into sibling .debug files before stripping. The .deb still
106+ # ships stripped binaries; the .debug files are uploaded as
107+ # a separate artifact so any future coredump can be
108+ # symbolised offline by matching BuildID.
104109 cmake -B build -G Ninja \
105110 -DCMAKE_BUILD_TYPE=Release \
111+ -DCMAKE_C_FLAGS_RELEASE="-O3 -g -DNDEBUG" \
112+ -DCMAKE_CXX_FLAGS_RELEASE="-O3 -g -DNDEBUG" \
106113 -DTENBOX_STATIC_FFMPEG=ON \
107114 -DTENBOX_STATIC_RUNTIME=ON
108115 cmake --build build --parallel
109- strip build/tenbox build/tenboxd build/tenbox-vm-runtime
116+ cd build
117+ for bin in tenbox tenboxd tenbox-vm-runtime; do
118+ objcopy --only-keep-debug "$bin" "$bin.debug"
119+ strip --strip-debug --strip-unneeded "$bin"
120+ # debuglink stores only basename, so cwd=build keeps the
121+ # embedded reference clean (tenboxd -> tenboxd.debug).
122+ objcopy --add-gnu-debuglink="$bin.debug" "$bin"
123+ chmod 0644 "$bin.debug"
124+ done
110125 '
111126
112127 - name : Build .deb
@@ -115,6 +130,15 @@ jobs:
115130 "${{ matrix.arch }}" \
116131 "${{ steps.ver.outputs.version }}"
117132
133+ - name : Stage debuginfo tarball
134+ run : |
135+ set -euo pipefail
136+ mkdir -p dist
137+ out="dist/tenbox_${{ steps.ver.outputs.version }}_${{ matrix.arch }}-dbgsym.tar.zst"
138+ tar --zstd -cf "$out" -C build \
139+ tenbox.debug tenboxd.debug tenbox-vm-runtime.debug
140+ ( cd dist && sha256sum "$(basename "$out")" > "$(basename "$out").sha256" )
141+
118142 # Sanity-check the deb against Bullseye's dpkg (1.20). The runner
119143 # is Ubuntu 22.04 with dpkg 1.21+, which can read both xz and zstd
120144 # archives, so a deb that secretly slipped to zstd would still
@@ -139,6 +163,8 @@ jobs:
139163 path : |
140164 dist/tenbox_${{ steps.ver.outputs.version }}_${{ matrix.arch }}.deb
141165 dist/tenbox_${{ steps.ver.outputs.version }}_${{ matrix.arch }}.deb.sha256
166+ dist/tenbox_${{ steps.ver.outputs.version }}_${{ matrix.arch }}-dbgsym.tar.zst
167+ dist/tenbox_${{ steps.ver.outputs.version }}_${{ matrix.arch }}-dbgsym.tar.zst.sha256
142168
143169 publish-release :
144170 name : Publish GitHub Release
@@ -186,6 +212,10 @@ jobs:
186212 files : |
187213 dist/tenbox_${{ steps.ver.outputs.version }}_amd64.deb
188214 dist/tenbox_${{ steps.ver.outputs.version }}_amd64.deb.sha256
215+ dist/tenbox_${{ steps.ver.outputs.version }}_amd64-dbgsym.tar.zst
216+ dist/tenbox_${{ steps.ver.outputs.version }}_amd64-dbgsym.tar.zst.sha256
189217 dist/tenbox_${{ steps.ver.outputs.version }}_arm64.deb
190218 dist/tenbox_${{ steps.ver.outputs.version }}_arm64.deb.sha256
219+ dist/tenbox_${{ steps.ver.outputs.version }}_arm64-dbgsym.tar.zst
220+ dist/tenbox_${{ steps.ver.outputs.version }}_arm64-dbgsym.tar.zst.sha256
191221 dist/install-linux.sh
0 commit comments