Skip to content

fix: 跨平台提示如何安装 zstd(Windows/Linux 不再只有 brew) - #21

Merged
luwill merged 2 commits into
luwill:mainfrom
yzckiller:fix/zstd-cross-platform-install-hint
Oct 28, 2026
Merged

luwill merged 2 commits into
luwill:mainfrom
yzckiller:fix/zstd-cross-platform-install-hint

Conversation

@yzckiller

Copy link
Copy Markdown

背景

dsh 数据源的会话快照是追加式多帧 zstd 写入,必须用外部 zstd CLI 解压(Node 内置实现只解第一帧)。当系统缺少 zstd 时,旧代码提示 请安装 zstd:brew install zstd,但 brew 仅 macOS 可用,Windows / Linux 用户看到后完全无法落地。

实测:Windows 未装 zstd 时 update-and-resync 因 34 个 dsh 多帧文件解压失败卡在 rescanning,云端统计一直无法重算替换;装好 zstd 后重算 472 个文件、94 天统计完整替换成功。

改动

  • src/zstd.js:新增 zstdInstallHint(),按 process.platform 返回对应安装方式(Windows 给 scoop/choco/官方 zstd.exe;Linux 给 apt/dnf/pacman;macOS 仍是 brew),两处报错改用它。
  • src/doctor.js:健康自检的 zstd 缺失提示改用 zstdInstallHint()。
  • README.zh-CN.md:安装说明补上 Windows / Linux 方式。

验证

  • node --check 两个改动文件均通过;
  • 提示文本在 win32 / darwin / linux 下分别返回对应命令,无平台编译差异。

附带说明(可选后续):ZSTD_BINS 目前只列 unix 绝对路径 + 裸 zstd(依赖 PATH)。若想让「手动下载 zstd.exe 到非 PATH 目录」也能被自动发现,可补充 Windows 常见安装路径。本轮未改,保持最小变更。

WangJun and others added 2 commits October 28, 2026 12:11
dsh 多帧会话必须用外部 zstd CLI 解压,但旧报错/自检只给了 macOS 的 `brew install zstd`,Windows 与 Linux 用户看到后无法落地。
- src/zstd.js: 新增 zstdInstallHint(),按 process.platform 返回对应包管理器命令或官方二进制下载地址
- src/doctor.js: 健康自检的 zstd 缺失提示改用 zstdInstallHint()
- README.zh-CN.md: 安装说明补充 Windows/Linux 的安装方式

实测:Windows 未装 zstd 时 update-and-resync 会因 34 个 dsh 多帧文件解压失败而卡在 rescanning;装好 zstd 后重算正常。
@luwill
luwill merged commit c9f2604 into luwill:main Oct 28, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants