From 6b67cb90fc1fdc9c3788f8bfbe528b6bba41082a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Wed, 11 Feb 2026 16:24:13 +0100 Subject: [PATCH 01/12] fix: Postgres build with ancient libc --- src/SPC/builder/unix/library/postgresql.php | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/src/SPC/builder/unix/library/postgresql.php b/src/SPC/builder/unix/library/postgresql.php index a72f3a1a..2ad4f51b 100644 --- a/src/SPC/builder/unix/library/postgresql.php +++ b/src/SPC/builder/unix/library/postgresql.php @@ -4,29 +4,14 @@ declare(strict_types=1); namespace SPC\builder\unix\library; -use SPC\exception\FileSystemException; use SPC\store\FileSystem; use SPC\util\PkgConfigUtil; use SPC\util\SPCConfigUtil; -use SPC\util\SPCTarget; trait postgresql { public function patchBeforeBuild(): bool { - // fix aarch64 build on glibc 2.17 (e.g. CentOS 7) - if (SPCTarget::getLibcVersion() === '2.17' && GNU_ARCH === 'aarch64') { - try { - FileSystem::replaceFileStr("{$this->source_dir}/src/port/pg_popcount_aarch64.c", 'HWCAP_SVE', '0'); - FileSystem::replaceFileStr( - "{$this->source_dir}/src/port/pg_crc32c_armv8_choose.c", - '#if defined(__linux__) && !defined(__aarch64__) && !defined(HWCAP2_CRC32)', - '#if defined(__linux__) && !defined(HWCAP_CRC32)' - ); - } catch (FileSystemException) { - // allow file not-existence to make it compatible with old and new version - } - } // skip the test on platforms where libpq infrastructure may be provided by statically-linked libraries FileSystem::replaceFileStr("{$this->source_dir}/src/interfaces/libpq/Makefile", 'invokes exit\'; exit 1;', 'invokes exit\';'); // disable shared libs build From 1e4780397b5871d344b36a2c35d10f312bf53047 Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Wed, 11 Feb 2026 23:32:19 +0800 Subject: [PATCH 02/12] Update test-extensions.php for PHP versions and extensions Commented out older PHP versions and Windows 2025 in the test configuration. Updated the extensions to test for Linux and Darwin. --- src/globals/test-extensions.php | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/globals/test-extensions.php b/src/globals/test-extensions.php index 8b22658c..ba02e672 100644 --- a/src/globals/test-extensions.php +++ b/src/globals/test-extensions.php @@ -13,10 +13,10 @@ declare(strict_types=1); // test php version (8.1 ~ 8.4 available, multiple for matrix) $test_php_version = [ - '8.1', - '8.2', - '8.3', - '8.4', + // '8.1', + // '8.2', + // '8.3', + // '8.4', '8.5', // 'git', ]; @@ -26,12 +26,12 @@ $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 - // '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', ]; // whether enable thread safe @@ -50,13 +50,13 @@ $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' => 'mysqli,gmp', + 'Linux', 'Darwin' => 'pgsql', 'Windows' => 'com_dotnet', }; // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`). $shared_extensions = match (PHP_OS_FAMILY) { - 'Linux' => 'grpc,mysqlnd_parsec,mysqlnd_ed25519', + 'Linux' => '', 'Darwin' => '', 'Windows' => '', }; @@ -66,7 +66,7 @@ $with_suggested_libs = false; // 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' => 'libwebp', + 'Linux', 'Darwin' => '', 'Windows' => '', }; From 0fe1442f7e6e64c1113fc0cc4d1ef64e43124add Mon Sep 17 00:00:00 2001 From: Jerry Ma Date: Thu, 12 Feb 2026 00:02:38 +0800 Subject: [PATCH 03/12] Bump version from 2.8.0 to 2.8.2 --- 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 19fdd41d..415af40d 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.0'; + public const string VERSION = '2.8.2'; public function __construct() { From 9a53ef34983e9c81de83ff866056f8b15849d90e Mon Sep 17 00:00:00 2001 From: Yoram Date: Fri, 13 Feb 2026 14:25:14 +0100 Subject: [PATCH 04/12] add input with-suggested-libs for build command --- .github/workflows/build-unix.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/build-unix.yml b/.github/workflows/build-unix.yml index 0166bfa0..6549a94e 100644 --- a/.github/workflows/build-unix.yml +++ b/.github/workflows/build-unix.yml @@ -46,6 +46,10 @@ on: description: Prefer pre-built binaries (reduce build time) type: boolean default: true + with-suggested-libs: + description: Build with suggested libs + type: boolean + default: false debug: description: Show full build logs type: boolean @@ -86,6 +90,10 @@ on: description: Prefer pre-built binaries (reduce build time) type: boolean default: true + with-suggested-libs: + description: Include suggested libs + type: boolean + default: false debug: description: Show full build logs type: boolean @@ -157,6 +165,9 @@ jobs: if [ ${{ inputs.prefer-pre-built }} == true ]; then DOWN_CMD="$DOWN_CMD --prefer-pre-built" fi + if [ ${{ inputs.with-suggested-libs }} == true ]; then + BUILD_CMD="$BUILD_CMD --with-suggested-libs" + fi if [ ${{ inputs.build-cli }} == true ]; then BUILD_CMD="$BUILD_CMD --build-cli" fi From d9834d05c6149d9e3850153690dc8b31fdde16c4 Mon Sep 17 00:00:00 2001 From: Yoram Date: Mon, 16 Feb 2026 11:22:25 +0100 Subject: [PATCH 05/12] upload debug logs on 'build php' failures --- .github/workflows/build-unix.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/build-unix.yml b/.github/workflows/build-unix.yml index 6549a94e..0f2fa172 100644 --- a/.github/workflows/build-unix.yml +++ b/.github/workflows/build-unix.yml @@ -213,6 +213,14 @@ jobs: # if: ${{ failure() }} # uses: mxschmitt/action-tmate@v3 + # Upload debug logs + - if: ${{ inputs.debug && failure() }} + name: "Upload build logs on failure" + uses: actions/upload-artifact@v4 + with: + name: php-cli-logs-${{ inputs.php-version }}-${{ inputs.os }} + path: log/*.log + # Upload cli executable - if: ${{ inputs.build-cli == true }} name: "Upload PHP cli SAPI" From 661723c99a2f0fa4c71c6c9231397fd7132800d5 Mon Sep 17 00:00:00 2001 From: tricker Date: Mon, 16 Feb 2026 12:26:49 +0100 Subject: [PATCH 06/12] change logs name Co-authored-by: Marc --- .github/workflows/build-unix.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-unix.yml b/.github/workflows/build-unix.yml index 0f2fa172..bf6df9ac 100644 --- a/.github/workflows/build-unix.yml +++ b/.github/workflows/build-unix.yml @@ -218,7 +218,7 @@ jobs: name: "Upload build logs on failure" uses: actions/upload-artifact@v4 with: - name: php-cli-logs-${{ inputs.php-version }}-${{ inputs.os }} + name: spc-logs-${{ inputs.php-version }}-${{ inputs.os }} path: log/*.log # Upload cli executable From c6802996547f4ed938b2eab2c08fcc79b8df71de Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 17 Feb 2026 19:12:19 +0700 Subject: [PATCH 07/12] libavif needs at least one encoder to work --- config/lib.json | 7 +++++++ src/SPC/builder/unix/library/libavif.php | 5 +++++ 2 files changed, 12 insertions(+) diff --git a/config/lib.json b/config/lib.json index 3be97248..087c3893 100644 --- a/config/lib.json +++ b/config/lib.json @@ -373,6 +373,13 @@ ], "static-libs-windows": [ "avif.lib" + ], + "lib-suggests": [ + "libaom", + "libwebp", + "libjpeg", + "libxml2", + "libpng" ] }, "libcares": { diff --git a/src/SPC/builder/unix/library/libavif.php b/src/SPC/builder/unix/library/libavif.php index fbd4fa18..a5b57aef 100644 --- a/src/SPC/builder/unix/library/libavif.php +++ b/src/SPC/builder/unix/library/libavif.php @@ -11,6 +11,11 @@ trait libavif protected function build(): void { UnixCMakeExecutor::create($this) + ->optionalLib('libaom', '-DAVIF_CODEC_AOM=SYSTEM', '-DAVIF_CODEC_AOM=OFF') + ->optionalLib('libsharpyuv', '-DAVIF_LIBSHARPYUV=SYSTEM', '-DAVIF_LIBSHARPYUV=OFF') + ->optionalLib('libjpeg', '-DAVIF_JPEG=SYSTEM', '-DAVIF_JPEG=OFF') + ->optionalLib('libxml2', '-DAVIF_LIBXML2=SYSTEM', '-DAVIF_LIBXML2=OFF') + ->optionalLib('libpng', '-DAVIF_LIBPNG=SYSTEM', '-DAVIF_LIBPNG=OFF') ->addConfigureArgs('-DAVIF_LIBYUV=OFF') ->build(); // patch pkgconfig From 608c915e14bc74a6adaac36400cb60f8c99157f0 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 17 Feb 2026 19:14:29 +0700 Subject: [PATCH 08/12] should depend on it instead --- config/lib.json | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/lib.json b/config/lib.json index 087c3893..ebbf4b87 100644 --- a/config/lib.json +++ b/config/lib.json @@ -374,8 +374,10 @@ "static-libs-windows": [ "avif.lib" ], + "lib-depends": [ + "libaom" + ], "lib-suggests": [ - "libaom", "libwebp", "libjpeg", "libxml2", From 98117c3a04b0749368b3c2f24f09c86ddf026fa3 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 17 Feb 2026 19:56:59 +0700 Subject: [PATCH 09/12] remove pre built --- config/source.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/source.json b/config/source.json index 03626015..114118bb 100644 --- a/config/source.json +++ b/config/source.json @@ -526,7 +526,7 @@ "libavif": { "type": "ghtar", "repo": "AOMediaCodec/libavif", - "provide-pre-built": true, + "provide-pre-built": false, "license": { "type": "file", "path": "LICENSE" From 5623fed37fa03aaed7e8da8e686dc6d03156a174 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 17 Feb 2026 21:05:18 +0700 Subject: [PATCH 10/12] fix redownloading go-xcaddy every time --- src/SPC/ConsoleApplication.php | 2 +- src/SPC/store/pkg/GoXcaddy.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/SPC/ConsoleApplication.php b/src/SPC/ConsoleApplication.php index 415af40d..750c49e4 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.2'; + public const string VERSION = '2.8.3'; public function __construct() { diff --git a/src/SPC/store/pkg/GoXcaddy.php b/src/SPC/store/pkg/GoXcaddy.php index 93821aaa..462342db 100644 --- a/src/SPC/store/pkg/GoXcaddy.php +++ b/src/SPC/store/pkg/GoXcaddy.php @@ -30,8 +30,8 @@ class GoXcaddy extends CustomPackage public function fetch(string $name, bool $force = false, ?array $config = null): void { $pkgroot = PKG_ROOT_PATH; - $go_exec = "{$pkgroot}/{$name}/bin/go"; - $xcaddy_exec = "{$pkgroot}/{$name}/bin/xcaddy"; + $go_exec = "{$pkgroot}/go-xcaddy/bin/go"; + $xcaddy_exec = "{$pkgroot}/go-xcaddy/bin/xcaddy"; if ($force) { FileSystem::removeDir("{$pkgroot}/{$name}"); } From d83a597689b79f435b3fa902defdd5825f79af70 Mon Sep 17 00:00:00 2001 From: henderkes Date: Tue, 17 Feb 2026 21:49:30 +0700 Subject: [PATCH 11/12] unquote the string in case a shell script passes it stupidly --- 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 464c9b2f..2f192a12 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -365,6 +365,7 @@ abstract class UnixBuilderBase extends BuilderBase $frankenphpAppPath = $this->getOption('with-frankenphp-app'); if ($frankenphpAppPath) { + $frankenphpAppPath = trim($frankenphpAppPath, "\"'"); if (!is_dir($frankenphpAppPath)) { throw new WrongUsageException("The path provided to --with-frankenphp-app is not a valid directory: {$frankenphpAppPath}"); } From 2a8fa7d15547fab68b7b320353896b2348a31809 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Dunglas?= Date: Mon, 23 Feb 2026 16:29:43 +0100 Subject: [PATCH 12/12] Update build flags for FrankenPHP in UnixBuilderBase --- 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 2f192a12..1b532bbc 100644 --- a/src/SPC/builder/unix/UnixBuilderBase.php +++ b/src/SPC/builder/unix/UnixBuilderBase.php @@ -456,6 +456,7 @@ abstract class UnixBuilderBase extends BuilderBase 'CGO_LDFLAGS' => "{$this->arch_ld_flags} {$staticFlags} {$config['ldflags']} {$libs}", '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.CustomVersion=FrankenPHP ' . "v{$frankenPhpVersion} PHP {$libphpVersion} Caddy'\\\" " . "-tags={$muslTags}nobadger,nomysql,nopgx{$nobrotli}{$nowatcher}",