-
-
Notifications
You must be signed in to change notification settings - Fork 349
V3 feat/win #999
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
V3 feat/win #999
Conversation
…ing extraction logic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds comprehensive Windows platform support to the StaticPHP codebase, implementing Windows-specific build toolchain, executors, and utilities.
Key Changes:
- Refactored PHP target package code into OS-specific traits (unix.php, windows.php)
- Implemented Windows build toolchain with MSVC support and Visual Studio detection via vswhere
- Added WindowsCMakeExecutor for building libraries on Windows
- Enhanced shell execution layer to support Windows-specific commands with proper environment and working directory handling
- Added Windows-specific doctor checks and artifact extraction logic
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| src/Package/Target/php.php | Refactored to use unix and windows traits, removing OS-specific code |
| src/Package/Target/php/unix.php | Extracted Unix-specific PHP build logic into separate trait |
| src/Package/Target/php/windows.php | New Windows-specific PHP build logic with MSVC toolchain support |
| src/StaticPHP/Util/System/WindowsUtil.php | Updated Visual Studio detection to use vswhere.exe with JSON parsing |
| src/StaticPHP/Runtime/Executor/WindowsCMakeExecutor.php | New CMake executor for Windows library builds |
| src/StaticPHP/Toolchain/MSVCToolchain.php | Implemented MSVC toolchain with vcvarsall.bat integration |
| src/StaticPHP/Runtime/Shell/WindowsCmd.php | Simplified by removing duplicate passthru method, now uses parent implementation |
| src/StaticPHP/Runtime/Shell/UnixShell.php | Updated to pass cwd parameter to passthru |
| src/StaticPHP/Runtime/Shell/Shell.php | Enhanced passthru to accept cwd and env parameters for proc_open |
| src/StaticPHP/Runtime/Shell/DefaultShell.php | Updated archive extraction with match expressions and Windows tar support |
| src/StaticPHP/Registry/PackageLoader.php | Added OS-specific stage validation logic |
| src/StaticPHP/Package/Package.php | Added hasBuildFunctionForCurrentOS method |
| src/StaticPHP/Util/SourcePatcher.php | Added patchPhpSrc method for Windows micro patches |
| src/StaticPHP/Util/FileSystem.php | Enhanced with Windows file removal fallback and class existence check |
| src/StaticPHP/Util/GlobalEnvManager.php | Added Windows PATH manipulation support |
| src/StaticPHP/Package/PackageBuilder.php | Moved toolchain init to PackageInstaller, added Windows UPX and debug info handling |
| src/StaticPHP/Package/PackageInstaller.php | Calls GlobalEnvManager::afterInit() before build |
| src/StaticPHP/Doctor/Item/WindowsToolCheck.php | New doctor checks for Windows tools (VS, perl, nasm, SDK) |
| src/StaticPHP/Artifact/ArtifactExtractor.php | Added file extraction support and Windows-specific extraction logic |
| src/StaticPHP/Artifact/Artifact.php | Enhanced to detect single file vs directory extraction |
| src/StaticPHP/Artifact/Downloader/DownloadResult.php | Added file cache type and archive detection |
| src/StaticPHP/Command/Dev/EnvCommand.php | New command to display environment variables |
| src/StaticPHP/Command/BaseCommand.php | Changed debug detection to VERBOSITY_DEBUG level |
| src/StaticPHP/Util/InteractiveTerm.php | Added debug logging and log level parameter |
| src/StaticPHP/Exception/ExceptionHandler.php | Pass error level to InteractiveTerm::plain |
| src/StaticPHP/Command/DoctorCommand.php | Skip toolchain check during doctor command |
| src/Package/Library/onig.php | Added Windows CMake build support |
| src/Package/Library/imap.php | Fixed method reference to patchUnixEmbedScripts |
| config/artifact.json | Updated strawberry-perl artifact with extract path |
| config/pkg.target.json | Added vswhere static binary configuration |
| captainhook.json | Updated with Windows-style paths |
| tests/StaticPHP/Registry/PackageLoaderTest.php | Added test for OS-specific stage validation and whitespace formatting fix |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
What does this PR do?
Checklist before merging
*.phpor*.json, run them locally to ensure your changes are valid:composer cs-fixcomposer analysecomposer testbin/spc dev:sort-configsrc/globals/test-extensions.php.extension testortest extensionsto trigger full test suite.