Skip to content

Commit c1bf37b

Browse files
committed
Windows 第四条:被 vendored 的 wheel 因为 file:// 少一个斜杠而够不着
distlib 那条修好了,configure 往前走到: WARNING: Location 'file://D:/a/.../qemu-9.2.4/python/wheels' is ignored: it is neither a file nor a directory. ERROR: No matching distribution found for pycotap==1.3.1 mkvenv was configured to operate offline and did not check PyPI. ⭐ QEMU 把自己的 Python 构建依赖 **vendor 成 wheel** 放在 python/wheels 里,mkvenv 离线从那里装。而 file:// URL 在盘符前需要**三个**斜杠;只有两个时 D: 会被解析成 **主机名** —— 于是 vendored wheel 够不着,又因为离线而没有回落。 ⚠️ 修法不是去补那个斜杠。非隔离虚拟环境能看见系统的包,而 mkvenv 的判据就是「能不能 import」—— 这正是同一台机器上 meson 通过而 pycotap 不通过的原因。预先装上它,与 meson 已经成立的方式一致,且不依赖 QEMU 怎么拼一条路径。 这是 MSYS2 最容易踩的边界:shell 说 /d/a/...,而它自带的 Python 是**原生 Windows** 构建、说 D:/a/...。本生态在 openarch 的 CI 里从另一侧遇到过同一条边界。
1 parent ebd8da0 commit c1bf37b

1 file changed

Lines changed: 33 additions & 2 deletions

File tree

.github/workflows/build.yml

Lines changed: 33 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,14 +166,45 @@ jobs:
166166
# packaged form and falling back to pip: pacman's copy is what an MSYS2
167167
# user would have, and pip is what makes the step work if that package is
168168
# ever renamed.
169-
- name: distlib (Windows / MSYS2)
169+
# ⚠️ TWO PYTHON PACKAGES, AND THE SECOND IS THE SUBTLEST FINDING ON THIS
170+
# LEG.
171+
#
172+
# `distlib` is the same gap macOS had. `pycotap` is different: QEMU
173+
# VENDORS its Python build dependencies as wheels under `python/wheels`
174+
# and `mkvenv` installs from there OFFLINE, never reaching PyPI. On this
175+
# host that directory is handed to pip as
176+
#
177+
# file://D:/a/qemu-x86/qemu-x86/qemu-9.2.4/python/wheels
178+
#
179+
# and pip answers `is ignored: it is neither a file nor a directory` —
180+
# a `file://` URL needs THREE slashes before a drive letter, and with two
181+
# the `D:` is parsed as a HOST. So the vendored wheels are unreachable,
182+
# and because mkvenv is offline there is no fallback:
183+
#
184+
# ERROR: No matching distribution found for pycotap==1.3.1
185+
# mkvenv was configured to operate offline and did not check PyPI.
186+
#
187+
# ⭐ THE FIX IS NOT TO REPAIR THE URL. A non-isolated virtual environment
188+
# sees the system's packages, and `mkvenv`'s own check is "is it
189+
# importable" — which is why `meson` passes on this host and `pycotap`
190+
# does not. Installing it beforehand satisfies the check the same way
191+
# meson already does, and does not depend on how QEMU spells a path.
192+
#
193+
# This is the boundary MSYS2 makes easy to trip over: the shell speaks
194+
# `/d/a/...` and the Python it ships is a NATIVE Windows build that
195+
# speaks `D:/a/...`. This repository met the same boundary from the other
196+
# side in openarch's CI, where `$PWD` in a manifest would have been the
197+
# POSIX form and mcpp wanted the native one.
198+
- name: The Python packages QEMU's mkvenv needs (Windows / MSYS2)
170199
if: runner.os == 'Windows'
171200
shell: msys2 {0}
172201
run: |
173202
pacman -S --noconfirm --needed mingw-w64-ucrt-x86_64-python-distlib \
174203
|| python3 -m pip install --break-system-packages distlib \
175204
|| python3 -m pip install distlib
176-
python3 -c "import distlib; print('distlib', distlib.__version__)"
205+
python3 -m pip install --break-system-packages pycotap \
206+
|| python3 -m pip install pycotap
207+
python3 -c "import distlib, pycotap; print('distlib', distlib.__version__, '/ pycotap ok')"
177208
178209
- name: Fetch QEMU ${{ env.QEMU_VERSION }} (Windows)
179210
if: runner.os == 'Windows'

0 commit comments

Comments
 (0)