工程(ci远端化·修复): Pillow第四轮根因=ci-runner家目录从未创建(sysadminctl只登记不创建,首次运行输出not created在案未被接住)——账户段后补家目录兜底(mkdir+chown+createhomedir), Pillow改系统级安装绕开--user与家目录时序; Godot wrapper实测已通过(4.7.2.stable.official rc=0)

This commit is contained in:
DKChan committed 2026-11-03 05:23:10 +08:00
1 parent 88cdef09aa
commit b55e676121
1 file changed
+15 -6
+15 -6
View File
@@ -57,6 +57,14 @@ else
chmod 600 "$PW_FILE"
log "账户 ${CI_USER} 已创建(密码仅存 ${PW_FILE},root 600,不对外告知)"
fi
# 家目录兜底:sysadminctl 只登记不创建(首次运行输出 "not created!" 在案)——家目录缺失时
# 自动登录与任何以该用户执行的操作都会失败(Pillow --user 失败即此根因)。
if [ ! -d "${CI_HOME}" ]; then
mkdir -p "${CI_HOME}"
chown -R "${CI_USER}:staff" "${CI_HOME}"
createhomedir -c -u "$CI_USER" >/dev/null 2>&1 || true
log "家目录 ${CI_HOME} 已补建"
fi
# ── 2. 自动登录(ci-runner 拥有控制台图形会话——渲染闸的窗口来源)──
_KCP="/etc/kcpassword"
@@ -147,14 +155,15 @@ else
log "gdstyle 已装:/usr/local/bin/gdstyle"
fi
# ── 5. Pillow(渲染闸依赖,装给 ci-runner 用户)──
if sudo -u "$CI_USER" python3 -c "import PIL" >/dev/null 2>&1; then
log "Pillow 已在位(ci-runner),跳过"
# ── 5. Pillow(渲染闸依赖)——系统级安装(/Library/Python,全账户可导入),
# 不用 --user:ci-runner 家目录时序敏感,系统级绕开全部家目录问题 ──
if python3 -c "import PIL" >/dev/null 2>&1; then
log "Pillow 已在位(系统级),跳过"
else
log "为 ci-runner 安装 Pillow(阿里源;-H 修 HOME——sudo -u 默认保留调用者 HOME 会写错缓存目录)"
sudo -H -u "$CI_USER" python3 -m pip install --user pillow \
log "系统级安装 Pillow(阿里源)"
python3 -m pip install pillow \
-i https://mirrors.aliyun.com/pypi/simple/ --quiet \
|| die "Pillow 安装失败"
|| die "Pillow 系统级安装失败"
fi
# ── 6. runner 程序与注册文件就位(复制既有注册身份,免重新注册)──