fix(windows): consolidate to single canonical strawberry-perl path

Per review: spc's pkg config, doctor, and MSVCToolchain all use
PKG_ROOT_PATH\strawberry-perl. The arch-suffixed strawberry-perl-{arch}-win
path was stale and shouldn't be juggled alongside it. Validate against the
one canonical pkg-root path, falling back to WindowsUtil::findCommand.
This commit is contained in:
Luther Monson
2026-05-27 22:30:04 -07:00
parent 0e8a806640
commit 6c59456c02

View File

@@ -24,13 +24,8 @@ class openssl
{
if (SystemTarget::getTargetOS() === 'Windows') {
global $argv;
$perl_path_native = PKG_ROOT_PATH . '\strawberry-perl-' . arch2gnu(php_uname('m')) . '-win\perl\bin\perl.exe';
$perl_path_doctor = PKG_ROOT_PATH . '\strawberry-perl\perl\bin\perl.exe';
$perl = match (true) {
file_exists($perl_path_native) => $perl_path_native,
file_exists($perl_path_doctor) => $perl_path_doctor,
default => WindowsUtil::findCommand('perl.exe'),
};
$perl_path = PKG_ROOT_PATH . '\strawberry-perl\perl\bin\perl.exe';
$perl = file_exists($perl_path) ? $perl_path : WindowsUtil::findCommand('perl.exe');
if ($perl === null) {
throw new EnvironmentException(
'You need to install perl first!',