Skip to content

fix(windows): pass version arg through to ext install#13

Merged
devhardiyanto merged 1 commit into
mainfrom
fix/ext-install-arg-shift
Jun 15, 2026
Merged

fix(windows): pass version arg through to ext install#13
devhardiyanto merged 1 commit into
mainfrom
fix/ext-install-arg-shift

Conversation

@devhardiyanto

Copy link
Copy Markdown
Owner

Summary

  • phpvm ext install <name> [version] needs four positional args, but the script's param() only declared three. Calling phpvm ext install sqlsrv ended up invoking Install-PECLExt -extName sqlsrv -requestedVer sqlsrv, so the version-probe loop tried URLs like php_sqlsrv-sqlsrv-8.3-nts-vs16-x64.zip and every Test-URLExists returned 404 — surfacing as No compatible package found.
  • Bug was latent in 1.7.0 because the old Test-URLExists failed on the windows.php.net → downloads.php.net 302 redirect, so every probe was false anyway. PR fix(ext): resolve sqlsrv PECL install across Win/Linux/macOS #12 fixed the redirect handling, which exposed this arg-shift bug.
  • Adds a 4th positional `$Arg3` and threads it through `Invoke-Ext` → `Install-PECLExt` so the explicit-version path actually receives the version.
  • Bumps phpvm to 1.7.2.

Test plan

  • Local: `phpvm ext install sqlsrv` against PHP 8.3.31 nts/vs16/x64 → downloads `php_sqlsrv-5.13.1-8.3-nts-vs16-x64.zip`, installs DLL, prints ODBC Driver advisory.
  • Smoke: `phpvm ext install redis 6.1.0` still resolves the explicit version correctly.
  • CI: Windows lint + tests, Linux shellcheck + bats, Version consistency.

…name as version)

`phpvm ext install <name> [version]` needs four positional args
(phpvm, ext, install, name, [version]) but the script's param block
only declared three. As a result `phpvm ext install sqlsrv` was
calling Install-PECLExt with ($extName="sqlsrv", $requestedVer="sqlsrv"),
so the version-probe loop tried URLs like
  php_sqlsrv-sqlsrv-8.3-nts-vs16-x64.zip
and every Test-URLExists returned 404, surfacing as
"No compatible package found".

This bug was latent in 1.7.0 because Test-URLExists was broken in a
way that made every probe false anyway. Once 1.7.1 fixed the redirect
handling the arg-shift bug got exposed.

Adds a fourth positional `$Arg3`, threads it through the ext dispatcher
and Invoke-Ext so the explicit-version path actually receives the
version. Verified end-to-end with `phpvm ext install sqlsrv` against
PHP 8.3 nts/vs16/x64.

Bumps phpvm to 1.7.2.
@devhardiyanto devhardiyanto merged commit 716ce2b into main Jun 15, 2026
3 checks passed
@devhardiyanto devhardiyanto deleted the fix/ext-install-arg-shift branch June 22, 2026 09:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant