[moz] fix(ci): lint venv 残留导致 ensurepip 失败 #92
Reference in New Issue
Block a user
Delete Branch "fix/91-ci-lint-ensurepip"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
修复内容
Closes #91
根因
lint job 的 Setup Python step 创建
/tmp/ci-venv-lint后不清理。下次 CI 运行时python3 -m venv在已有目录上执行 upgrade,ensurepip调用/tmp/ci-venv-lint/bin/python3 -Im ensurepip --upgrade --default-pip失败(exit 1)。test job 已有
rm -rf /tmp/ci-venv-test,lint job 缺失同样清理。修复
lint Setup Python 首行加
rm -rf /tmp/ci-venv-lint(1 行改动)。验证
影响范围
审查结论:Approve
风险级别:标准(CI 配置改动)
改动概要
lint job Setup Python 步骤前增加
rm -rf /tmp/ci-venv-lint,清理残留 venv 避免 ensurepip 失败。根因验证
Issue #91 描述:CI lint job 在
python3 -m venv /tmp/ci-venv-lint时ensurepip失败,导致所有 PR 的 CI 全挂。根因是
/tmp/ci-venv-lint残留——CI runner 是共享的 Mac mini,多次 run 之间/tmp不清理,残留的 venv 导致python3 -m venv时 ensurepip 尝试升级已存在的 pip 安装失败。一致性验证
test job(同文件 line 42)已有相同的清理模式:
lint job 修复后与 test job 模式完全一致:
正确性
/tmp/ci-venv-lint(删除路径与创建路径完全匹配)rm -rf对不存在的目录不报错安全性
rm -rf目标是/tmp/ci-venv-lint(CI 临时目录),不影响项目代码或其他数据与 §17 设计文档的关系
这个修复正是 §17 §6.4 描述的场景:CI 失败原因是基础设施问题(runner 环境故障),Issue #91 已正确转交给 jiangwei-infra。本 PR 是姜维的修复。
✅ 确认项:
Approve