Windows: Composer installer checksum fails because installer is written in text mode
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
阅读 hooks/post_install.lua 第 215–220 行附近的内容,并检查 Composer 安装程序在 SHA-384 验证前是如何保存的。Issue 指出,util.write_binary_file 是保留安装程序字节内容的现有方法。校验和通过且 Composer 在 Windows 上成功安装,并且验证仍处于启用状态,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Description
Installing PHP on Windows through mise fails during Composer installation. The PHP archive downloads and extracts successfully, but verification of the Composer installer fails.
Environment
- Windows x64, PowerShell
- mise
2026.11.15 windows-x64 (2026-11-29) - Plugin commit:
aa2922170710cfe4d7277cca4324cf1d38b4efc8 - Requested PHP version:
8.6.0
Steps to reproduce
With the unmodified plugin at the commit above, run:
mise use vfox:version-fox/[email protected]
Actual behavior
Installation aborts with:
The Composer installer does not match the sha384 that Composer publishes;
Composer was not installed.
Expected behavior
The downloaded installer should retain its original bytes, pass SHA-384 verification and install Composer.
Cause and proposed fix
In hooks/post_install.lua, the installer is saved using util.write_file, which opens the file in text mode. On Windows, this converts LF line endings to CRLF and changes the checksum.
The plugin already provides util.write_binary_file, which preserves the downloaded bytes.
- _, err = util.write_file(setup, installer)
+ _, err = util.write_binary_file(setup, installer)
Validation
After applying only this change locally and retrying:
- Composer’s existing SHA-384 verification passed.
- PHP installation completed.
mise exec -- php -vreported PHP8.6.0.mise exec -- composer --versionreported Composer2.11.3.
Checksum verification remained enabled.
- 主要语言
- Lua
- 星标
- 21
- 派生
- 12
- 平均合并
- 3 小时 16 分钟
- 30 天内合并 PR
- 10
环境准备
在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。
- 没有 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
相似的 Issue
-
easy first-contributor first-contributors good first issue help wanted lua up-for-grabs
难度 1/5 1-3 小时 新手友好度 94/100
fork-commit-merge/fork-commit-merge#8750 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 75/100
NaixGames/Polycosmos#81 ·
-
cwc.kbd.xkb_layout/xkb_options changes are not applied to all keyboard groups after reload/runtime未关闭
难度 2/5 1-3 小时 新手友好度 74/100
-
blood of heroes未关闭bug discord triage
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 78/100
stevearc/aerial.nvim#536 ·