From a7184d04115e2dc947fb8659aff5abb03b5a8dfa Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 2 Apr 2026 16:32:43 +0800 Subject: [PATCH 01/12] Fix sqlsrv redundant cflags when building PHP --- src/SPC/builder/extension/sqlsrv.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/SPC/builder/extension/sqlsrv.php b/src/SPC/builder/extension/sqlsrv.php index 04bd5226..3f47134b 100644 --- a/src/SPC/builder/extension/sqlsrv.php +++ b/src/SPC/builder/extension/sqlsrv.php @@ -33,4 +33,14 @@ class sqlsrv extends Extension } return false; } + + public function patchBeforeMake(): bool + { + $makefile = SOURCE_PATH . '\php-src\Makefile'; + $makeContent = file_get_contents($makefile); + $makeContent = preg_replace('/^(CFLAGS_(?:PDO_)?SQLSRV=.*?)\s+\/W4\b/m', '$1', $makeContent); + $makeContent = preg_replace('/^(CFLAGS_(?:PDO_)?SQLSRV=.*?)\s+\/WX\b/m', '$1', $makeContent); + file_put_contents($makefile, $makeContent); + return true; + } } From e592488d7a0d1c5b6a57abb1e9053b4ac29086ea Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 2 Apr 2026 16:34:51 +0800 Subject: [PATCH 02/12] Add test --- src/globals/test-extensions.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index ccc56105..34bc7443 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -24,11 +24,11 @@ $test_php_version = [ // test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available) $test_os = [ // 'macos-15-intel', // bin/spc for x86_64 - 'macos-15', // bin/spc for arm64 - 'ubuntu-latest', // bin/spc-alpine-docker for x86_64 - 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64 + // 'macos-15', // bin/spc for arm64 + // 'ubuntu-latest', // bin/spc-alpine-docker for x86_64 + // 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64 // 'ubuntu-24.04', // bin/spc for x86_64 - 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64 + // 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64 // 'ubuntu-24.04-arm', // bin/spc for arm64 // 'windows-2022', // .\bin\spc.ps1 'windows-2025', @@ -51,7 +51,7 @@ $prefer_pre_built = false; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { 'Linux', 'Darwin' => 'zlib', - 'Windows' => 'gd,zlib,mbstring,filter', + 'Windows' => 'amqp,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,ds,exif,ffi,fileinfo,filter,ftp,gd,iconv,igbinary,libxml,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_sqlite,pdo_sqlsrv,phar,rar,redis,session,shmop,simdjson,simplexml,soap,sockets,sqlite3,sqlsrv,ssh2,sysvshm,tokenizer,xml,xmlreader,xmlwriter,yac,yaml,zip,zlib', }; // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`). From cae668a9472c0e766189ab9ad81ddfc4b3a5a46e Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 2 Apr 2026 17:59:15 +0800 Subject: [PATCH 03/12] Remove zstd suggested libs for v2 (implemented on v3) Anyway we don't support zstd windows build before --- config/lib.json | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/config/lib.json b/config/lib.json index f960ab82..a11a3315 100644 --- a/config/lib.json +++ b/config/lib.json @@ -109,8 +109,7 @@ "krb5" ], "lib-suggests-windows": [ - "brotli", - "zstd" + "brotli" ], "frameworks": [ "CoreFoundation", From 08a6bf38a4424318c4352ebdf23e3be909382115 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Thu, 2 Apr 2026 18:04:03 +0800 Subject: [PATCH 04/12] Remove zstd suggested libs for v2 (implemented on v3) Anyway we don't support zstd windows build before --- config/lib.json | 1 - 1 file changed, 1 deletion(-) diff --git a/config/lib.json b/config/lib.json index a11a3315..33633ad0 100644 --- a/config/lib.json +++ b/config/lib.json @@ -762,7 +762,6 @@ "xz" ], "lib-suggests-windows": [ - "zstd", "openssl" ] }, From 3ded9881e11bc93d946ff9c60f6336259ec67e73 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 3 Apr 2026 09:55:46 +0800 Subject: [PATCH 05/12] Disable openssl for ngtcp2 temporarily --- src/SPC/builder/windows/library/ngtcp2.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SPC/builder/windows/library/ngtcp2.php b/src/SPC/builder/windows/library/ngtcp2.php index d0f557b7..79895dd6 100644 --- a/src/SPC/builder/windows/library/ngtcp2.php +++ b/src/SPC/builder/windows/library/ngtcp2.php @@ -29,6 +29,7 @@ class ngtcp2 extends WindowsLibraryBase '-DBUILD_SHARED_LIBS=OFF ' . '-DENABLE_STATIC_CRT=ON ' . '-DENABLE_LIB_ONLY=ON ' . + '-DENABLE_OPENSSL=OFF ' . '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' ) ->execWithWrapper( From c339b900f892025fd3838c662678eab5580fd9fd Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 3 Apr 2026 11:33:55 +0800 Subject: [PATCH 06/12] Disable simd for libjpeg --- src/SPC/builder/windows/library/libjpeg.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SPC/builder/windows/library/libjpeg.php b/src/SPC/builder/windows/library/libjpeg.php index d7ac718c..0e5a6999 100644 --- a/src/SPC/builder/windows/library/libjpeg.php +++ b/src/SPC/builder/windows/library/libjpeg.php @@ -28,6 +28,7 @@ class libjpeg extends WindowsLibraryBase '-DENABLE_STATIC=ON ' . '-DBUILD_TESTING=OFF ' . '-DWITH_JAVA=OFF ' . + '-DWITH_SIMD=OFF ' . '-DWITH_CRT_DLL=OFF ' . "-DENABLE_ZLIB_COMPRESSION={$zlib} " . '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' From e5ad72214c82e5116e56527a0c054cb6a0354c06 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 3 Apr 2026 14:18:13 +0800 Subject: [PATCH 07/12] Add brotli to curl (just workaround for transitive deps) --- config/ext.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/config/ext.json b/config/ext.json index 79d3831e..16a71c21 100644 --- a/config/ext.json +++ b/config/ext.json @@ -63,7 +63,8 @@ ], "ext-depends-windows": [ "zlib", - "openssl" + "openssl", + "brotli" ] }, "dba": { From 1a476d0e802fc9b4001dd4e1023739fb0e59b2a0 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 3 Apr 2026 15:34:56 +0800 Subject: [PATCH 08/12] Fix xcopy command in FileSystem.php by removing the 'v' flag --- src/SPC/store/FileSystem.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/store/FileSystem.php b/src/SPC/store/FileSystem.php index 1d0815ce..d2d44b51 100644 --- a/src/SPC/store/FileSystem.php +++ b/src/SPC/store/FileSystem.php @@ -152,7 +152,7 @@ class FileSystem $src_path = FileSystem::convertPath($from); switch (PHP_OS_FAMILY) { case 'Windows': - f_passthru('xcopy "' . $src_path . '" "' . $dst_path . '" /s/e/v/y/i'); + f_passthru('xcopy "' . $src_path . '" "' . $dst_path . '" /s/e/y/i'); break; case 'Linux': case 'Darwin': From fb8f8d4ef89bce1c6569cac951e8f8754cb29239 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Fri, 3 Apr 2026 15:49:02 +0800 Subject: [PATCH 09/12] Correct openssl test script condition --- src/globals/ext-tests/openssl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/globals/ext-tests/openssl.php b/src/globals/ext-tests/openssl.php index c687d0fc..34228988 100644 --- a/src/globals/ext-tests/openssl.php +++ b/src/globals/ext-tests/openssl.php @@ -31,6 +31,6 @@ if (file_exists('/etc/ssl/openssl.cnf')) { } assert($valid); } -if (PHP_VERSION_ID >= 80500 && defined('OPENSSL_VERSION_NUMBER') && OPENSSL_VERSION_NUMBER >= 0x30200000) { +if (PHP_VERSION_ID >= 80500 && !PHP_ZTS && defined('OPENSSL_VERSION_NUMBER') && OPENSSL_VERSION_NUMBER >= 0x30200000) { assert(function_exists('openssl_password_hash')); } From cd3eb3d41d2a0f342bc4f0bbbb9bed00fcedab9a Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 3 Apr 2026 19:53:23 +0800 Subject: [PATCH 10/12] Update src/globals/ext-tests/openssl.php --- src/globals/ext-tests/openssl.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/globals/ext-tests/openssl.php b/src/globals/ext-tests/openssl.php index 34228988..11723160 100644 --- a/src/globals/ext-tests/openssl.php +++ b/src/globals/ext-tests/openssl.php @@ -31,6 +31,6 @@ if (file_exists('/etc/ssl/openssl.cnf')) { } assert($valid); } -if (PHP_VERSION_ID >= 80500 && !PHP_ZTS && defined('OPENSSL_VERSION_NUMBER') && OPENSSL_VERSION_NUMBER >= 0x30200000) { +if (PHP_VERSION_ID >= 80500 && (!PHP_ZTS || PHP_OS_FAMILY !== 'Windows') && defined('OPENSSL_VERSION_NUMBER') && OPENSSL_VERSION_NUMBER >= 0x30200000) { assert(function_exists('openssl_password_hash')); } From 0b2b1d51e12f7a590281c2f0b08dba51ba2a6a71 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sat, 4 Apr 2026 18:39:28 +0800 Subject: [PATCH 11/12] Fix file paths for SQLSRV --- src/SPC/builder/extension/sqlsrv.php | 2 +- src/globals/test-extensions.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/SPC/builder/extension/sqlsrv.php b/src/SPC/builder/extension/sqlsrv.php index 3f47134b..fa55b932 100644 --- a/src/SPC/builder/extension/sqlsrv.php +++ b/src/SPC/builder/extension/sqlsrv.php @@ -36,7 +36,7 @@ class sqlsrv extends Extension public function patchBeforeMake(): bool { - $makefile = SOURCE_PATH . '\php-src\Makefile'; + $makefile = SOURCE_PATH . '/php-src/Makefile'; $makeContent = file_get_contents($makefile); $makeContent = preg_replace('/^(CFLAGS_(?:PDO_)?SQLSRV=.*?)\s+\/W4\b/m', '$1', $makeContent); $makeContent = preg_replace('/^(CFLAGS_(?:PDO_)?SQLSRV=.*?)\s+\/WX\b/m', '$1', $makeContent); diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 34bc7443..9f7b90b6 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -27,11 +27,11 @@ $test_os = [ // 'macos-15', // bin/spc for arm64 // 'ubuntu-latest', // bin/spc-alpine-docker for x86_64 // 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64 - // 'ubuntu-24.04', // bin/spc for x86_64 + 'ubuntu-24.04', // bin/spc for x86_64 // 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64 // 'ubuntu-24.04-arm', // bin/spc for arm64 // 'windows-2022', // .\bin\spc.ps1 - 'windows-2025', + // 'windows-2025', ]; // whether enable thread safe @@ -50,7 +50,7 @@ $prefer_pre_built = false; // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). $extensions = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'zlib', + 'Linux', 'Darwin' => 'sqlsrv,pdo_sqlsrv', 'Windows' => 'amqp,apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,ds,exif,ffi,fileinfo,filter,ftp,gd,iconv,igbinary,libxml,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_sqlite,pdo_sqlsrv,phar,rar,redis,session,shmop,simdjson,simplexml,soap,sockets,sqlite3,sqlsrv,ssh2,sysvshm,tokenizer,xml,xmlreader,xmlwriter,yac,yaml,zip,zlib', }; @@ -66,7 +66,7 @@ $with_suggested_libs = true; // If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true. $with_libs = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'libjpeg', + 'Linux', 'Darwin' => '', 'Windows' => '', }; From ddb9e3e7e4a7d736d8d3c6842d9b538140c69b40 Mon Sep 17 00:00:00 2001 From: henderkes Date: Sat, 4 Apr 2026 18:18:22 +0700 Subject: [PATCH 12/12] add framework coreservices to watcher library --- config/lib.json | 3 +++ src/globals/test-extensions.php | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/config/lib.json b/config/lib.json index 33633ad0..4792a932 100644 --- a/config/lib.json +++ b/config/lib.json @@ -998,6 +998,9 @@ ], "headers": [ "wtr/watcher-c.h" + ], + "frameworks": [ + "CoreServices" ] }, "xz": { diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 9f7b90b6..7ae79aca 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -16,18 +16,18 @@ $test_php_version = [ // '8.1', // '8.2', // '8.3', - '8.4', + // '8.4', '8.5', // 'git', ]; // test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available) $test_os = [ - // 'macos-15-intel', // bin/spc for x86_64 - // 'macos-15', // bin/spc for arm64 + 'macos-15-intel', // bin/spc for x86_64 + 'macos-15', // bin/spc for arm64 // 'ubuntu-latest', // bin/spc-alpine-docker for x86_64 // 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64 - 'ubuntu-24.04', // bin/spc for x86_64 + // 'ubuntu-24.04', // bin/spc for x86_64 // 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64 // 'ubuntu-24.04-arm', // bin/spc for arm64 // 'windows-2022', // .\bin\spc.ps1 @@ -43,7 +43,7 @@ $no_strip = false; $upx = false; // whether to test frankenphp build, only available for macOS and linux -$frankenphp = false; +$frankenphp = true; // prefer downloading pre-built packages to speed up the build process $prefer_pre_built = false;