From ad356b4a230d75f00e119bff6cf8da26084e306e Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Mon, 9 Mar 2026 20:12:14 +0800 Subject: [PATCH 01/34] Fix grpc build --- config/ext.json | 3 +++ src/SPC/builder/extension/grpc.php | 2 ++ src/globals/test-extensions.php | 10 +++++----- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/config/ext.json b/config/ext.json index 4352f2e2..ed1210f3 100644 --- a/config/ext.json +++ b/config/ext.json @@ -255,6 +255,9 @@ "zlib", "openssl", "libcares" + ], + "frameworks": [ + "CoreFoundation" ] }, "iconv": { diff --git a/src/SPC/builder/extension/grpc.php b/src/SPC/builder/extension/grpc.php index 42dcdd5b..86be8d3d 100644 --- a/src/SPC/builder/extension/grpc.php +++ b/src/SPC/builder/extension/grpc.php @@ -33,6 +33,8 @@ class grpc extends Extension 'GRPC_LIBDIR=' . BUILD_LIB_PATH . "\n" . 'LDFLAGS="$LDFLAGS -framework CoreFoundation"' ); } + FileSystem::replaceFileStr("{$this->source_dir}/config.m4", "CFLAGS=\"-std=c11 -g -O2\"\n", ''); + file_put_contents("{$this->source_dir}/php_grpc.h", '#include "src/php/ext/grpc/php_grpc.h"'); return true; } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index ba02e672..bfae094a 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -16,15 +16,15 @@ $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 @@ -35,7 +35,7 @@ $test_os = [ ]; // whether enable thread safe -$zts = true; +$zts = false; $no_strip = false; @@ -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' => 'pgsql', + 'Linux', 'Darwin' => 'grpc', 'Windows' => 'com_dotnet', }; From 16e772e1a802afa52195eff0c36ae157500e095f Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 10 Mar 2026 08:42:17 +0700 Subject: [PATCH 02/34] add back in zig workaround as 0.16.x is not released yet --- src/SPC/builder/traits/UnixSystemUtilTrait.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/SPC/builder/traits/UnixSystemUtilTrait.php b/src/SPC/builder/traits/UnixSystemUtilTrait.php index ff75bf7c..33f824f3 100644 --- a/src/SPC/builder/traits/UnixSystemUtilTrait.php +++ b/src/SPC/builder/traits/UnixSystemUtilTrait.php @@ -72,6 +72,10 @@ trait UnixSystemUtilTrait if (!is_file($symbol_file)) { throw new SPCInternalException("The symbol file {$symbol_file} does not exist, please check if nm command is available."); } + // https://github.com/ziglang/zig/issues/24662 + if (ToolchainManager::getToolchainClass() === ZigToolchain::class) { + return '-Wl,--export-dynamic'; // needs release 0.16, can be removed then + } // macOS/zig if (SPCTarget::getTargetOS() !== 'Linux' || ToolchainManager::getToolchainClass() === ZigToolchain::class) { return "-Wl,-exported_symbols_list,{$symbol_file}"; From b690566b390bef49188e14341e5482aa1c919103 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 10 Mar 2026 08:43:48 +0700 Subject: [PATCH 03/34] simplify rm command --- src/SPC/builder/unix/library/postgresql.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/SPC/builder/unix/library/postgresql.php b/src/SPC/builder/unix/library/postgresql.php index 2ad4f51b..a3aed130 100644 --- a/src/SPC/builder/unix/library/postgresql.php +++ b/src/SPC/builder/unix/library/postgresql.php @@ -93,8 +93,7 @@ trait postgresql // remove dynamic libs shell()->cd($this->source_dir . '/build') - ->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so.*") - ->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so") + ->exec("rm -rf {$this->getBuildRootPath()}/lib/*.so*") ->exec("rm -rf {$this->getBuildRootPath()}/lib/*.dylib"); FileSystem::replaceFileStr("{$this->getLibDir()}/pkgconfig/libpq.pc", '-lldap', '-lldap -llber'); From f93ad27c172119a38d31ca91e9112dcf46d67830 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 10 Mar 2026 08:47:38 +0700 Subject: [PATCH 04/34] allow using some libs as system provided (work around mssql linking vs system openssl) --- config/lib.json | 14 ++++++++++++++ src/SPC/builder/Extension.php | 3 ++- src/SPC/builder/LibraryBase.php | 18 ++++++++++++++++++ 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/config/lib.json b/config/lib.json index ebbf4b87..58cbd4ba 100644 --- a/config/lib.json +++ b/config/lib.json @@ -862,6 +862,9 @@ }, "openssl": { "source": "openssl", + "pkg-configs": [ + "openssl" + ], "static-libs-unix": [ "libssl.a", "libcrypto.a" @@ -974,6 +977,11 @@ }, "unixodbc": { "source": "unixodbc", + "pkg-configs": [ + "odbc", + "odbccr", + "odbcinst" + ], "static-libs-unix": [ "libodbc.a", "libodbccr.a", @@ -1015,6 +1023,9 @@ }, "zlib": { "source": "zlib", + "pkg-configs": [ + "zlib" + ], "static-libs-unix": [ "libz.a" ], @@ -1028,6 +1039,9 @@ }, "zstd": { "source": "zstd", + "pkg-configs": [ + "libzstd" + ], "static-libs-unix": [ "libzstd.a" ], diff --git a/src/SPC/builder/Extension.php b/src/SPC/builder/Extension.php index f5a5d956..9077269e 100644 --- a/src/SPC/builder/Extension.php +++ b/src/SPC/builder/Extension.php @@ -96,7 +96,8 @@ class Extension fn ($x) => $x->getStaticLibFiles(), $this->getLibraryDependencies(recursive: true) ); - return implode(' ', $ret); + $libs = implode(' ', $ret); + return deduplicate_flags($libs); } /** diff --git a/src/SPC/builder/LibraryBase.php b/src/SPC/builder/LibraryBase.php index 383faa41..0cd1c235 100644 --- a/src/SPC/builder/LibraryBase.php +++ b/src/SPC/builder/LibraryBase.php @@ -365,6 +365,24 @@ abstract class LibraryBase protected function isLibraryInstalled(): bool { + if ($pkg_configs = Config::getLib(static::NAME, 'pkg-configs', [])) { + $pkg_config_path = getenv('PKG_CONFIG_PATH') ?: ''; + $search_paths = array_unique(array_filter(explode(is_unix() ? ':' : ';', $pkg_config_path))); + + foreach ($pkg_configs as $name) { + $found = false; + foreach ($search_paths as $path) { + if (file_exists($path . "/{$name}.pc")) { + $found = true; + break; + } + } + if (!$found) { + return false; + } + } + return true; // allow using system dependencies if pkg_config_path is explicitly defined + } foreach (Config::getLib(static::NAME, 'static-libs', []) as $name) { if (!file_exists(BUILD_LIB_PATH . "/{$name}")) { return false; From 2277390a1abbebaf0c388f0773071b3ac4e19fa0 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 10 Mar 2026 08:49:56 +0700 Subject: [PATCH 05/34] fix removeConfigureArgs in UnixAutoconfExecutor.php --- src/SPC/util/executor/UnixAutoconfExecutor.php | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/SPC/util/executor/UnixAutoconfExecutor.php b/src/SPC/util/executor/UnixAutoconfExecutor.php index e04fe4f9..9d57ef4e 100644 --- a/src/SPC/util/executor/UnixAutoconfExecutor.php +++ b/src/SPC/util/executor/UnixAutoconfExecutor.php @@ -16,12 +16,11 @@ class UnixAutoconfExecutor extends Executor protected array $configure_args = []; - protected array $ignore_args = []; - public function __construct(protected BSDLibraryBase|LinuxLibraryBase|MacOSLibraryBase $library) { parent::__construct($library); $this->initShell(); + $this->configure_args = $this->getDefaultConfigureArgs(); } /** @@ -29,19 +28,12 @@ class UnixAutoconfExecutor extends Executor */ public function configure(...$args): static { - // remove all the ignored args - $args = array_merge($args, $this->getDefaultConfigureArgs(), $this->configure_args); - $args = array_diff($args, $this->ignore_args); + $args = array_merge($args, $this->configure_args); $configure_args = implode(' ', $args); return $this->seekLogFileOnException(fn () => $this->shell->exec("./configure {$configure_args}")); } - public function getConfigureArgsString(): string - { - return implode(' ', array_merge($this->getDefaultConfigureArgs(), $this->configure_args)); - } - /** * Run make * @@ -111,7 +103,7 @@ class UnixAutoconfExecutor extends Executor */ public function removeConfigureArgs(...$args): static { - $this->ignore_args = [...$this->ignore_args, ...$args]; + $this->configure_args = array_diff($this->configure_args, $args); return $this; } @@ -133,8 +125,8 @@ class UnixAutoconfExecutor extends Executor private function getDefaultConfigureArgs(): array { return [ - '--disable-shared', '--enable-static', + '--disable-shared', "--prefix={$this->library->getBuildRootPath()}", '--with-pic', '--enable-pic', From 1edf14e64235303684b409840b9f2bd0046497d2 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 10 Mar 2026 08:52:15 +0700 Subject: [PATCH 06/34] set custom binary name for frankenphp --- src/SPC/builder/unix/UnixBuilderBase.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SPC/builder/unix/UnixBuilderBase.php b/src/SPC/builder/unix/UnixBuilderBase.php index 1b532bbc..30112192 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -458,6 +458,7 @@ abstract class UnixBuilderBase extends BuilderBase '-ldflags \"-linkmode=external ' . $extLdFlags . ' ' . '-X \'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy\' ' . '-X \'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ' . + '-X \'github.com/caddyserver/caddy/v2.CustomBinaryName=frankenphp ' . "v{$frankenPhpVersion} PHP {$libphpVersion} Caddy'\\\" " . "-tags={$muslTags}nobadger,nomysql,nopgx{$nobrotli}{$nowatcher}", 'LD_LIBRARY_PATH' => BUILD_LIB_PATH, From 5d5a50a33cdf31f65f7656b5d6cc7beb585c8233 Mon Sep 17 00:00:00 2001 From: Marc Date: Tue, 10 Mar 2026 10:57:49 +0700 Subject: [PATCH 07/34] Update src/SPC/builder/LibraryBase.php Co-authored-by: Jerry Ma --- src/SPC/builder/LibraryBase.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/LibraryBase.php b/src/SPC/builder/LibraryBase.php index 0cd1c235..73b1f9ed 100644 --- a/src/SPC/builder/LibraryBase.php +++ b/src/SPC/builder/LibraryBase.php @@ -381,7 +381,10 @@ abstract class LibraryBase return false; } } - return true; // allow using system dependencies if pkg_config_path is explicitly defined + // allow using system dependencies if pkg_config_path is explicitly defined + if (count($search_paths) > 1) { + return true; + } } foreach (Config::getLib(static::NAME, 'static-libs', []) as $name) { if (!file_exists(BUILD_LIB_PATH . "/{$name}")) { From 4fa5292913bfd78df1d37ca778ed184948904a27 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Tue, 10 Mar 2026 13:49:34 +0800 Subject: [PATCH 08/34] Use custom config.m4 for grpc extension --- config/ext.json | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/ext.json b/config/ext.json index ed1210f3..79d3831e 100644 --- a/config/ext.json +++ b/config/ext.json @@ -252,12 +252,10 @@ "arg-type-unix": "enable-path", "cpp-extension": true, "lib-depends": [ + "grpc", "zlib", "openssl", "libcares" - ], - "frameworks": [ - "CoreFoundation" ] }, "iconv": { From 086c855a439801399a0ea1910939861fda7555ad Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Tue, 10 Mar 2026 13:49:53 +0800 Subject: [PATCH 09/34] Use custom config.m4 for grpc extension --- src/SPC/builder/extension/grpc.php | 52 +++++++++++++++++++++++------- 1 file changed, 40 insertions(+), 12 deletions(-) diff --git a/src/SPC/builder/extension/grpc.php b/src/SPC/builder/extension/grpc.php index 86be8d3d..ba15518f 100644 --- a/src/SPC/builder/extension/grpc.php +++ b/src/SPC/builder/extension/grpc.php @@ -11,7 +11,6 @@ use SPC\store\FileSystem; use SPC\util\CustomExt; use SPC\util\GlobalEnvManager; use SPC\util\SPCConfigUtil; -use SPC\util\SPCTarget; #[CustomExt('grpc')] class grpc extends Extension @@ -21,20 +20,50 @@ class grpc extends Extension if ($this->builder instanceof WindowsBuilder) { throw new ValidationException('grpc extension does not support windows yet'); } + + // Fix deprecated PHP API usage in call.c FileSystem::replaceFileStr( - $this->source_dir . '/src/php/ext/grpc/call.c', + "{$this->source_dir}/src/php/ext/grpc/call.c", 'zend_exception_get_default(TSRMLS_C),', 'zend_ce_exception,', ); - if (SPCTarget::getTargetOS() === 'Darwin') { - FileSystem::replaceFileRegex( - $this->source_dir . '/config.m4', - '/GRPC_LIBDIR=.*$/m', - 'GRPC_LIBDIR=' . BUILD_LIB_PATH . "\n" . 'LDFLAGS="$LDFLAGS -framework CoreFoundation"' - ); - } - FileSystem::replaceFileStr("{$this->source_dir}/config.m4", "CFLAGS=\"-std=c11 -g -O2\"\n", ''); - file_put_contents("{$this->source_dir}/php_grpc.h", '#include "src/php/ext/grpc/php_grpc.h"'); + + $config_m4 = <<<'M4' +PHP_ARG_ENABLE(grpc, [whether to enable grpc support], [AS_HELP_STRING([--enable-grpc], [Enable grpc support])]) + +if test "$PHP_GRPC" != "no"; then + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/include) + PHP_ADD_INCLUDE(PHP_EXT_SRCDIR()/src/php/ext/grpc) + GRPC_LIBDIR=@@build_lib_path@@ + PHP_ADD_LIBPATH($GRPC_LIBDIR) + PHP_ADD_LIBRARY(grpc,,GRPC_SHARED_LIBADD) + LIBS="-lpthread $LIBS" + PHP_ADD_LIBRARY(pthread) + + case $host in + *darwin*) + PHP_ADD_LIBRARY(c++,1,GRPC_SHARED_LIBADD) + ;; + *) + PHP_ADD_LIBRARY(stdc++,1,GRPC_SHARED_LIBADD) + PHP_ADD_LIBRARY(rt,,GRPC_SHARED_LIBADD) + PHP_ADD_LIBRARY(rt) + ;; + esac + + PHP_NEW_EXTENSION(grpc, @grpc_c_files@, $ext_shared, , -DGRPC_POSIX_FORK_ALLOW_PTHREAD_ATFORK=1) + PHP_SUBST(GRPC_SHARED_LIBADD) + PHP_INSTALL_HEADERS([ext/grpc], [php_grpc.h]) +fi +M4; + $replace = get_pack_replace(); + // load grpc c files from src/php/ext/grpc + $c_files = glob($this->source_dir . '/src/php/ext/grpc/*.c'); + $replace['@grpc_c_files@'] = implode(" \\\n ", array_map(fn ($f) => 'src/php/ext/grpc/' . basename($f), $c_files)); + $config_m4 = str_replace(array_keys($replace), array_values($replace), $config_m4); + file_put_contents($this->source_dir . '/config.m4', $config_m4); + + copy($this->source_dir . '/src/php/ext/grpc/php_grpc.h', $this->source_dir . '/php_grpc.h'); return true; } @@ -50,7 +79,6 @@ class grpc extends Extension public function patchBeforeMake(): bool { parent::patchBeforeMake(); - // add -Wno-strict-prototypes GlobalEnvManager::putenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS=' . getenv('SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS') . ' -Wno-strict-prototypes'); return true; } From 92f5b56c744d42fb6a4d38c40e09aa7a80490b61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Tue, 10 Mar 2026 11:57:23 +0100 Subject: [PATCH 10/34] fix: FrankenPHP build args --- src/SPC/builder/unix/UnixBuilderBase.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/builder/unix/UnixBuilderBase.php b/src/SPC/builder/unix/UnixBuilderBase.php index 30112192..fd16656c 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -457,8 +457,8 @@ abstract class UnixBuilderBase extends BuilderBase 'XCADDY_GO_BUILD_FLAGS' => '-buildmode=pie ' . '-ldflags \"-linkmode=external ' . $extLdFlags . ' ' . '-X \'github.com/caddyserver/caddy/v2/modules/caddyhttp.ServerHeader=FrankenPHP Caddy\' ' . + '-X \'github.com/caddyserver/caddy/v2.CustomBinaryName=frankenphp\' ' . '-X \'github.com/caddyserver/caddy/v2.CustomVersion=FrankenPHP ' . - '-X \'github.com/caddyserver/caddy/v2.CustomBinaryName=frankenphp ' . "v{$frankenPhpVersion} PHP {$libphpVersion} Caddy'\\\" " . "-tags={$muslTags}nobadger,nomysql,nopgx{$nobrotli}{$nowatcher}", 'LD_LIBRARY_PATH' => BUILD_LIB_PATH, From e49a5d7a50f9b0d0b5b5fd2ef35a2cf9917af77a Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 09:42:39 +0700 Subject: [PATCH 11/34] make php 8.5 default --- src/SPC/store/source/PhpSource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/store/source/PhpSource.php b/src/SPC/store/source/PhpSource.php index 02ba8755..bf33d6b7 100644 --- a/src/SPC/store/source/PhpSource.php +++ b/src/SPC/store/source/PhpSource.php @@ -20,7 +20,7 @@ class PhpSource extends CustomSourceBase public function fetch(bool $force = false, ?array $config = null, int $lock_as = SPC_DOWNLOAD_SOURCE): void { - $major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.4'; + $major = defined('SPC_BUILD_PHP_VERSION') ? SPC_BUILD_PHP_VERSION : '8.5'; if ($major === 'git') { Downloader::downloadSource('php-src', ['type' => 'git', 'url' => 'https://github.com/php/php-src.git', 'rev' => 'master'], $force); } else { From 901da8fa41268a8850af08dcee84004972ea48a8 Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 09:43:02 +0700 Subject: [PATCH 12/34] remove ldtl from odbc libs private (using built in ltdl) --- src/SPC/builder/unix/library/unixodbc.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/SPC/builder/unix/library/unixodbc.php b/src/SPC/builder/unix/library/unixodbc.php index 9a3cb63d..41cc4cbe 100644 --- a/src/SPC/builder/unix/library/unixodbc.php +++ b/src/SPC/builder/unix/library/unixodbc.php @@ -5,6 +5,7 @@ declare(strict_types=1); namespace SPC\builder\unix\library; use SPC\exception\WrongUsageException; +use SPC\store\FileSystem; use SPC\util\executor\UnixAutoconfExecutor; trait unixodbc @@ -31,6 +32,12 @@ trait unixodbc ) ->make(); $this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']); + foreach (['odbc.pc', 'odbccr.pc', 'odbcinst.pc'] as $file) { + FileSystem::replaceFileStr( + BUILD_LIB_PATH . "/pkgconfig/{$file}.pc", + '$(top_build_prefix)libltdl/libltdlc.la', + ''); + } $this->patchLaDependencyPrefix(); } } From ef4b2997a74a09bb00bdba673266ad6506ff9a3b Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 09:45:56 +0700 Subject: [PATCH 13/34] test --- src/SPC/builder/unix/library/unixodbc.php | 7 ++++--- src/globals/test-extensions.php | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/SPC/builder/unix/library/unixodbc.php b/src/SPC/builder/unix/library/unixodbc.php index 41cc4cbe..3729a417 100644 --- a/src/SPC/builder/unix/library/unixodbc.php +++ b/src/SPC/builder/unix/library/unixodbc.php @@ -31,10 +31,11 @@ trait unixodbc '--enable-gui=no', ) ->make(); - $this->patchPkgconfPrefix(['odbc.pc', 'odbccr.pc', 'odbcinst.pc']); - foreach (['odbc.pc', 'odbccr.pc', 'odbcinst.pc'] as $file) { + $pkgConfigs = ['odbc.pc', 'odbccr.pc', 'odbcinst.pc']; + $this->patchPkgconfPrefix($pkgConfigs); + foreach ($pkgConfigs as $file) { FileSystem::replaceFileStr( - BUILD_LIB_PATH . "/pkgconfig/{$file}.pc", + BUILD_LIB_PATH . "/pkgconfig/{$file}", '$(top_build_prefix)libltdl/libltdlc.la', ''); } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index bfae094a..46b7cb9d 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -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' => 'grpc', + 'Linux', 'Darwin' => 'pdo_odbc', 'Windows' => 'com_dotnet', }; From a335d050cff39d1bb2194f86f0817c5f68d56d99 Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 09:46:41 +0700 Subject: [PATCH 14/34] cs fix --- src/SPC/builder/unix/library/unixodbc.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/unix/library/unixodbc.php b/src/SPC/builder/unix/library/unixodbc.php index 3729a417..cf923f24 100644 --- a/src/SPC/builder/unix/library/unixodbc.php +++ b/src/SPC/builder/unix/library/unixodbc.php @@ -37,7 +37,8 @@ trait unixodbc FileSystem::replaceFileStr( BUILD_LIB_PATH . "/pkgconfig/{$file}", '$(top_build_prefix)libltdl/libltdlc.la', - ''); + '' + ); } $this->patchLaDependencyPrefix(); } From 70285cb53bb92d0455b69f79ed634c69451e1fb0 Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 09:48:50 +0700 Subject: [PATCH 15/34] actually update to 8.5 --- src/SPC/command/DownloadCommand.php | 2 +- src/SPC/util/ConfigValidator.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SPC/command/DownloadCommand.php b/src/SPC/command/DownloadCommand.php index 00bcc194..b7f2b078 100644 --- a/src/SPC/command/DownloadCommand.php +++ b/src/SPC/command/DownloadCommand.php @@ -30,7 +30,7 @@ class DownloadCommand extends BaseCommand $this->addArgument('sources', InputArgument::REQUIRED, 'The sources will be compiled, comma separated'); $this->addOption('shallow-clone', null, null, 'Clone shallow'); $this->addOption('with-openssl11', null, null, 'Use openssl 1.1'); - $this->addOption('with-php', null, InputOption::VALUE_REQUIRED, 'version in major.minor format (default 8.4)', '8.4'); + $this->addOption('with-php', null, InputOption::VALUE_REQUIRED, 'version in major.minor format (default 8.5)', '8.5'); $this->addOption('clean', null, null, 'Clean old download cache and source before fetch'); $this->addOption('all', 'A', null, 'Fetch all sources that static-php-cli needed'); $this->addOption('custom-url', 'U', InputOption::VALUE_IS_ARRAY | InputOption::VALUE_REQUIRED, 'Specify custom source download url, e.g "php-src:https://downloads.php.net/~eric/php-8.3.0beta1.tar.gz"'); diff --git a/src/SPC/util/ConfigValidator.php b/src/SPC/util/ConfigValidator.php index 445c6242..d9f751ef 100644 --- a/src/SPC/util/ConfigValidator.php +++ b/src/SPC/util/ConfigValidator.php @@ -393,7 +393,7 @@ class ConfigValidator } // check php-version if (isset($craft['php-version'])) { - // validdate version, accept 8.x, 7.x, 8.x.x, 7.x.x, 8, 7 + // validate version, accept 8.x, 7.x, 8.x.x, 7.x.x, 8, 7 $version = strval($craft['php-version']); if (!preg_match('/^(\d+)(\.\d+)?(\.\d+)?$/', $version, $matches)) { throw new ValidationException('Craft file php-version is invalid'); From a232f578a455112bc7a057b630ee877c3c816c42 Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 10:11:39 +0700 Subject: [PATCH 16/34] test bulk --- src/globals/test-extensions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 46b7cb9d..3af2b55d 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -74,7 +74,7 @@ $with_libs = match (PHP_OS_FAMILY) { // You can use `common`, `bulk`, `minimal` or `none`. // note: combination is only available for *nix platform. Windows must use `none` combination $base_combination = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'minimal', + 'Linux', 'Darwin' => 'bulk', 'Windows' => 'none', }; @@ -89,7 +89,7 @@ function _getCombination(string $type = 'common'): string 'common' => 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,' . 'mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,' . 'sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip', - 'bulk' => 'apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,' . + 'bulk' => 'apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,' . 'intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,' . 'posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,' . 'sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib', From 1b8b53d47f1af8fa4479ce1cb9e1ec75f109fb18 Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 10:19:08 +0700 Subject: [PATCH 17/34] update swoole args for 6.2 --- src/SPC/builder/extension/swoole.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/SPC/builder/extension/swoole.php b/src/SPC/builder/extension/swoole.php index 4e292a36..340a8ac3 100644 --- a/src/SPC/builder/extension/swoole.php +++ b/src/SPC/builder/extension/swoole.php @@ -50,19 +50,19 @@ class swoole extends Extension // commonly used feature: coroutine-time $arg .= ' --enable-swoole-coro-time --with-pic'; + $arg .= ' --enable-swoole-ftp --enable-swoole-ssh'; $arg .= $this->builder->getOption('enable-zts') ? ' --enable-swoole-thread --disable-thread-context' : ' --disable-swoole-thread --enable-thread-context'; // required features: curl, openssl (but curl hook is buggy for php 8.0) $arg .= $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl'; - $arg .= ' --enable-openssl'; // additional features that only require libraries $arg .= $this->builder->getLib('libcares') ? ' --enable-cares' : ''; $arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ''; $arg .= $this->builder->getLib('nghttp2') ? (' --with-nghttp2-dir=' . BUILD_ROOT_PATH) : ''; $arg .= $this->builder->getLib('zstd') ? ' --enable-zstd' : ''; - $arg .= $this->builder->getLib('liburing') ? ' --enable-iouring' : ''; + $arg .= $this->builder->getLib('liburing') ? ' --enable-iouring --enable-uring-socket' : ''; $arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : ''; // enable additional features that require the pdo extension, but conflict with pdo_* extensions From 1049a3ce66e6037b46813acc665096de542d96c4 Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 10:32:58 +0700 Subject: [PATCH 18/34] curl is always supported now (swoole no longer supports php < 8.1) --- src/SPC/builder/extension/swoole.php | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/SPC/builder/extension/swoole.php b/src/SPC/builder/extension/swoole.php index 340a8ac3..e79ffc13 100644 --- a/src/SPC/builder/extension/swoole.php +++ b/src/SPC/builder/extension/swoole.php @@ -50,13 +50,10 @@ class swoole extends Extension // commonly used feature: coroutine-time $arg .= ' --enable-swoole-coro-time --with-pic'; - $arg .= ' --enable-swoole-ftp --enable-swoole-ssh'; + $arg .= ' --enable-swoole-ftp --enable-swoole-ssh --enable-swoole-curl'; $arg .= $this->builder->getOption('enable-zts') ? ' --enable-swoole-thread --disable-thread-context' : ' --disable-swoole-thread --enable-thread-context'; - // required features: curl, openssl (but curl hook is buggy for php 8.0) - $arg .= $this->builder->getPHPVersionID() >= 80100 ? ' --enable-swoole-curl' : ' --disable-swoole-curl'; - // additional features that only require libraries $arg .= $this->builder->getLib('libcares') ? ' --enable-cares' : ''; $arg .= $this->builder->getLib('brotli') ? (' --enable-brotli --with-brotli-dir=' . BUILD_ROOT_PATH) : ''; From 1fcb74ad9b0dec3ffa65adeb78e3a2efe18312d7 Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 13:42:38 +0700 Subject: [PATCH 19/34] swoole-ftp conflicts with ftp --- src/SPC/builder/extension/swoole.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/SPC/builder/extension/swoole.php b/src/SPC/builder/extension/swoole.php index e79ffc13..afd309db 100644 --- a/src/SPC/builder/extension/swoole.php +++ b/src/SPC/builder/extension/swoole.php @@ -50,7 +50,7 @@ class swoole extends Extension // commonly used feature: coroutine-time $arg .= ' --enable-swoole-coro-time --with-pic'; - $arg .= ' --enable-swoole-ftp --enable-swoole-ssh --enable-swoole-curl'; + $arg .= ' --enable-swoole-ssh --enable-swoole-curl'; $arg .= $this->builder->getOption('enable-zts') ? ' --enable-swoole-thread --disable-thread-context' : ' --disable-swoole-thread --enable-thread-context'; @@ -71,6 +71,7 @@ class swoole extends Extension $config = (new SPCConfigUtil($this->builder))->getLibraryConfig($this->builder->getLib('unixodbc')); $arg .= ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"'; } + $arg .= $this->builder->getExt('ftp') ? ' --disable-swoole-ftp' : ' --enable-swoole-ftp'; if ($this->getExtVersion() >= '6.1.0') { $arg .= ' --enable-swoole-stdext'; From 85b0cd8b4bd85389a820ce8c2e00da948e698774 Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 13:54:24 +0700 Subject: [PATCH 20/34] only disable when building ftp static, shared is fine --- src/SPC/builder/extension/swoole.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/builder/extension/swoole.php b/src/SPC/builder/extension/swoole.php index afd309db..86098ec5 100644 --- a/src/SPC/builder/extension/swoole.php +++ b/src/SPC/builder/extension/swoole.php @@ -71,7 +71,7 @@ class swoole extends Extension $config = (new SPCConfigUtil($this->builder))->getLibraryConfig($this->builder->getLib('unixodbc')); $arg .= ' --with-swoole-odbc=unixODBC,' . BUILD_ROOT_PATH . ' SWOOLE_ODBC_LIBS="' . $config['libs'] . '"'; } - $arg .= $this->builder->getExt('ftp') ? ' --disable-swoole-ftp' : ' --enable-swoole-ftp'; + $arg .= $this->builder->getExt('ftp')?->isBuildStatic() ? ' --disable-swoole-ftp' : ' --enable-swoole-ftp'; if ($this->getExtVersion() >= '6.1.0') { $arg .= ' --enable-swoole-stdext'; From 60b2aea09e7a1a90a8636add22ebe9fb6f5427ec Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 18 Mar 2026 11:57:27 +0700 Subject: [PATCH 21/34] fix libde265 on ancient debian OS? --- src/SPC/builder/unix/library/libde265.php | 1 + src/globals/test-extensions.php | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/SPC/builder/unix/library/libde265.php b/src/SPC/builder/unix/library/libde265.php index 9549a2ec..04195a5d 100644 --- a/src/SPC/builder/unix/library/libde265.php +++ b/src/SPC/builder/unix/library/libde265.php @@ -11,6 +11,7 @@ trait libde265 protected function build(): void { UnixCMakeExecutor::create($this) + ->appendEnv(['LDFLAGS' => '-lpthread']) ->addConfigureArgs('-DENABLE_SDL=OFF') ->build(); $this->patchPkgconfPrefix(['libde265.pc']); diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index bfae094a..9fae2625 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -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' => 'grpc', + 'Linux', 'Darwin' => 'imagick', 'Windows' => 'com_dotnet', }; @@ -62,7 +62,7 @@ $shared_extensions = match (PHP_OS_FAMILY) { }; // If you want to test lib-suggests for all extensions and libraries, set it to true. -$with_suggested_libs = false; +$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) { From f2fa29809afe565bb8cedcd414b4ecdcb23ffc5f Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 18 Mar 2026 18:37:16 +0700 Subject: [PATCH 22/34] why is it not failing here? --- src/globals/test-extensions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 576a9774..e589f0f7 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -74,7 +74,7 @@ $with_libs = match (PHP_OS_FAMILY) { // You can use `common`, `bulk`, `minimal` or `none`. // note: combination is only available for *nix platform. Windows must use `none` combination $base_combination = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'bulk', + 'Linux', 'Darwin' => 'minimal', 'Windows' => 'none', }; From 823fe9694233bb421fbc411ce4eb67b502058d6f Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 18 Mar 2026 23:26:57 +0700 Subject: [PATCH 23/34] attempt --- src/SPC/builder/unix/library/libde265.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/SPC/builder/unix/library/libde265.php b/src/SPC/builder/unix/library/libde265.php index 04195a5d..184a4426 100644 --- a/src/SPC/builder/unix/library/libde265.php +++ b/src/SPC/builder/unix/library/libde265.php @@ -11,8 +11,10 @@ trait libde265 protected function build(): void { UnixCMakeExecutor::create($this) - ->appendEnv(['LDFLAGS' => '-lpthread']) - ->addConfigureArgs('-DENABLE_SDL=OFF') + ->addConfigureArgs( + '-DENABLE_SDL=OFF', + '-DENABLE_DECODER=OFF' + ) ->build(); $this->patchPkgconfPrefix(['libde265.pc']); } From 54915028d75f2efbc79f4814ea4d43c979692f2b Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 20 Mar 2026 19:35:51 +0800 Subject: [PATCH 24/34] Fix zlib produced lib file names from different zlib version (#1066) --- src/SPC/builder/windows/library/zlib.php | 21 ++++++++++++++++++--- src/globals/test-extensions.php | 18 +++++++++--------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/src/SPC/builder/windows/library/zlib.php b/src/SPC/builder/windows/library/zlib.php index 03fd033b..e9f96023 100644 --- a/src/SPC/builder/windows/library/zlib.php +++ b/src/SPC/builder/windows/library/zlib.php @@ -31,8 +31,23 @@ class zlib extends WindowsLibraryBase $this->builder->makeSimpleWrapper('cmake'), "--build build --config Release --target install -j{$this->builder->concurrency}" ); - copy(BUILD_LIB_PATH . '\zlibstatic.lib', BUILD_LIB_PATH . '\zlib_a.lib'); - unlink(BUILD_ROOT_PATH . '\bin\zlib.dll'); - unlink(BUILD_LIB_PATH . '\zlib.lib'); + $detect_list = [ + 'zlibstatic.lib', + 'zs.lib', + 'libzs.lib', + ]; + foreach ($detect_list as $item) { + if (file_exists(BUILD_LIB_PATH . '\\' . $item)) { + FileSystem::copy(BUILD_LIB_PATH . '\\' . $item, BUILD_LIB_PATH . '\zlib_a.lib'); + FileSystem::copy(BUILD_LIB_PATH . '\\' . $item, BUILD_LIB_PATH . '\zlibstatic.lib'); + break; + } + } + FileSystem::removeFileIfExists(BUILD_ROOT_PATH . '\bin\zlib.dll'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\zlib.lib'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\libz.dll'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\libz.lib'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\z.lib'); + FileSystem::removeFileIfExists(BUILD_LIB_PATH . '\z.dll'); } } diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 3af2b55d..8de87d56 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,7 +13,7 @@ declare(strict_types=1); // test php version (8.1 ~ 8.4 available, multiple for matrix) $test_php_version = [ - // '8.1', + '8.1', // '8.2', // '8.3', '8.4', @@ -23,15 +23,15 @@ $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 + // '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-22.04-arm', // bin/spc-gnu-docker for arm64 - 'ubuntu-24.04-arm', // bin/spc for arm64 + // '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-24.04-arm', // bin/spc for arm64 // 'windows-2022', // .\bin\spc.ps1 - // 'windows-2025', + 'windows-2025', // .\bin\spc.ps1 ]; // whether enable thread safe @@ -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' => 'pdo_odbc', - 'Windows' => 'com_dotnet', + 'Windows' => 'zlib,phar,mbstring,mbregex,sockets', }; // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`). From b970bf8e3a2616fcfde6b67c5e73cf5f86cf76e4 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Fri, 20 Mar 2026 20:00:42 +0800 Subject: [PATCH 25/34] Fix gd build on PHP 8.5 (#1043) --- src/SPC/store/SourcePatcher.php | 8 ++- src/globals/extra/gd_config_85.w32 | 94 ++++++++++++++++++++++++++++++ src/globals/test-extensions.php | 12 ++-- 3 files changed, 107 insertions(+), 7 deletions(-) create mode 100644 src/globals/extra/gd_config_85.w32 diff --git a/src/SPC/store/SourcePatcher.php b/src/SPC/store/SourcePatcher.php index 233a2e15..7ce2d200 100644 --- a/src/SPC/store/SourcePatcher.php +++ b/src/SPC/store/SourcePatcher.php @@ -634,7 +634,13 @@ class SourcePatcher FileSystem::replaceFileStr(SOURCE_PATH . '/php-src/ext/gd/libgd/gdft.c', '#ifndef MSWIN32', '#ifndef _WIN32'); } // custom config.w32, because official config.w32 is hard-coded many things - $origin = $ver_id >= 80100 ? file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_81.w32') : file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_80.w32'); + if ($ver_id >= 80500) { + $origin = file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_85.w32'); + } elseif ($ver_id >= 80100) { + $origin = file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_81.w32'); + } else { + $origin = file_get_contents(ROOT_DIR . '/src/globals/extra/gd_config_80.w32'); + } file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32.bak', file_get_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32')); return file_put_contents(SOURCE_PATH . '/php-src/ext/gd/config.w32', $origin) !== false; } diff --git a/src/globals/extra/gd_config_85.w32 b/src/globals/extra/gd_config_85.w32 new file mode 100644 index 00000000..e980b003 --- /dev/null +++ b/src/globals/extra/gd_config_85.w32 @@ -0,0 +1,94 @@ +// vim:ft=javascript + +ARG_WITH("gd", "Bundled GD support", "yes"); + +if (PHP_GD != "no") { + // check for gd.h (required) + if (!CHECK_HEADER_ADD_INCLUDE("gd.h", "CFLAGS_GD", PHP_GD + ";ext\\gd\\libgd")) { + ERROR("gd not enabled; libraries and headers not found"); + } + + // zlib ext support (required) + if (!CHECK_LIB("zlib_a.lib;zlib.lib", "gd", PHP_GD)) { + ERROR("gd not enabled; zlib not enabled"); + } + + // libjpeg lib support + if (CHECK_LIB("libjpeg_a.lib;libjpeg.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("jpeglib.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include")) { + AC_DEFINE("HAVE_LIBJPEG", 1, "JPEG support"); + AC_DEFINE("HAVE_GD_JPG", 1, "JPEG support"); + } + + // libpng16 lib support + if (CHECK_LIB("libpng_a.lib;libpng.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("png.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\libpng16")) { + AC_DEFINE("HAVE_LIBPNG", 1, "PNG support"); + AC_DEFINE("HAVE_GD_PNG", 1, "PNG support"); + } + + // freetype lib support + if (CHECK_LIB("libfreetype_a.lib;libfreetype.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("ft2build.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\freetype2;" + PHP_PHP_BUILD + "\\include\\freetype")) { + AC_DEFINE("HAVE_LIBFREETYPE", 1, "FreeType support"); + AC_DEFINE("HAVE_GD_FREETYPE", 1, "FreeType support"); + } + + // xpm lib support + if (CHECK_LIB("libXpm_a.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("xpm.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\X11")) { + AC_DEFINE("HAVE_LIBXPM", 1, "XPM support"); + AC_DEFINE("HAVE_GD_XPM", 1, "XPM support"); + } + + // iconv lib support + if ((CHECK_LIB("libiconv_a.lib;libiconv.lib", "gd", PHP_GD) || CHECK_LIB("iconv_a.lib;iconv.lib", "gd", PHP_GD)) && + CHECK_HEADER_ADD_INCLUDE("iconv.h", "CFLAGS_GD", PHP_GD)) { + AC_DEFINE("HAVE_LIBICONV", 1, "Iconv support"); + } + + // libwebp lib support + if ((CHECK_LIB("libwebp_a.lib", "gd", PHP_GD) || CHECK_LIB("libwebp.lib", "gd", PHP_GD)) && + CHECK_LIB("libsharpyuv.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("decode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp") && + CHECK_HEADER_ADD_INCLUDE("encode.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\webp")) { + AC_DEFINE("HAVE_LIBWEBP", 1, "WebP support"); + AC_DEFINE("HAVE_GD_WEBP", 1, "WebP support"); + } + + // libavif lib support + if (CHECK_LIB("avif_a.lib", "gd", PHP_GD) && + CHECK_LIB("aom_a.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) { + ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF"); + } else if (CHECK_LIB("avif.lib", "gd", PHP_GD) && + CHECK_HEADER_ADD_INCLUDE("avif.h", "CFLAGS_GD", PHP_GD + ";" + PHP_PHP_BUILD + "\\include\\avif")) { + ADD_FLAG("CFLAGS_GD", "/D HAVE_LIBAVIF /D HAVE_GD_AVIF"); + } + + CHECK_LIB("User32.lib", "gd", PHP_GD); + CHECK_LIB("Gdi32.lib", "gd", PHP_GD); + + EXTENSION("gd", "gd.c", null, "-Iext/gd/libgd"); + ADD_SOURCES("ext/gd/libgd", "gd.c \ + gdcache.c gdfontg.c gdfontl.c gdfontmb.c gdfonts.c gdfontt.c \ + gdft.c gd_gd2.c gd_gd.c gd_gif_in.c gd_gif_out.c gdhelpers.c gd_io.c gd_io_dp.c \ + gd_io_file.c gd_io_ss.c gd_jpeg.c gdkanji.c gd_png.c gd_ss.c \ + gdtables.c gd_topal.c gd_wbmp.c gdxpm.c wbmp.c gd_xbm.c gd_security.c gd_transform.c \ + gd_filter.c gd_rotate.c gd_color_match.c gd_webp.c gd_avif.c \ + gd_crop.c gd_interpolation.c gd_matrix.c gd_bmp.c gd_tga.c", "gd"); + + AC_DEFINE('HAVE_LIBGD', 1, 'GD support'); + AC_DEFINE('HAVE_GD_BUNDLED', 1, "Bundled GD"); + AC_DEFINE('HAVE_GD_BMP', 1, "BMP support"); + AC_DEFINE('HAVE_GD_TGA', 1, "TGA support"); + ADD_FLAG("CFLAGS_GD", " \ +/D PHP_GD_EXPORTS=1 \ +/D HAVE_GD_GET_INTERPOLATION \ + "); + if (ICC_TOOLSET) { + ADD_FLAG("LDFLAGS_GD", "/nodefaultlib:libcmt"); + } + + PHP_INSTALL_HEADERS("", "ext/gd ext/gd/libgd"); +} diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 8de87d56..c5a9d10b 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -31,11 +31,11 @@ $test_os = [ // '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', // .\bin\spc.ps1 + 'windows-2025', ]; // whether enable thread safe -$zts = false; +$zts = true; $no_strip = false; @@ -50,8 +50,8 @@ $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' => 'pdo_odbc', - 'Windows' => 'zlib,phar,mbstring,mbregex,sockets', + 'Linux', 'Darwin' => 'pgsql', + 'Windows' => 'gd,zlib,mbstring,filter', }; // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`). @@ -74,7 +74,7 @@ $with_libs = match (PHP_OS_FAMILY) { // You can use `common`, `bulk`, `minimal` or `none`. // note: combination is only available for *nix platform. Windows must use `none` combination $base_combination = match (PHP_OS_FAMILY) { - 'Linux', 'Darwin' => 'bulk', + 'Linux', 'Darwin' => 'minimal', 'Windows' => 'none', }; @@ -89,7 +89,7 @@ function _getCombination(string $type = 'common'): string 'common' => 'bcmath,bz2,calendar,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,gmp,iconv,xml,mbstring,mbregex,' . 'mysqlnd,openssl,pcntl,pdo,pdo_mysql,pdo_sqlite,phar,posix,redis,session,simplexml,soap,sockets,' . 'sqlite3,tokenizer,xmlwriter,xmlreader,zlib,zip', - 'bulk' => 'apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,' . + 'bulk' => 'apcu,bcmath,bz2,calendar,ctype,curl,dba,dom,event,exif,fileinfo,filter,ftp,gd,gmp,iconv,imagick,imap,' . 'intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pcntl,pdo,pdo_mysql,pdo_pgsql,pdo_sqlite,pgsql,phar,' . 'posix,protobuf,readline,redis,session,shmop,simplexml,soap,sockets,sodium,sqlite3,swoole,sysvmsg,sysvsem,' . 'sysvshm,tokenizer,xml,xmlreader,xmlwriter,xsl,zip,zlib', From 295df194846bf7d6385836e9dd1fae0494fa4c9b Mon Sep 17 00:00:00 2001 From: Nils Silbernagel <6422477+N-Silbernagel@users.noreply.github.com> Date: Fri, 20 Mar 2026 13:37:25 +0100 Subject: [PATCH 26/34] Add shared-extensions, frankenphp and zts to build-unix workflow (#1062) Co-authored-by: crazywhalecc --- .github/workflows/build-unix.yml | 79 +++++++++++++++++++++++++- config/env.ini | 2 + docs/en/guide/action-build.md | 6 +- docs/zh/guide/action-build.md | 4 +- src/SPC/builder/linux/LinuxBuilder.php | 2 +- 5 files changed, 87 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-unix.yml b/.github/workflows/build-unix.yml index bf6df9ac..eee9d0ae 100644 --- a/.github/workflows/build-unix.yml +++ b/.github/workflows/build-unix.yml @@ -29,6 +29,9 @@ on: description: Extensions to build (comma separated) required: true type: string + shared-extensions: + description: Shared extensions to build (optional, comma separated) + type: string extra-libs: description: Extra libraries to build (optional, comma separated) type: string @@ -42,6 +45,14 @@ on: build-fpm: description: Build fpm binary type: boolean + build-frankenphp: + description: Build frankenphp binary (requires ZTS) + type: boolean + default: false + enable-zts: + description: Enable ZTS + type: boolean + default: false prefer-pre-built: description: Prefer pre-built binaries (reduce build time) type: boolean @@ -73,6 +84,9 @@ on: description: Extensions to build (comma separated) required: true type: string + shared-extensions: + description: Shared extensions to build (optional, comma separated) + type: string extra-libs: description: Extra libraries to build (optional, comma separated) type: string @@ -86,6 +100,14 @@ on: build-fpm: description: Build fpm binary type: boolean + build-frankenphp: + description: Build frankenphp binary (requires ZTS) + type: boolean + default: false + enable-zts: + description: Enable ZTS + type: boolean + default: false prefer-pre-built: description: Prefer pre-built binaries (reduce build time) type: boolean @@ -152,8 +174,19 @@ jobs: RUNS_ON="macos-15" ;; esac - DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=${{ inputs.extensions }} --ignore-cache-sources=php-src" - BUILD_CMD="$BUILD_CMD ${{ inputs.extensions }}" + STATIC_EXTS="${{ inputs.extensions }}" + SHARED_EXTS="${{ inputs['shared-extensions'] }}" + BUILD_FRANKENPHP="${{ inputs['build-frankenphp'] }}" + ENABLE_ZTS="${{ inputs['enable-zts'] }}" + ALL_EXTS="$STATIC_EXTS" + if [ -n "$SHARED_EXTS" ]; then + ALL_EXTS="$ALL_EXTS,$SHARED_EXTS" + fi + DOWN_CMD="$DOWN_CMD --with-php=${{ inputs.php-version }} --for-extensions=$ALL_EXTS --ignore-cache-sources=php-src" + BUILD_CMD="$BUILD_CMD $STATIC_EXTS" + if [ -n "$SHARED_EXTS" ]; then + BUILD_CMD="$BUILD_CMD --build-shared=$SHARED_EXTS" + fi if [ -n "${{ inputs.extra-libs }}" ]; then DOWN_CMD="$DOWN_CMD --for-libs=${{ inputs.extra-libs }}" BUILD_CMD="$BUILD_CMD --with-libs=${{ inputs.extra-libs }}" @@ -177,6 +210,12 @@ jobs: if [ ${{ inputs.build-fpm }} == true ]; then BUILD_CMD="$BUILD_CMD --build-fpm" fi + if [ "$BUILD_FRANKENPHP" = "true" ]; then + BUILD_CMD="$BUILD_CMD --build-frankenphp" + fi + if [ "$ENABLE_ZTS" = "true" ]; then + BUILD_CMD="$BUILD_CMD --enable-zts" + fi echo 'download='"$DOWN_CMD" >> "$GITHUB_OUTPUT" echo 'build='"$BUILD_CMD" >> "$GITHUB_OUTPUT" echo 'run='"$RUNS_ON" >> "$GITHUB_OUTPUT" @@ -199,6 +238,27 @@ jobs: env: phpts: nts + - if: ${{ inputs['build-frankenphp'] == true }} + name: "Install go-xcaddy for FrankenPHP" + run: | + case "${{ inputs.os }}" in + linux-x86_64|linux-aarch64) + ./bin/spc-alpine-docker install-pkg go-xcaddy + ;; + linux-x86_64-glibc|linux-aarch64-glibc) + ./bin/spc-gnu-docker install-pkg go-xcaddy + ;; + macos-x86_64|macos-aarch64) + composer update --no-dev --classmap-authoritative + ./bin/spc doctor --auto-fix + ./bin/spc install-pkg go-xcaddy + ;; + *) + echo "Unsupported OS for go-xcaddy install: ${{ inputs.os }}" + exit 1 + ;; + esac + # Cache downloaded source - id: cache-download uses: actions/cache@v4 @@ -245,7 +305,22 @@ jobs: name: php-fpm-${{ inputs.php-version }}-${{ inputs.os }} path: buildroot/bin/php-fpm + # Upload frankenphp executable + - if: ${{ inputs['build-frankenphp'] == true }} + name: "Upload FrankenPHP SAPI" + uses: actions/upload-artifact@v4 + with: + name: php-frankenphp-${{ inputs.php-version }}-${{ inputs.os }} + path: buildroot/bin/frankenphp + # Upload extensions metadata + - if: ${{ inputs['shared-extensions'] != '' }} + name: "Upload shared extensions" + uses: actions/upload-artifact@v4 + with: + name: php-shared-ext-${{ inputs.php-version }}-${{ inputs.os }} + path: | + buildroot/modules/*.so - uses: actions/upload-artifact@v4 name: "Upload License Files" with: diff --git a/config/env.ini b/config/env.ini index a16bc160..25a20e89 100644 --- a/config/env.ini +++ b/config/env.ini @@ -148,6 +148,8 @@ SPC_CMD_PREFIX_PHP_CONFIGURE="./configure --prefix= --with-valgrind=no --enable- SPC_CMD_VAR_PHP_EMBED_TYPE="static" ; EXTRA_CFLAGS for `configure` and `make` php SPC_CMD_VAR_PHP_MAKE_EXTRA_CFLAGS="-g -fstack-protector-strong -fpic -fpie -Werror=unknown-warning-option ${SPC_DEFAULT_C_FLAGS}" +; EXTRA_LDFLAGS for `make` php, can use -release to set a soname for libphp.so +SPC_CMD_VAR_PHP_MAKE_EXTRA_LDFLAGS="" ; minimum compatible macOS version (LLVM vars, availability not guaranteed) MACOSX_DEPLOYMENT_TARGET=12.0 diff --git a/docs/en/guide/action-build.md b/docs/en/guide/action-build.md index 7d4bba32..b2254956 100644 --- a/docs/en/guide/action-build.md +++ b/docs/en/guide/action-build.md @@ -16,8 +16,10 @@ while also defining the extensions to compile. 1. Fork project. 2. Go to the Actions of the project and select `CI`. -3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of extensions. (extensions comma separated, e.g. `bcmath,curl,mbstring`) -4. After waiting for about a period of time, enter the corresponding task and get `Artifacts`. +3. Select `Run workflow`, fill in the PHP version you want to compile, the target type, and the list of static extensions. (comma separated, e.g. `bcmath,curl,mbstring`) +4. If you need shared extensions (for example `xdebug`), set `shared-extensions` (comma separated, e.g. `xdebug`). +5. If you need FrankenPHP, enable `build-frankenphp` and also enable `enable-zts`. +6. After waiting for about a period of time, enter the corresponding task and get `Artifacts`. If you enable `debug`, all logs will be output at build time, including compiled logs, for troubleshooting. diff --git a/docs/zh/guide/action-build.md b/docs/zh/guide/action-build.md index 11f382d5..7adcc456 100644 --- a/docs/zh/guide/action-build.md +++ b/docs/zh/guide/action-build.md @@ -14,7 +14,9 @@ Action 构建指的是直接使用 GitHub Action 进行编译。 1. Fork 本项目。 2. 进入项目的 Actions,选择 CI 开头的 Workflow(根据你需要的操作系统选择)。 3. 选择 `Run workflow`,填入你要编译的 PHP 版本、目标类型、扩展列表。(扩展列表使用英文逗号分割,例如 `bcmath,curl,mbstring`) -4. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`。 +4. 如果需要共享扩展(例如 `xdebug`),请设置 `shared-extensions`(使用英文逗号分割,例如 `xdebug`)。 +5. 如果需要 FrankenPHP,请启用 `build-frankenphp`,同时也需要启用 `enable-zts`。 +6. 等待大约一段时间后,进入对应的任务中,获取 `Artifacts`。 如果你选择了 `debug`,则会在构建时输出所有日志,包括编译的日志,以供排查错误。 diff --git a/src/SPC/builder/linux/LinuxBuilder.php b/src/SPC/builder/linux/LinuxBuilder.php index 004c37de..d959aade 100644 --- a/src/SPC/builder/linux/LinuxBuilder.php +++ b/src/SPC/builder/linux/LinuxBuilder.php @@ -162,7 +162,7 @@ class LinuxBuilder extends UnixBuilderBase throw new WrongUsageException( "You're building against musl libc statically (the default on Linux), but you're trying to build shared extensions.\n" . 'Static musl libc does not implement `dlopen`, so your php binary is not able to load shared extensions.' . "\n" . - 'Either use SPC_LIBC=glibc to link against glibc on a glibc OS, or use SPC_TARGET="native-native-musl -dynamic" to link against musl libc dynamically using `zig cc`.' + 'Either use SPC_LIBC=glibc to link against glibc on a glibc OS, use SPC_TARGET="native-native-musl -dynamic" to link against musl libc dynamically using `zig cc` or use SPC_MUSL_DYNAMIC=true on alpine.' ); } logger()->info('Building shared extensions...'); From 963e2a084a006090d52f23794fd205f902576f15 Mon Sep 17 00:00:00 2001 From: Hendrik Mennen Date: Sun, 22 Mar 2026 09:07:47 +0100 Subject: [PATCH 27/34] Add Windows builders for libaom and brotli libraries Both libraries are listed in lib.json and used as transitive dependencies (libaom via libavif, brotli via freetype/curl) but had no Windows builder, causing builds to fail with "library [X] is in the lib.json list but not supported to compile". libaom: Uses builddir instead of build to avoid collision with the source tree's build/cmake/ directory. Matches the Unix builder's AOM_TARGET_CPU=generic setting for portability. brotli: Standard CMake build with shared libs and tools disabled. Also adds static-libs-windows entry for libaom in lib.json. --- config/lib.json | 3 ++ src/SPC/builder/windows/library/brotli.php | 36 +++++++++++++++++++ src/SPC/builder/windows/library/libaom.php | 41 ++++++++++++++++++++++ 3 files changed, 80 insertions(+) create mode 100644 src/SPC/builder/windows/library/brotli.php create mode 100644 src/SPC/builder/windows/library/libaom.php diff --git a/config/lib.json b/config/lib.json index 58cbd4ba..2612f6be 100644 --- a/config/lib.json +++ b/config/lib.json @@ -355,6 +355,9 @@ "static-libs-unix": [ "libaom.a" ], + "static-libs-windows": [ + "aom.lib" + ], "cpp-library": true }, "libargon2": { diff --git a/src/SPC/builder/windows/library/brotli.php b/src/SPC/builder/windows/library/brotli.php new file mode 100644 index 00000000..f22f402c --- /dev/null +++ b/src/SPC/builder/windows/library/brotli.php @@ -0,0 +1,36 @@ +source_dir . '\build'); + + // start build + cmd()->cd($this->source_dir) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + '-B build ' . + '-A x64 ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DBUILD_SHARED_LIBS=OFF ' . + '-DBROTLI_BUILD_TOOLS=OFF ' . + '-DBROTLI_BUNDLED_MODE=OFF ' . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' + ) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + "--build build --config Release --target install -j{$this->builder->concurrency}" + ); + } +} diff --git a/src/SPC/builder/windows/library/libaom.php b/src/SPC/builder/windows/library/libaom.php new file mode 100644 index 00000000..06d53cbc --- /dev/null +++ b/src/SPC/builder/windows/library/libaom.php @@ -0,0 +1,41 @@ +source_dir . '\builddir'); + + // start build + cmd()->cd($this->source_dir) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + '-S . -B builddir ' . + '-A x64 ' . + "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . + '-DCMAKE_BUILD_TYPE=Release ' . + '-DBUILD_SHARED_LIBS=OFF ' . + '-DAOM_TARGET_CPU=generic ' . + '-DENABLE_DOCS=OFF ' . + '-DENABLE_EXAMPLES=OFF ' . + '-DENABLE_TESTDATA=OFF ' . + '-DENABLE_TESTS=OFF ' . + '-DENABLE_TOOLS=OFF ' . + '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' + ) + ->execWithWrapper( + $this->builder->makeSimpleWrapper('cmake'), + "--build builddir --config Release --target install -j{$this->builder->concurrency}" + ); + } +} From c03508a84bc7f14af614e9e9c975f53071412505 Mon Sep 17 00:00:00 2001 From: Hendrik Mennen Date: Sun, 22 Mar 2026 13:11:29 +0100 Subject: [PATCH 28/34] Improve zlib Windows library detection for future zlib versions (#1070) Co-authored-by: Hendrik Mennen --- src/SPC/builder/windows/library/zlib.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/SPC/builder/windows/library/zlib.php b/src/SPC/builder/windows/library/zlib.php index e9f96023..a5fd346b 100644 --- a/src/SPC/builder/windows/library/zlib.php +++ b/src/SPC/builder/windows/library/zlib.php @@ -35,6 +35,7 @@ class zlib extends WindowsLibraryBase 'zlibstatic.lib', 'zs.lib', 'libzs.lib', + 'libz.lib', ]; foreach ($detect_list as $item) { if (file_exists(BUILD_LIB_PATH . '\\' . $item)) { From a99b6bebaed8bc6bd53a2913ec9dd0ebcb9dbc78 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Mon, 23 Mar 2026 16:08:09 +0800 Subject: [PATCH 29/34] Remove freetype useless lib suggestions --- config/lib.json | 4 +--- src/SPC/builder/unix/library/freetype.php | 4 ++-- src/SPC/builder/windows/library/freetype.php | 2 ++ 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/config/lib.json b/config/lib.json index 2612f6be..82402368 100644 --- a/config/lib.json +++ b/config/lib.json @@ -143,9 +143,7 @@ "zlib" ], "lib-suggests": [ - "libpng", - "bzip2", - "brotli" + "libpng" ] }, "gettext": { diff --git a/src/SPC/builder/unix/library/freetype.php b/src/SPC/builder/unix/library/freetype.php index a10b7fb2..57c1ac05 100644 --- a/src/SPC/builder/unix/library/freetype.php +++ b/src/SPC/builder/unix/library/freetype.php @@ -13,8 +13,8 @@ trait freetype { $cmake = UnixCMakeExecutor::create($this) ->optionalLib('libpng', ...cmake_boolean_args('FT_DISABLE_PNG', true)) - ->optionalLib('bzip2', ...cmake_boolean_args('FT_DISABLE_BZIP2', true)) - ->optionalLib('brotli', ...cmake_boolean_args('FT_DISABLE_BROTLI', true)) + ->addConfigureArgs('-DFT_DISABLE_BZIP2=ON') + ->addConfigureArgs('-DFT_DISABLE_BROTLI=ON') ->addConfigureArgs('-DFT_DISABLE_HARFBUZZ=ON'); // fix cmake 4.0 compatibility diff --git a/src/SPC/builder/windows/library/freetype.php b/src/SPC/builder/windows/library/freetype.php index ef13c8fe..8401b4de 100644 --- a/src/SPC/builder/windows/library/freetype.php +++ b/src/SPC/builder/windows/library/freetype.php @@ -24,6 +24,8 @@ class freetype extends WindowsLibraryBase "-DCMAKE_TOOLCHAIN_FILE={$this->builder->cmake_toolchain_file} " . '-DCMAKE_BUILD_TYPE=Release ' . '-DBUILD_SHARED_LIBS=OFF ' . + '-DFT_DISABLE_BROTLI=TRUE ' . + '-DFT_DISABLE_BZIP2=TRUE ' . '-DCMAKE_INSTALL_PREFIX=' . BUILD_ROOT_PATH . ' ' ) ->execWithWrapper( From d076df6b04f33adc0d4185e9340ff287416bfdca Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Mon, 23 Mar 2026 16:21:24 +0800 Subject: [PATCH 30/34] Bump version number --- src/SPC/ConsoleApplication.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SPC/ConsoleApplication.php b/src/SPC/ConsoleApplication.php index 750c49e4..79f7d724 100644 --- a/src/SPC/ConsoleApplication.php +++ b/src/SPC/ConsoleApplication.php @@ -34,7 +34,7 @@ use Symfony\Component\Console\Application; */ final class ConsoleApplication extends Application { - public const string VERSION = '2.8.3'; + public const string VERSION = '2.8.4'; public function __construct() { From ecf712b2b7c548a02f59f0e50b85359abc252a24 Mon Sep 17 00:00:00 2001 From: henderkes Date: Thu, 26 Mar 2026 12:32:27 +0700 Subject: [PATCH 31/34] hard code protobuf version while we're on v2 --- config/source.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/source.json b/config/source.json index 040197cb..3f48cd78 100644 --- a/config/source.json +++ b/config/source.json @@ -1054,7 +1054,7 @@ }, "protobuf": { "type": "url", - "url": "https://pecl.php.net/get/protobuf", + "url": "https://pecl.php.net/get/protobuf-5.34.1.tgz", "path": "php-src/ext/protobuf", "filename": "protobuf.tgz", "license": { From daae5f2a7ca71a0322bd6c94c9d03cf4b7d1d4dd Mon Sep 17 00:00:00 2001 From: henderkes Date: Mon, 30 Mar 2026 00:56:51 +0700 Subject: [PATCH 32/34] libjpeg-turbo mustn't compile zlib symbols on its own --- config/lib.json | 2 +- config/source.json | 1 + src/SPC/builder/unix/library/libjpeg.php | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/config/lib.json b/config/lib.json index 82402368..f960ab82 100644 --- a/config/lib.json +++ b/config/lib.json @@ -494,7 +494,7 @@ "static-libs-windows": [ "libjpeg_a.lib" ], - "lib-suggests-windows": [ + "lib-depends": [ "zlib" ] }, diff --git a/config/source.json b/config/source.json index 3f48cd78..4b3f7b59 100644 --- a/config/source.json +++ b/config/source.json @@ -641,6 +641,7 @@ "libjpeg": { "type": "ghtar", "repo": "libjpeg-turbo/libjpeg-turbo", + "prefer-stable": true, "license": { "type": "file", "path": "LICENSE.md" diff --git a/src/SPC/builder/unix/library/libjpeg.php b/src/SPC/builder/unix/library/libjpeg.php index 862c1e88..98881b76 100644 --- a/src/SPC/builder/unix/library/libjpeg.php +++ b/src/SPC/builder/unix/library/libjpeg.php @@ -14,6 +14,7 @@ trait libjpeg ->addConfigureArgs( '-DENABLE_STATIC=ON', '-DENABLE_SHARED=OFF', + '-DWITH_SYSTEM_ZLIB=ON' ) ->build(); // patch pkgconfig From 8f7897e13bc7dd9dfe488e723bc12f02bf644ad2 Mon Sep 17 00:00:00 2001 From: henderkes Date: Mon, 30 Mar 2026 01:06:31 +0700 Subject: [PATCH 33/34] test --- src/globals/test-extensions.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index b29e028f..e31485d5 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', @@ -42,15 +42,15 @@ $no_strip = false; // compress with upx $upx = false; -// whether to test frankenphp build, only available for macos and linux -$frankenphp = false; +// whether to test frankenphp build, only available for macOS and linux +$frankenphp = true; // prefer downloading pre-built packages to speed up the build process $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' => 'pgsql', + 'Linux', 'Darwin' => 'zlib', 'Windows' => 'gd,zlib,mbstring,filter', }; @@ -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' => '', + 'Linux', 'Darwin' => 'libjpeg', 'Windows' => '', }; From 5a5f54bdcd446c572ea63b35b6513610f69c40f8 Mon Sep 17 00:00:00 2001 From: henderkes Date: Mon, 30 Mar 2026 01:37:08 +0700 Subject: [PATCH 34/34] brilliant to test php 8.1 --- src/globals/test-extensions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index e31485d5..ccc56105 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,7 +13,7 @@ declare(strict_types=1); // test php version (8.1 ~ 8.4 available, multiple for matrix) $test_php_version = [ - '8.1', + // '8.1', // '8.2', // '8.3', '8.4', @@ -43,7 +43,7 @@ $no_strip = false; $upx = false; // whether to test frankenphp build, only available for macOS and linux -$frankenphp = true; +$frankenphp = false; // prefer downloading pre-built packages to speed up the build process $prefer_pre_built = false;