From b55e6761210df654901788ab5436e38dcc0a267e Mon Sep 17 00:00:00 2001 From: DKChan <524912269@qq.com> Date: Tue, 3 Nov 2026 05:23:10 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B7=A5=E7=A8=8B(ci=E8=BF=9C=E7=AB=AF?= =?UTF-8?q?=E5=8C=96=C2=B7=E4=BF=AE=E5=A4=8D):=20Pillow=E7=AC=AC=E5=9B=9B?= =?UTF-8?q?=E8=BD=AE=E6=A0=B9=E5=9B=A0=3Dci-runner=E5=AE=B6=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E4=BB=8E=E6=9C=AA=E5=88=9B=E5=BB=BA(sysadminctl?= =?UTF-8?q?=E5=8F=AA=E7=99=BB=E8=AE=B0=E4=B8=8D=E5=88=9B=E5=BB=BA,?= =?UTF-8?q?=E9=A6=96=E6=AC=A1=E8=BF=90=E8=A1=8C=E8=BE=93=E5=87=BAnot=20cre?= =?UTF-8?q?ated=E5=9C=A8=E6=A1=88=E6=9C=AA=E8=A2=AB=E6=8E=A5=E4=BD=8F)?= =?UTF-8?q?=E2=80=94=E2=80=94=E8=B4=A6=E6=88=B7=E6=AE=B5=E5=90=8E=E8=A1=A5?= =?UTF-8?q?=E5=AE=B6=E7=9B=AE=E5=BD=95=E5=85=9C=E5=BA=95(mkdir+chown+creat?= =?UTF-8?q?ehomedir),=20Pillow=E6=94=B9=E7=B3=BB=E7=BB=9F=E7=BA=A7?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E7=BB=95=E5=BC=80--user=E4=B8=8E=E5=AE=B6?= =?UTF-8?q?=E7=9B=AE=E5=BD=95=E6=97=B6=E5=BA=8F;=20Godot=20wrapper?= =?UTF-8?q?=E5=AE=9E=E6=B5=8B=E5=B7=B2=E9=80=9A=E8=BF=87(4.7.2.stable.offi?= =?UTF-8?q?cial=20rc=3D0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tools/ci/mac_setup.sh | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/tools/ci/mac_setup.sh b/tools/ci/mac_setup.sh index d424e574..ab8ab661 100644 --- a/tools/ci/mac_setup.sh +++ b/tools/ci/mac_setup.sh @@ -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 程序与注册文件就位(复制既有注册身份,免重新注册)──