Skip to content

feat(windows): replace php-sdk-binary-tools with MSYS2 + 7za-win#1193

Merged
crazywhalecc merged 12 commits into
v3from
feat/replace-phpsdk-with-msys2
Jun 23, 2026
Merged

feat(windows): replace php-sdk-binary-tools with MSYS2 + 7za-win#1193
crazywhalecc merged 12 commits into
v3from
feat/replace-phpsdk-with-msys2

Conversation

@crazywhalecc

@crazywhalecc crazywhalecc commented Jun 21, 2026

Copy link
Copy Markdown
Owner

What does this PR do?

  • Add msys2-build-essentials target: downloads the MSYS2 nightly sfx, extracts it, disables PGP keyring (CI-safe), runs two-pass pacman update, and installs autotools build essentials (make, autoconf, automake, libtool, pkgconf, perl).
  • Add 7za-win target: downloads 7za.exe to PKG_ROOT_PATH\bin.
  • Remove php-sdk-binary-tools target and all PHP_SDK_PATH references; replace with SPC_MSYS2_PATH throughout Artifact, ArtifactExtractor, FileSystem, DefaultShell and MSVCToolchain.
  • Replace {php_sdk_path} path placeholder with {spc_msys2_path}.
  • WindowsToolCheck: replace checkSDK/installSDK with checkMsys2, installMsys2 and check7zaWin/install7zaWin fix items.
  • nasm.yml: extract nasm.exe/ndisasm.exe to {pkg_root_path}/bin.
  • env.ini: rename PHP_SDK_PATH to SPC_MSYS2_PATH.
  • Docs: update Windows migration guide and package-model placeholder docs.

Also:

Checklist before merging

  • If you modified *.php or *.yml, run them locally to ensure your changes are valid:
    • composer cs-fix
    • composer analyse
    • composer test
    • bin/spc dev:lint-config

- Add msys2-build-essentials target: downloads the MSYS2 nightly sfx,
  extracts it, disables PGP keyring (CI-safe), runs two-pass pacman
  update, and installs autotools build essentials (make, autoconf,
  automake, libtool, pkgconf, perl).
- Add 7za-win target: downloads 7za.exe to PKG_ROOT_PATH\bin.
- Remove php-sdk-binary-tools target and all PHP_SDK_PATH references;
  replace with SPC_MSYS2_PATH throughout Artifact, ArtifactExtractor,
  FileSystem, DefaultShell and MSVCToolchain.
- Replace {php_sdk_path} path placeholder with {spc_msys2_path}.
- WindowsToolCheck: replace checkSDK/installSDK with checkMsys2,
  installMsys2 and check7zaWin/install7zaWin fix items.
- nasm.yml: extract nasm.exe/ndisasm.exe to {pkg_root_path}/bin.
- env.ini: rename PHP_SDK_PATH to SPC_MSYS2_PATH.
- Docs: update Windows migration guide and package-model placeholder docs.
@crazywhalecc crazywhalecc added the need-test This PR has not been tested yet, cannot merge now label Jun 21, 2026
@github-actions

github-actions Bot commented Jun 21, 2026

Copy link
Copy Markdown

StaticPHP Test Bot

Detected: Extensions: gmssl | Libraries: gettext, gmp, gmssl, idn2, libiconv, libssh2, libunistring, openssl, readline | Targets: 7za-win, curl, msys2-build-essentials, nasm, php, php-sdk-binary-tools
Active labels: none
Available labels: need-test (gate), test/linux test/windows test/macos (platform), test/tier2 (extra arch), test/php-83 test/php-84 (PHP version)
Config: Linux x86_64 + Windows x86_64 + macOS arm64 | PHP 8.5 NTS

All GNU packages now use ftp.gnu.org (stable canonical server) as the
primary filelist source, with ftpmirror.gnu.org configured as
source-mirror fallback. ftpmirror uses DNS round-robin across many
mirrors of varying reliability; this setup eliminates random CI failures
caused by unreachable mirror nodes while preserving a fallback path.
@crazywhalecc crazywhalecc added the os/windows Things only for Windows label Jun 21, 2026
@crazywhalecc crazywhalecc requested a review from henderkes June 22, 2026 08:59
@henderkes

Copy link
Copy Markdown
Collaborator

I'm not fully familiar with msys2, but wasn't it dev tools and libraries meant for building mingw applications?

@crazywhalecc

Copy link
Copy Markdown
Owner Author

I'm not fully familiar with msys2, but wasn't it dev tools and libraries meant for building mingw applications?

phpsdk-binary-tools uses imcomplete version, it does not have make, autoconf, etc. Yeah it's built for mingw libs and apps, and it will extend our capabilities.

@henderkes

Copy link
Copy Markdown
Collaborator

The thing is that php explicitly doesn't support compiling under mingw, so I'm surprised this even works. Especially with msvc as compiler?

@crazywhalecc

Copy link
Copy Markdown
Owner Author

We are not going to build PHP under mingw. Some libs can and only can be built with mingw. Switching to msys2 does not affect known libraries and PHP builds, but it allows us to build libraries that depend on mingw.

@henderkes

henderkes commented Jun 23, 2026

Copy link
Copy Markdown
Collaborator

But MSVC can't link MinGW built static libraries. I meant it might work for C libraries with a small libc surface, but it will fail for anything else, especially C++. I'm not sure this is a great idea.

Or is this for building binaries other than php?

@crazywhalecc

Copy link
Copy Markdown
Owner Author

My initial plan was to allow us to use autoconf to handle some libraries and then build using MSVC, but my local branch was recently lost (the virtual machine was corrupted), and I forgot what library I was supposed to add over a month ago.

But it does seem like a good option, allowing us to build MinGW things instead of necessarily using MSVC.

@henderkes henderkes left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess as long as we're only using it for the binaries, or to build non-php binaries, it's okay. We need to be careful though not to accidentally leak anything mingw libc related into php though.

@crazywhalecc crazywhalecc merged commit b4ed673 into v3 Jun 23, 2026
11 checks passed
@crazywhalecc crazywhalecc deleted the feat/replace-phpsdk-with-msys2 branch June 23, 2026 06:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

need-test This PR has not been tested yet, cannot merge now os/windows Things only for Windows

Projects

None yet

2 participants