Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions config/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -462,10 +462,8 @@
}
},
"krb5": {
"type": "ghtagtar",
"repo": "krb5/krb5",
"match": "krb5.+-final",
"prefer-stable": true,
"type": "url",
"url": "https://web.mit.edu/kerberos/dist/krb5/1.22/krb5-1.22.2.tar.gz",
"license": {
"type": "file",
"path": "NOTICE"
Expand Down
2 changes: 1 addition & 1 deletion src/SPC/ConsoleApplication.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
final class ConsoleApplication extends Application
{
public const string VERSION = '2.8.4';
public const string VERSION = '2.8.5';

public function __construct()
{
Expand Down
9 changes: 9 additions & 0 deletions src/SPC/builder/extension/grpc.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ public function patchBeforeBuildconf(): bool
'zend_ce_exception,',
);

// Fix include path conflict with pdo_sqlsrv: grpc's PHP ext dir is added to the global include path via
$grpc_php_dir = "{$this->source_dir}/src/php/ext/grpc";
if (file_exists("{$grpc_php_dir}/version.h")) {
copy("{$grpc_php_dir}/version.h", "{$grpc_php_dir}/php_grpc_version.h");
unlink("{$grpc_php_dir}/version.h");
FileSystem::replaceFileStr("{$grpc_php_dir}/php_grpc.h", '#include "version.h"', '#include "php_grpc_version.h"');
FileSystem::replaceFileStr("{$grpc_php_dir}/php_grpc.c", '#include "version.h"', '#include "php_grpc_version.h"');
}

$config_m4 = <<<'M4'
PHP_ARG_ENABLE(grpc, [whether to enable grpc support], [AS_HELP_STRING([--enable-grpc], [Enable grpc support])])

Expand Down
2 changes: 1 addition & 1 deletion src/SPC/builder/extension/swoole.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public function getUnixConfigureArg(bool $shared = false): string
$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 --enable-uring-socket' : '';
$arg .= $this->builder->getLib('liburing') && getenv('SPC_LIBC') !== 'glibc' ? ' --enable-iouring --enable-uring-socket' : '--disable-iouring';
$arg .= $this->builder->getExt('sockets') ? ' --enable-sockets' : '';

// enable additional features that require the pdo extension, but conflict with pdo_* extensions
Expand Down
5 changes: 4 additions & 1 deletion src/SPC/builder/unix/library/krb5.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ protected function build(): void
{
$origin_source_dir = $this->source_dir;
$this->source_dir .= '/src';
shell()->cd($this->source_dir)->exec('autoreconf -if');
shell()->cd($this->source_dir)->exec('ls -lah');
if (!file_exists($this->source_dir . '/configure')) {
shell()->cd($this->source_dir)->exec('autoreconf -if');
}
$libs = array_map(fn ($x) => $x->getName(), $this->getDependencies(true));
$spc = new SPCConfigUtil($this->builder, ['no_php' => true, 'libs_only_deps' => true]);
$config = $spc->config(libraries: $libs, include_suggest_lib: $this->builder->getOption('with-suggested-libs', false));
Expand Down
5 changes: 4 additions & 1 deletion src/SPC/builder/unix/library/libjpeg.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ protected function build(): void
->addConfigureArgs(
'-DENABLE_STATIC=ON',
'-DENABLE_SHARED=OFF',
'-DWITH_SYSTEM_ZLIB=ON'
'-DWITH_SYSTEM_ZLIB=ON',
'-DWITH_TOOLS=OFF',
'-DWITH_TESTS=OFF',
'-DWITH_SIMD=OFF',
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we have a variable for whether avx2/avx512 are enabled

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Which one?

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

Found it:

$code = '#include <immintrin.h>
int main() { return _mm256_cvtsi256_si32(_mm256_setzero_si256()); }';
        $cc = getenv('CC') ?: 'gcc';
        [$ret] = shell()->execWithResult("printf '%s' '{$code}' | {$cc} -x c -mavx2 -o /dev/null - 2>&1");
        $disableAvx2 = $ret !== 0 && GNU_ARCH === 'x86_64' && PHP_OS_FAMILY === 'Linux';

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

It seems better to abstract it into a separate method on v3 and pass it using environment variables.

Copy link
Copy Markdown
Collaborator

@henderkes henderkes Apr 10, 2026

Choose a reason for hiding this comment

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

We should do it like php-src. There's a --enable-native-intrinsics=level switch that defines what level will be chosen.

Levels are SSE2 (default on x86), SSE3...4.2, AVX2, AVX512. On aarch64 I forgot the names something like neonv8.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

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

We can create a separate issue tracking it though

)
->build();
// patch pkgconfig
Expand Down
10 changes: 5 additions & 5 deletions src/SPC/builder/windows/library/icu_static_win.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ class icu_static_win extends WindowsLibraryBase

protected function build(): void
{
copy("{$this->source_dir}\\x64-windows-static\\lib\\icudt.lib", "{$this->getLibDir()}\\icudt.lib");
copy("{$this->source_dir}\\x64-windows-static\\lib\\icuin.lib", "{$this->getLibDir()}\\icuin.lib");
copy("{$this->source_dir}\\x64-windows-static\\lib\\icuio.lib", "{$this->getLibDir()}\\icuio.lib");
copy("{$this->source_dir}\\x64-windows-static\\lib\\icuuc.lib", "{$this->getLibDir()}\\icuuc.lib");
copy("{$this->source_dir}\\lib\\icudt.lib", "{$this->getLibDir()}\\icudt.lib");
copy("{$this->source_dir}\\lib\\icuin.lib", "{$this->getLibDir()}\\icuin.lib");
copy("{$this->source_dir}\\lib\\icuio.lib", "{$this->getLibDir()}\\icuio.lib");
copy("{$this->source_dir}\\lib\\icuuc.lib", "{$this->getLibDir()}\\icuuc.lib");

// create libpq folder in buildroot/includes/libpq
if (!file_exists("{$this->getIncludeDir()}\\unicode")) {
mkdir("{$this->getIncludeDir()}\\unicode");
}

FileSystem::copyDir("{$this->source_dir}\\x64-windows-static\\include\\unicode", "{$this->getIncludeDir()}\\unicode");
FileSystem::copyDir("{$this->source_dir}\\include\\unicode", "{$this->getIncludeDir()}\\unicode");
}
}
3 changes: 3 additions & 0 deletions src/SPC/util/executor/UnixCMakeExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ private function makeCmakeToolchainFile(): string
$cflags = getenv('SPC_DEFAULT_C_FLAGS');
$cc = getenv('CC');
$cxx = getenv('CCX');
$include = BUILD_INCLUDE_PATH;
logger()->debug("making cmake tool chain file for {$os} {$target_arch} with CFLAGS='{$cflags}'");
$root = BUILD_ROOT_PATH;
$pkgConfigExecutable = PkgConfigUtil::findPkgConfig();
Expand Down Expand Up @@ -210,6 +211,8 @@ private function makeCmakeToolchainFile(): string
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
set(CMAKE_C_STANDARD_INCLUDE_DIRECTORIES "{$include}")
set(CMAKE_CXX_STANDARD_INCLUDE_DIRECTORIES "{$include}")
set(CMAKE_EXE_LINKER_FLAGS "-ldl -lpthread -lm -lutil")
CMAKE;
// Whoops, linux may need CMAKE_AR sometimes
Expand Down
14 changes: 7 additions & 7 deletions src/globals/test-extensions.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
$test_php_version = [
// '8.1',
// '8.2',
// '8.3',
'8.3',
// '8.4',
'8.5',
// 'git',
Expand All @@ -26,9 +26,9 @@
'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-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',
Expand All @@ -43,15 +43,15 @@
$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;

// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) {
'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',
'Linux', 'Darwin' => 'curl,swoole',
'Windows' => 'intl',
};

// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
Expand All @@ -66,7 +66,7 @@

// 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' => 'krb5',
'Windows' => '',
};

Expand Down
Loading