fix(windows): resolve PHP install failures and prevent false CI coverage#65
Conversation
…ting fix: Windows PHP install quoting
fix: os.execute(installCmd)
4feef07 to
98edc0b
Compare
Signed-off-by: Artemeey <artemeey.ru@mail.ru>
fix: os.execute(installCmd)
|
Command |
|
Thanks for working on this! Good catch on The change looks reasonable from my side. I'll also review my gh workflows soon. It's possible I made some assumptions during setup and didn’t fully account for Windows-specific behavior, limitations, or differences from a real Windows environment. |
… into fix-windows-php-install-quoting
InfoWindows 11 mise doctor: AnalyzeSingle quotes break the command when it is executed through Example: Double quotes escapes by os.execute() with Expected: Actual: Понял. Лучше так: ResolveUse temporary bat files for quoted control constructs. |
Fix windows php install quoting
fix: use target PHP path for PIE extensions
Replace the PowerShell-based Windows PHP installer with a Lua implementation that uses shared download, extraction, quoting, and command execution helpers. Move PECL, PIE, and Composer installation logic into a dedicated php_packages module so tools.lua stays focused on reusable filesystem, download, and process utilities. Improve Windows install reliability by quoting PowerShell and cmd arguments explicitly, and verify the install flow under a MISE_DATA_DIR that contains spaces. Extend CI coverage for Windows spaced mise directories and add cache workflow maintenance issues for new PHP major/minor series that may require Windows installer mapping updates.
Move PECL, PIE, PIE extension, and Composer installation into the shared PostInstall flow after the PHP runtime has been installed. This keeps source, Windows, and static PHP installers focused on installing and validating the runtime, while applying the package/tooling post-install policy in one place. Source builds still run cleanup after package installation to preserve the previous install order.
Move shared version comparison, shell quoting, file copying, and static prebuilt option helpers into reusable modules. This reduces duplicated helper logic across source, static, package, and hook code while keeping PHP package installation logic separate from generic tools. Also centralizes Windows PHAR wrapper generation for PIE and Composer without introducing temporary command runner files.
Move the Windows spaced MISE_* directory setup after jdx/mise-action has installed mise. This keeps the regression coverage for plugin installs under paths containing spaces, while avoiding a Windows cross-device rename failure during mise-action setup itself.
|
Error is not displayed: PIE extension no intsalled Current working branch with check status code: https://github.com/Artemeey/mise-php/tree/fix-windows-php-install-quoting-2 Example get status code: https://github.com/Artemeey/mise-php/blob/d28c629261f69518521a751f0a824ad2a735a62c/lib/tools.lua#L76 |
Command:
Error message:
Updated by @rozsazoltan
Resolves #68
Summary
This PR fixes Windows PHP installation failures and improves CI coverage so Windows install regressions are caught reliably.
The original issue was reported with:
mise install php@8.5which failed during the Windows post-install step with:
A previous Windows check appeared green, but the released/latest version still failed in real Windows usage. This PR focuses on making the Windows install path work correctly and ensuring the workflow validates the same behavior users rely on.
Changes
Reworks Windows PHP installation to avoid fragile shell-script based execution.
Uses mise/vfox Lua runtime primitives for download, extraction, file handling, and command execution.
Avoids temporary command runner files.
Keeps only the required Windows runtime wrappers:
pie.batcomposer.batValidates the installed
php.exeafter installation.Fixes Windows path quoting behavior, including paths containing spaces.
Centralizes post-install package setup for PECL, PIE, PIE extensions, and Composer.
Deduplicates shared Lua helper functions.
Improves Windows CI coverage so install checks run under spaced mise paths and validate the actual installed PHP binary.
CI / regression coverage
The Windows workflow now exercises a more realistic install path and checks that the resolved PHP binary comes from the expected mise install directory.
This is intended to prevent misleading CI results where Windows checks pass even though the real Windows installation path is broken.
Notes
The Windows implementation intentionally avoids executing temporary command files. The generated
.batfiles are limited to runtime wrappers required for Windows usage of PIE and Composer.This PR does not build PHP from source on Windows. It installs official PHP Windows ZIP releases and validates the resulting runtime.