Skip to content

Commit 1819961

Browse files
committed
Windows 第六条:失败的是单元测试,不是模拟器;以及 390MB 不是载荷体积
Windows 那条腿现在编到 2032 个目标里的 1897 个,倒在一个**单元测试**上: FAILED: tests/unit/test-vmstate.exe test-vmstate.c:48: undefined reference to `qemu_ftruncate64' 那是 QEMU 自己的可移植性 shim,Windows 构建不提供,而它的测试恰好引用了它 —— 与 模拟器无关。⭐ 改成只构建 qemu-system-x86_64 而不是打补丁,是更小的主张:一次打包 构建没有理由去构建测试套件,而那样做会让整条腿取决于上游的测试这一版是否可移植。 ⚠️ **另一条:前几条绿腿量出的 392M / 389M / 341M / 342M 不是载荷体积,是调试符号。** 本生态为这件事付过一次代价 —— 一个载荷 34.81MB,strip 之后 4.62MB,而此前被归咎于 镜像的上传失败其实是体积。加了 strip 并在前后各报一次。 ⚠️ macOS 不 strip:那会让 ad-hoc 签名失效,这正是本生态发布流水线自己的规则。
1 parent 79ad8a0 commit 1819961

1 file changed

Lines changed: 45 additions & 7 deletions

File tree

.github/workflows/build.yml

Lines changed: 45 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -279,8 +279,26 @@ jobs:
279279
--disable-libssh --disable-spice --disable-smartcard \
280280
--disable-usb-redir --disable-opengl --disable-virglrenderer \
281281
--disable-curl
282-
ninja -j"$(nproc)"
283-
ninja install
282+
# ⚠️ THE EMULATOR TARGET, NOT `ninja` — AND ON THIS HOST THAT IS THE
283+
# DIFFERENCE BETWEEN A BUILD AND A FAILURE.
284+
#
285+
# A bare `ninja` builds QEMU's unit tests too, and one of them does not
286+
# link under MinGW:
287+
#
288+
# FAILED: tests/unit/test-vmstate.exe
289+
# test-vmstate.c:48: undefined reference to `qemu_ftruncate64'
290+
#
291+
# 1897 of 2032 targets had already built. That symbol is a QEMU
292+
# portability shim its own test happens to reference and the Windows
293+
# build does not provide; it says nothing about the emulator, which is
294+
# what this workflow is producing.
295+
#
296+
# ⭐ Naming the target rather than patching the test is the smaller
297+
# claim: a package build has no reason to build a test suite, and
298+
# doing so made the whole leg depend on whether upstream's tests
299+
# happen to be portable this release.
300+
ninja -j"$(nproc)" qemu-system-x86_64
301+
meson install --no-rebuild
284302
285303
# ── The check that the artifact is an emulator, not a file ────────────
286304
#
@@ -373,13 +391,33 @@ jobs:
373391
run: |
374392
set -euo pipefail
375393
QEMU=$(find out -name 'qemu-system-x86_64*' -type f | head -1)
376-
ls -l "$QEMU"
394+
echo "before stripping:"; ls -l "$QEMU"; du -sh out
395+
396+
# ⚠️ STRIPPED, BECAUSE THE UNSTRIPPED FIGURE IS NOT A PAYLOAD SIZE AND
397+
# THE INDEX HAS PAID FOR THAT CONFUSION ONCE ALREADY.
398+
#
399+
# Measured on the first green legs: 392M (linux-x64), 389M
400+
# (linux-arm64), 341M/342M (darwin). Those are debug symbols, not an
401+
# emulator. A previous payload in this ecosystem was 34.81 MB and
402+
# became 4.62 MB once stripped, and the upload failures that had been
403+
# blamed on the mirror were the size.
404+
#
405+
# ⚠️ NOT ON macOS. Stripping a Mach-O invalidates its ad-hoc
406+
# signature, which is the rule this ecosystem's own release pipeline
407+
# follows; the darwin legs report the unstripped figure and say so.
377408
case "$RUNNER_OS" in
378-
Linux) readelf -d "$QEMU" | grep NEEDED || true ;;
379-
macOS) otool -L "$QEMU" || true ;;
380-
Windows) echo "(the DLL closure is measured in the packaging step, not here)" ;;
409+
Linux)
410+
find out -type f \( -name 'qemu-system-*' -o -name '*.so*' \) -exec strip --strip-unneeded {} + 2>/dev/null || true
411+
echo "after stripping:"; ls -l "$QEMU"; du -sh out
412+
readelf -d "$QEMU" | grep NEEDED || true ;;
413+
macOS)
414+
echo "(not stripped: it would invalidate the ad-hoc signature)"
415+
otool -L "$QEMU" || true ;;
416+
Windows)
417+
find out -type f -name '*.exe' -exec strip --strip-unneeded {} + 2>/dev/null || true
418+
echo "after stripping:"; ls -l "$QEMU"; du -sh out
419+
echo "(the DLL closure is measured in the packaging step, not here)" ;;
381420
esac
382-
du -sh out
383421
384422
- uses: actions/upload-artifact@v4
385423
with:

0 commit comments

Comments
 (0)