Skip to content

Commit ebd8da0

Browse files
committed
distlib 是 QEMU 9.2.4 的属性,不是某个 runner 的 —— 两个宿主上量出来才这么叫
符号链接那条修好了:Windows 的 fetch 现在通过。configure 接着倒在与 macOS 完全 相同的一行上: *** Ouch! *** found no usable distlib, please install it ⚠️ 第一轮我只在 macOS 上修了它,理由是「Homebrew 的 Python 比较特别」。Windows 这 条腿走到同一行,说明它不特别 —— QEMU 的 mkvenv 需要 distlib,而现代 Python 都不 自带。注释按两宿主的事实重写。 MSYS2 侧优先用 pacman 的包、回落到 pip:前者是 MSYS2 用户手里会有的东西,后者保证 这个包被改名时这一步仍然可用。
1 parent 82ae21f commit ebd8da0

1 file changed

Lines changed: 23 additions & 5 deletions

File tree

.github/workflows/build.yml

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -84,16 +84,21 @@ jobs:
8484
if: runner.os == 'macOS'
8585
run: |
8686
brew install ninja meson pkg-config glib pixman
87-
# ⚠️ `distlib`, AND IT IS NOT AN OPTIONAL EXTRA. QEMU's `configure`
88-
# builds a non-isolated virtual environment with its own `mkvenv`
89-
# script, which needs `distlib` to populate it. Homebrew's Python 3.14
90-
# does not carry it, and the failure is a configure-time
87+
# ⚠️ `distlib`, AND IT IS A PROPERTY OF QEMU 9.2.4 RATHER THAN OF THIS
88+
# RUNNER — MEASURED ON TWO HOSTS BEFORE IT WAS CALLED THAT.
89+
#
90+
# QEMU's `configure` builds a non-isolated virtual environment with its
91+
# own `mkvenv` script, which needs `distlib` to populate it. Neither
92+
# Homebrew's Python 3.14 nor MSYS2's carries it, and the failure is a
93+
# configure-time
9194
#
9295
# *** Ouch! ***
9396
# found no usable distlib, please install it
9497
#
9598
# twenty seconds in, which reads like a QEMU problem and is a Python
96-
# packaging one.
99+
# packaging one. The first round fixed it on macOS alone, on the
100+
# reading that Homebrew was unusual; the Windows leg then reached the
101+
# same line and showed it was not.
97102
#
98103
# `--break-system-packages` because Homebrew's Python is
99104
# externally-managed (PEP 668) and refuses otherwise. On a throwaway
@@ -157,6 +162,19 @@ jobs:
157162
# `roms/` stays excluded regardless: it holds firmware SOURCE for machines
158163
# this build does not produce, and `x86_64-softmmu` takes its firmware
159164
# from the prebuilt blobs in `pc-bios/`.
165+
# The same `distlib` gap as macOS, on MSYS2's Python. Preferring the
166+
# packaged form and falling back to pip: pacman's copy is what an MSYS2
167+
# user would have, and pip is what makes the step work if that package is
168+
# ever renamed.
169+
- name: distlib (Windows / MSYS2)
170+
if: runner.os == 'Windows'
171+
shell: msys2 {0}
172+
run: |
173+
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-python-distlib \
174+
|| python3 -m pip install --break-system-packages distlib \
175+
|| python3 -m pip install distlib
176+
python3 -c "import distlib; print('distlib', distlib.__version__)"
177+
160178
- name: Fetch QEMU ${{ env.QEMU_VERSION }} (Windows)
161179
if: runner.os == 'Windows'
162180
shell: msys2 {0}

0 commit comments

Comments
 (0)