Skip to content

Commit 9475c04

Browse files
committed
三条宿主特有的发现,而它们正是先在这里跑的理由
第一轮:linux x64 与 linux arm64 **成功**(x64 那条还引导了 multiboot 探针并断言了 打印),darwin arm64 与 win32 x64 失败,darwin x64 的 runner 一直没排上。 ⚠️ **darwin:。** QEMU 的 configure 用 自带的 mkvenv 建一个非隔离虚拟环境,而 Homebrew 的 Python 3.14 不带 distlib。它在 二十秒时失败,读起来像 QEMU 的问题,实际是 Python 打包的问题。 ⚠️ **win32:解压时创建符号链接失败。** QEMU 的源码包带着 roms/u-boot,里面全是符号 链接;Git Bash 的 tar 在没有权限或开发者模式时创建不了,吐出几百行 tar: qemu-9.2.4/roms/u-boot/include/ctype.h: Cannot create symlink to 'linux/ctype.h' 然后失败。改为在 MSYS2 下解压(它的符号链接模拟默认是复制),并且**直接排除 roms/** —— 那里放的是本次构建不产出的机器的固件源码,x86_64-softmmu 的固件来自 pc-bios/ 里的预编译件。排除它是移除问题而不是绕过问题。 ⭐ 这两条都是「已发布却装不上」的成因,而在这里它们只是两个红叉。
1 parent 3910fea commit 9475c04

1 file changed

Lines changed: 46 additions & 0 deletions

File tree

.github/workflows/build.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,22 @@ jobs:
7878
if: runner.os == 'macOS'
7979
run: |
8080
brew install ninja meson pkg-config glib pixman
81+
# ⚠️ `distlib`, AND IT IS NOT AN OPTIONAL EXTRA. QEMU's `configure`
82+
# builds a non-isolated virtual environment with its own `mkvenv`
83+
# script, which needs `distlib` to populate it. Homebrew's Python 3.14
84+
# does not carry it, and the failure is a configure-time
85+
#
86+
# *** Ouch! ***
87+
# found no usable distlib, please install it
88+
#
89+
# twenty seconds in, which reads like a QEMU problem and is a Python
90+
# packaging one.
91+
#
92+
# `--break-system-packages` because Homebrew's Python is
93+
# externally-managed (PEP 668) and refuses otherwise. On a throwaway
94+
# runner that is the right trade; on a developer's machine it is not,
95+
# which is why it is spelled out rather than hidden in a helper.
96+
python3 -m pip install --break-system-packages distlib
8197
# ⚠️ NOT INSTALLING `qemu` ITSELF. Homebrew's formula would pull a
8298
# working emulator and every check below would pass without this
8399
# workflow having built anything — the shape of false green this
@@ -110,7 +126,37 @@ jobs:
110126
mingw-w64-ucrt-x86_64-pkgconf
111127
mingw-w64-ucrt-x86_64-zlib
112128
129+
# ⚠️ WINDOWS EXTRACTS UNDER MSYS2, AND THE REASON IS SYMLINKS.
130+
#
131+
# QEMU's source tarball carries `roms/u-boot`, which is full of them.
132+
# Git Bash's `tar` cannot create a symlink without the privilege or
133+
# developer mode, and produces hundreds of
134+
#
135+
# tar: qemu-9.2.4/roms/u-boot/include/ctype.h:
136+
# Cannot create symlink to 'linux/ctype.h'
137+
#
138+
# before failing. MSYS2's `tar` copies instead, which is what its symlink
139+
# emulation does by default.
140+
#
141+
# `roms/` is excluded regardless: it holds firmware SOURCE for machines
142+
# this build does not produce, and `x86_64-softmmu` takes its firmware
143+
# from the prebuilt blobs in `pc-bios/`. Excluding it removes the problem
144+
# rather than working around it, and it removes about a third of the
145+
# extraction.
146+
- name: Fetch QEMU ${{ env.QEMU_VERSION }} (Windows)
147+
if: runner.os == 'Windows'
148+
shell: msys2 {0}
149+
run: |
150+
set -euo pipefail
151+
cd "$(cygpath "$GITHUB_WORKSPACE")"
152+
curl -fsSL --retry 5 --retry-all-errors --retry-delay 3 \
153+
-o qemu.tar.xz \
154+
"https://download.qemu.org/qemu-${QEMU_VERSION}.tar.xz"
155+
tar xf qemu.tar.xz --exclude="qemu-${QEMU_VERSION}/roms/*"
156+
test -d "qemu-${QEMU_VERSION}/pc-bios" || { echo "the firmware blobs the build needs are missing"; exit 1; }
157+
113158
- name: Fetch QEMU ${{ env.QEMU_VERSION }}
159+
if: runner.os != 'Windows'
114160
run: |
115161
set -euo pipefail
116162
# ⚠️ `--retry-all-errors`, NOT JUST `--retry`. curl's plain `--retry`

0 commit comments

Comments
 (0)