From b5e75f156da0892261eb4bc4719f75c04f950b52 Mon Sep 17 00:00:00 2001 From: host Date: Fri, 6 Nov 2026 08:34:14 +0000 Subject: [PATCH] =?UTF-8?q?fix(chv-guest):=20B-17=20Playwright=20=E5=AE=89?= =?UTF-8?q?=E8=A3=85=E5=8A=A0=20--break-system-packages?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 第二轮真机构建实测:单次 virt-customize 在 playwright 步 失败,pip3 install --no-cache-dir playwright 在 Ubuntu 24.04 上报 PEP 668 externally-managed-environment 而拒绝安装; 随后 python3 -m playwright 报 No module named playwright。 此前 PLAYWRIGHT 默认 0,该步从未在默认构建里跑过,缺口 被默认开启暴露出来。 - 修复:playwright 的 pip 安装与第一处 pip 安装同款口径 (--break-system-packages,失败回落无 flag 再试),且只有 pip 成功才跑 python3 -m playwright install --with-deps chromium(括号分组 + &&,失败即停,不再以 ; 带病续跑)。 - 第二轮中间证据:B-10 步已过(sshd -t 完成、99-chv.conf 与 cloud-init hostkey 配置已写入、客机 /etc/ssh 无残留 host key;dpkg/pip freeze 已写 876/92 行)。 --- chv-guest/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/chv-guest/build.sh b/chv-guest/build.sh index 6719d81..3c1fa26 100755 --- a/chv-guest/build.sh +++ b/chv-guest/build.sh @@ -191,7 +191,7 @@ VC_ARGS=(-a "$OUT/disk.raw" --run-command 'dpkg-query -W -f "${Package} ${Version}\n" > /app/guest-versions-dpkg.txt; pip3 freeze > /app/guest-versions-pip.txt || true') if [ "${PLAYWRIGHT:-1}" = "1" ]; then VC_ARGS+=( - --run-command 'pip3 install --no-cache-dir playwright; python3 -m playwright install --with-deps chromium' + --run-command '(pip3 install --no-cache-dir --break-system-packages playwright || pip3 install --no-cache-dir playwright) && python3 -m playwright install --with-deps chromium' --run-command 'dpkg-query -W -f "${Package} ${Version}\n" > /app/guest-versions-dpkg.txt; pip3 freeze > /app/guest-versions-pip.txt || true' --run-command 'ls /root/.cache/ms-playwright/ > /app/guest-versions-chromium.txt 2>/dev/null || true') fi