Skip to content

Commit af01fc0

Browse files
committed
Merge branch 'feat/frankenphp-pgo' into feat/pgo
2 parents ff9a849 + fd882ce commit af01fc0

5 files changed

Lines changed: 19 additions & 9 deletions

File tree

config/source.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@
246246
},
247247
"ext-rdkafka": {
248248
"type": "ghtar",
249-
"repo": "arnaud-lb/php-rdkafka",
249+
"repo": "php-rdkafka/php-rdkafka",
250250
"path": "php-src/ext/rdkafka",
251251
"license": {
252252
"type": "file",

src/SPC/builder/unix/UnixBuilderBase.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -464,9 +464,10 @@ protected function buildFrankenphp(): void
464464
"-tags={$muslTags}nobadger,nomysql,nopgx{$nobrotli}{$nowatcher}",
465465
'LD_LIBRARY_PATH' => BUILD_LIB_PATH,
466466
], ...GoXcaddy::getEnvironment()];
467+
$pgo = file_exists("{$frankenphpSourceDir}/caddy/frankenphp/default.pgo") ? "--pgo {$frankenphpSourceDir}/caddy/frankenphp/default.pgo " : '';
467468
shell()->cd(BUILD_BIN_PATH)
468469
->setEnv($env)
469-
->exec("xcaddy build --output frankenphp {$xcaddyModules}");
470+
->exec("xcaddy build --output frankenphp {$pgo}{$xcaddyModules}");
470471

471472
$this->deploySAPIBinary(BUILD_TARGET_FRANKENPHP);
472473
}

src/SPC/builder/unix/library/curl.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
namespace SPC\builder\unix\library;
66

7+
use SPC\store\FileSystem;
78
use SPC\util\executor\UnixCMakeExecutor;
89

910
trait curl
@@ -33,8 +34,16 @@ protected function build(): void
3334
)
3435
->build();
3536

36-
// patch pkgconf
3737
$this->patchPkgconfPrefix(['libcurl.pc']);
38+
// On glibc <2.28 without built-in pthreads, FindThreads sets
39+
// INTERFACE_LINK_LIBRARIES to '-lpthread'
40+
// curls .pc generator walks and prepends '-l' to each
41+
// entry, resulting in -l-lpthread
42+
FileSystem::replaceFileRegex(
43+
BUILD_LIB_PATH . '/pkgconfig/libcurl.pc',
44+
'/-l(-l\S+)/',
45+
'$1'
46+
);
3847
shell()->cd(BUILD_LIB_PATH . '/cmake/CURL/')
3948
->exec("sed -ie 's|\"/lib/libcurl.a\"|\"" . BUILD_LIB_PATH . "/libcurl.a\"|g' CURLTargets-release.cmake");
4049
}

src/SPC/store/pkg/GoXcaddy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public function extract(string $name): void
8585
'GOBIN' => "{$pkgroot}/go-xcaddy/bin",
8686
'GOPATH' => "{$pkgroot}/go",
8787
])
88-
->exec('CGO_ENABLED=0 go install github.com/caddyserver/xcaddy/cmd/xcaddy@latest');
88+
->exec('CGO_ENABLED=0 go install github.com/caddyserver/xcaddy/cmd/xcaddy@master');
8989
}
9090

9191
public static function getEnvironment(): array

src/globals/test-extensions.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// test php version (8.1 ~ 8.4 available, multiple for matrix)
1515
$test_php_version = [
1616
// '8.1',
17-
'8.2',
17+
// '8.2',
1818
// '8.3',
1919
// '8.4',
2020
'8.5',
@@ -24,11 +24,11 @@
2424
// test os (macos-15-intel, macos-15, ubuntu-latest, windows-latest are available)
2525
$test_os = [
2626
// 'macos-15-intel', // bin/spc for x86_64
27-
'macos-15', // bin/spc for arm64
27+
// 'macos-15', // bin/spc for arm64
2828
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
29-
// 'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
29+
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
3030
// 'ubuntu-24.04', // bin/spc for x86_64
31-
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
31+
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
3232
// 'ubuntu-24.04-arm', // bin/spc for arm64
3333
// 'windows-2022', // .\bin\spc.ps1
3434
// 'windows-2025',
@@ -50,7 +50,7 @@
5050

5151
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
5252
$extensions = match (PHP_OS_FAMILY) {
53-
'Linux', 'Darwin' => 'swoole,mongodb',
53+
'Linux', 'Darwin' => 'curl,gd',
5454
'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',
5555
};
5656

0 commit comments

Comments
 (0)