Windows: Composer installer checksum fails because installer is written in text mode
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 1/5
- Thời gian dự kiến
- Dưới một giờ
- Mức phù hợp với người mới
- 92/100
Hướng nghiên cứu
Đọc hooks/post_install.lua quanh các dòng 215–220 và kiểm tra cách trình cài đặt Composer được lưu trước khi xác minh SHA-384. Issue chỉ ra util.write_binary_file là cách hiện có để giữ nguyên các byte của trình cài đặt. Công việc hoàn tất khi checksum hợp lệ và Composer được cài đặt trên Windows, với tính năng xác minh vẫn được bật.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- Lua
- Star
- 21
- Fork
- 12
- Merge trung bình
- 3 giờ 16 phút
- Pull request đã merge (30 ngày)
- 10
Chuẩn bị môi trường
Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue tương tự
-
easy first-contributor first-contributors good first issue help wanted lua up-for-grabs
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 94/100
fork-commit-merge/fork-commit-merge#8750 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Typo in yaml templateĐang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 75/100
NaixGames/Polycosmos#81 ·
-
cwc.kbd.xkb_layout/xkb_options changes are not applied to all keyboard groups after reload/runtimeĐang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
-
blood of heroesĐang mởbug discord triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
stevearc/aerial.nvim#536 ·