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

Open Beginner friendly
#41 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
Under an hour
Newbie friendliness
92/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
php
Domain
devtools

Research direction

Read hooks/post_install.lua around lines 215–220 and check how the Composer installer is saved before SHA-384 verification. The issue identifies util.write_binary_file as the existing way to preserve the installer’s bytes. Done means the checksum passes and Composer installs on Windows, with verification still enabled.

Written by the indexing model from the issue text.

Description

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.

Dominant language
Lua
Stars
21
Forks
12
Avg merge
3h 16m
Merged PRs (30d)
10

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

  • No Dockerfile or Docker Compose file
  • No pull request template
  • No contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Similar issues

More Lua issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.