mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-03-17 20:34:51 +08:00
fix: Postgres build with ancient libc (#1029)
This commit is contained in:
commit
f680731f9d
@ -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()
|
||||
{
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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' => '',
|
||||
};
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user