Windows: Composer installer checksum fails because installer is written in text mode

オープン 初心者向け
#41 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
1/5
見積もり時間
1時間未満
初心者へのやさしさ
92/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
php
領域
devtools

調査の方向性

hooks/post_install.lua の215~220行あたりを読み、SHA-384 検証の前に Composer インストーラーがどのように保存されるかを確認してください。Issue では、インストーラーのバイト列を保持する既存の方法として util.write_binary_file が挙げられています。チェックサムが通り、検証を有効にしたまま Windows に Composer がインストールされれば完了です。

索引モデルが 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 -v reported PHP 8.6.0.
  • mise exec -- composer --version reported Composer 2.11.3.

Checksum verification remained enabled.

主要言語
Lua
スター
21
フォーク
12
平均マージ
3時間 16分
マージ済み PR(30日)
10

環境構築

Codespaces で開く

このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。

  • Dockerfile・Docker Compose ファイルなし
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

似ている issue

Lua の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。