fix building of shared extensions (grpc, simdjson, soap) (#905)

This commit is contained in:
Marc
2025-10-12 11:24:32 +02:00
committed by GitHub
21 changed files with 173 additions and 110 deletions

View File

@@ -245,6 +245,23 @@ function clean_spaces(string $string): string
return trim(preg_replace('/\s+/', ' ', $string));
}
/**
* Deduplicate flags in a string. Only the last occurence of each flag will be kept.
* E.g. `-lintl -lstdc++ -lphp -lstdc++` becomes `-lintl -lphp -lstdc++`
*
* @param string $flags the string containing flags to deduplicate
* @return string the deduplicated string with no duplicate flags
*/
function deduplicate_flags(string $flags): string
{
$tokens = preg_split('/\s+/', trim($flags));
// Reverse, unique, reverse back - keeps last occurrence of duplicates
$deduplicated = array_reverse(array_unique(array_reverse($tokens)));
return implode(' ', $deduplicated);
}
/**
* Register a callback function to handle keyboard interrupts (Ctrl+C).
*

View File

@@ -23,10 +23,10 @@ $test_php_version = [
// test os (macos-13, macos-14, macos-15, ubuntu-latest, windows-latest are available)
$test_os = [
'macos-13', // bin/spc for x86_64
// 'macos-14', // bin/spc for arm64
// 'macos-13', // bin/spc for x86_64
'macos-14', // 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-24.04', // bin/spc for x86_64
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
@@ -56,7 +56,7 @@ $extensions = match (PHP_OS_FAMILY) {
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
$shared_extensions = match (PHP_OS_FAMILY) {
'Linux' => 'zip',
'Linux' => 'grpc,imagick',
'Darwin' => '',
'Windows' => '',
};