[v3] - fix(windows): resolve doctor-installed perl and quote perl path#1174
Conversation
Two related fixes for OpenSSL builds on Windows: 1. spc doctor installs Strawberry Perl under `pkgroot/strawberry-perl/`, but the validate() check only looks at the arch-specific native path (`strawberry-perl-x86_64-win`). When a user runs `spc doctor` to install perl, the subsequent build fails because the doctor's install layout isn't on the lookup list. Add it as a fallback before falling through to WindowsUtil::findCommand. 2. Wrap the resolved perl path in quote() when building the Configure command. WindowsUtil::findCommand can return a path containing spaces (e.g. `C:\Program Files\...`), which then splits the cmd.exe invocation. Quoting matches how every other interpolated path in this command is handled.
9bec2ac to
0e8a806
Compare
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.
henderkes
left a comment
There was a problem hiding this comment.
Looks reasonable to me now, but this would also do well with the package api thing I dropped in another PR (on unix only for now, but I think @crazywhalecc wanted to change it to yml declaration, so this would automatically be possible here too). Or it could be added to PATH instead.
Since I'm not looking to take up windows specific maintenance too, I'll delegate to cc here.
|
Looks good so far, but some details need improvement. I'll do some other works and improve some modules for v3 base first though. Let me keep this open. |
# Conflicts: # src/Package/Library/openssl.php
|
StaticPHP Test Bot Detected: Extensions: none | Libraries: |
Two related fixes for OpenSSL builds on Windows:
spc doctor installs Strawberry Perl under
pkgroot/strawberry-perl/, but the validate() check only looks at the arch-specific native path (strawberry-perl-x86_64-win). When a user runsspc doctorto install perl, the subsequent build fails because the doctor's install layout isn't on the lookup list. Add it as a fallback before falling through to WindowsUtil::findCommand.Wrap the resolved perl path in quote() when building the Configure command. WindowsUtil::findCommand can return a path containing spaces (e.g.
C:\Program Files\...), which then splits the cmd.exe invocation. Quoting matches how every other interpolated path in this command is handled.