remove workaround for zig < 0.16 (#1105)

This commit is contained in:
Marc
2026-04-15 11:47:08 +07:00
committed by GitHub
3 changed files with 9 additions and 13 deletions

View File

@@ -1000,7 +1000,7 @@
"openssl": { "openssl": {
"type": "ghrel", "type": "ghrel",
"repo": "openssl/openssl", "repo": "openssl/openssl",
"match": "openssl.+\\.tar\\.gz", "match": "openssl-3.+\\.tar\\.gz",
"prefer-stable": true, "prefer-stable": true,
"alt": { "alt": {
"type": "filelist", "type": "filelist",

View File

@@ -50,7 +50,7 @@ trait UnixSystemUtilTrait
$defined = array_unique($defined); $defined = array_unique($defined);
sort($defined); sort($defined);
// export // export
if (SPCTarget::getTargetOS() === 'Linux') { if (SPCTarget::getTargetOS() === 'Linux' && ToolchainManager::getToolchainClass() !== ZigToolchain::class) {
file_put_contents("{$lib_file}.dynsym", "{\n" . implode("\n", array_map(fn ($x) => " {$x};", $defined)) . "};\n"); file_put_contents("{$lib_file}.dynsym", "{\n" . implode("\n", array_map(fn ($x) => " {$x};", $defined)) . "};\n");
} else { } else {
file_put_contents("{$lib_file}.dynsym", implode("\n", $defined) . "\n"); file_put_contents("{$lib_file}.dynsym", implode("\n", $defined) . "\n");
@@ -72,10 +72,6 @@ trait UnixSystemUtilTrait
if (!is_file($symbol_file)) { if (!is_file($symbol_file)) {
throw new SPCInternalException("The symbol file {$symbol_file} does not exist, please check if nm command is available."); 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 // macOS/zig
if (SPCTarget::getTargetOS() !== 'Linux' || ToolchainManager::getToolchainClass() === ZigToolchain::class) { if (SPCTarget::getTargetOS() !== 'Linux' || ToolchainManager::getToolchainClass() === ZigToolchain::class) {
return "-Wl,-exported_symbols_list,{$symbol_file}"; return "-Wl,-exported_symbols_list,{$symbol_file}";

View File

@@ -24,13 +24,13 @@ $test_php_version = [
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available) // test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
$test_os = [ $test_os = [
// 'macos-15-intel', // bin/spc for x86_64 // 'macos-15-intel', // bin/spc for x86_64
// 'macos-15', // bin/spc for arm64 'macos-15', // bin/spc for arm64
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64 // '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-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 // 'ubuntu-24.04-arm', // bin/spc for arm64
'windows-2022', // .\bin\spc.ps1 // 'windows-2022', // .\bin\spc.ps1
// 'windows-2025', // 'windows-2025',
]; ];
@@ -43,20 +43,20 @@ $no_strip = false;
$upx = false; $upx = false;
// whether to test frankenphp build, only available for macOS and linux // whether to test frankenphp build, only available for macOS and linux
$frankenphp = false; $frankenphp = true;
// prefer downloading pre-built packages to speed up the build process // prefer downloading pre-built packages to speed up the build process
$prefer_pre_built = true; $prefer_pre_built = true;
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`). // If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
$extensions = match (PHP_OS_FAMILY) { $extensions = match (PHP_OS_FAMILY) {
'Linux', 'Darwin' => 'decimal', 'Linux', 'Darwin' => 'openssl,brotli',
'Windows' => 'bcmath,brotli,bz2,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,iconv,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_pgsql,pgsql,session,simdjson,simplexml,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,zip,zlib', 'Windows' => 'bcmath,brotli,bz2,ctype,curl,dom,exif,fileinfo,filter,ftp,gd,iconv,intl,mbregex,mbstring,mysqli,mysqlnd,opcache,openssl,pdo,pdo_mysql,pdo_pgsql,pgsql,session,simdjson,simplexml,sodium,sqlite3,tokenizer,xml,xmlreader,xmlwriter,zip,zlib',
}; };
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`). // If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
$shared_extensions = match (PHP_OS_FAMILY) { $shared_extensions = match (PHP_OS_FAMILY) {
'Linux' => '', 'Linux' => 'zstd',
'Darwin' => '', 'Darwin' => '',
'Windows' => '', 'Windows' => '',
}; };