@@ -315,6 +315,7 @@ jobs:
315315 # carrying a second libc into a process is the two-glibcs shape this
316316 # index's own contract text names as a SIGSEGV source.
317317 if [ "$RUNNER_OS" = "Linux" ]; then
318+ set +e # same reason as the macOS branch below
318319 ldd qemu-system-x86_64 \
319320 | awk '/=> \// {print $3}' \
320321 | grep -vE '/(libc|libm|libdl|librt|libpthread|libresolv|ld-linux[^ ]*)\.so' \
@@ -326,7 +327,19 @@ jobs:
326327 sudo apt-get install -y -qq patchelf
327328 patchelf --set-rpath '$ORIGIN/../lib' ../out/bin/qemu-system-x86_64
328329 for so in ../out/lib/*.so*; do patchelf --set-rpath '$ORIGIN' "$so" 2>/dev/null || true; done
330+ echo "bundled: $(ls -1 ../out/lib 2>/dev/null | wc -l) libraries"
331+ set -e
329332 elif [ "$RUNNER_OS" = "macOS" ]; then
333+ # ⚠️ `set +e` FOR THIS BLOCK, AND THE REASON IS A SILENT KILL.
334+ #
335+ # The first version ran under `set -euo pipefail` and died with exit
336+ # 1 and NO output, right after ninja reported 1564/1564. Every
337+ # command here is in a pipeline ending in `grep`, and a `grep` that
338+ # matches nothing returns 1 — which `pipefail` promotes to the
339+ # pipeline's status and `-e` turns into an exit. A bundling step
340+ # that finds nothing to bundle is not an error; a payload that still
341+ # points outside itself is, and the assertion below is what says so.
342+ set +e
330343 # Mach-O records each dependency by the install name the LIBRARY
331344 # carries, so copying is not enough: every reference has to be
332345 # rewritten, and so does each bundled library's own id.
@@ -350,6 +363,8 @@ jobs:
350363 # binary is killed by the kernel rather than merely warned about.
351364 codesign --force -s - ../out/bin/qemu-system-x86_64 2>/dev/null || true
352365 for dy in ../out/lib/*.dylib; do codesign --force -s - "$dy" 2>/dev/null || true; done
366+ echo "bundled: $(ls -1 ../out/lib 2>/dev/null | wc -l) libraries"
367+ set -e
353368 fi
354369 rmdir ../out/lib 2>/dev/null || true
355370
0 commit comments