fix(install): 修复 macOS 两个阻断 bug + 四脚本版本级缓存原子写 - #466
Merged
Conversation
…W_HOME to bash Three fixes to the Windows PowerShell install scripts (install.ps1 and install-atomgit.ps1): 1. Remove UTF-8 BOM from both .ps1 files. Under `irm | iex`, irm does not strip the BOM, and iex treats the 3 BOM bytes as the first chars of a command name, so the first line `#` is parsed as an unknown command and errors (though it does not block the install). Without BOM, both `irm | iex` and local `powershell -File` work fine. 2. Translate all comments from Chinese to English (pure ASCII). Without BOM, Windows PowerShell 5.1 reads the file using the system ANSI code page (GBK on Chinese systems). Chinese comments in UTF-8 get misread as GBK, producing mojibake that cascades into parsing errors. English (ASCII) comments avoid this entirely in any encoding. 3. Explicitly pass OPENCLAW_HOME to bash in Run-SetupCrew (fixes ENOENT). setup-crew.sh uses OPENCLAW_HOME internally to resolve CONFIG_PATH and does NOT read OPENCLAW_STATE_DIR. Previously install.ps1 only set OPENCLAW_STATE_DIR, so setup-crew.sh fell back to $HOME/.openclaw. Under Git Bash's MSYS path conversion plus a Chinese username, this produced a bogus path like C:\c\Users\<garbled>\.openclaw\openclaw.json (ENOENT). Now we explicitly set $env:OPENCLAW_HOME to a forward-slash path before calling bash, and clear it immediately after so subsequent gateway/daemon phases do not inherit it (the engine would nest-append /.openclaw). Co-Authored-By: AtomCode (GLM-5.2) <noreply@atomgit.com>
fix(install): remove BOM, translate comments to English, pass OPENCLA…
## 修复两个阻断 bug 1. pip PEP 668 externally-managed-environment(macOS Homebrew python) - install_python_deps 探测 EXTERNALLY-MANAGED 标记,命中加 --break-system-packages - 兜底:pip 报 externally-managed 退出码 1 时自动重试加 flag - --user 限目标目录,不碰系统 site-packages,安全 2. bash: OPENCLAW_HOME: unbound variable(install_gateway_and_env) - 根因:configure_gateway 里 unset OPENCLAW_HOME 误伤脚本顶部定义的内部变量 - 内部变量本就只赋值未 export,不会传给引擎子进程,unset 纯误伤 - 修法:删掉 unset,保留 warning 提示用户清理 shell 环境 ## 四个安装脚本加版本级缓存 + 原子写 | 脚本 | 路线 | 缓存 | 原子写 | |------|------|------|--------| | install.sh | GitHub tarball | ~/.xiaobei/cache/ | .part → mv -f | | install-atomgit.sh | atomgit tarball | 同上 | 同上 | | install.ps1 | GitHub tarball (Win) | 同上 | .part → Move-Item -Force | | install-atomgit.ps1 | atomgit tarball (Win) | 同上 | 同上 | - 同 tag 重跑命中缓存跳过 120MB 下载 - 原子写:先下 .part 临时文件,成功后 rename 到 cached - 断网不会留半截损坏文件被下次误判为完整缓存 Co-Authored-By: AtomCode (GLM-5.2) <noreply@atomgit.com>
|
codes-factory-of-bg seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
- 移除 login-manager 技能引用,改为通用的"重新登录" - 精简失效平台汇报段落,去掉冗余说明 - wechat-channel 文案微调 Co-Authored-By: AtomCode (GLM-5.2) <noreply@atomgit.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
macOS 上执行一键安装脚本遭遇两个阻断 bug,导致安装未成功完成。同时四个安装脚本(.sh / .ps1 × GitHub / atomgit)缺少版本级 tarball 缓存,重跑会重复下载 120MB。
修复两个阻断 bug
Bug 1: pip
externally-managed-environment(PEP 668)macOS Homebrew python3 是 PEP 668 标记的 externally-managed 环境,
pip install --user仍被拒。修法(
install_python_deps):sysconfig.get_path("include")找 stdlib 目录,检查EXTERNALLY-MANAGED标记文件,命中主动加--break-system-packages--user限目标目录,不碰系统 site-packages,安全Bug 2:
bash: line 1738: OPENCLAW_HOME: unbound variable根因:
install_gateway_and_env里unset OPENCLAW_HOME误伤了脚本顶部定义的内部变量(第 1202 行)。那个内部变量本就只赋值未export,不会传给引擎子进程,unset纯误伤——删掉之后下面${OPENCLAW_HOME//...}在set -u下直接报 unbound 退出。修法:删掉
unset OPENCLAW_HOME,保留 warning 提示用户清理 shell 环境。四脚本加版本级缓存 + 原子写
install.sh~/.xiaobei/cache/.part→mv -finstall-atomgit.shinstall.ps1.part→Move-Item -Forceinstall-atomgit.ps1.part临时文件,成功后 rename 到cached校验
bash -n两个 .sh 语法校验通过备注
此 PR 为修补性质,请暂不要触发 auto release / tarball 重建,合入后我会手动确认 release 流程。