From e49a5d7a50f9b0d0b5b5fd2ef35a2cf9917af77a Mon Sep 17 00:00:00 2001 From: henderkes Date: Wed, 11 Mar 2026 09:42:39 +0700 Subject: [PATCH 01/10] 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 02/10] 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 03/10] 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 04/10] 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 05/10] 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 06/10] 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 07/10] 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 08/10] 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 09/10] 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 10/10] 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';