Skip to content

Commit f680731

Browse files
authored
fix: Postgres build with ancient libc (#1029)
2 parents b89ff3c + 0fe1442 commit f680731

File tree

3 files changed

+13
-28
lines changed

3 files changed

+13
-28
lines changed

src/SPC/ConsoleApplication.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
*/
3535
final class ConsoleApplication extends Application
3636
{
37-
public const string VERSION = '2.8.0';
37+
public const string VERSION = '2.8.2';
3838

3939
public function __construct()
4040
{

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

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,14 @@
44

55
namespace SPC\builder\unix\library;
66

7-
use SPC\exception\FileSystemException;
87
use SPC\store\FileSystem;
98
use SPC\util\PkgConfigUtil;
109
use SPC\util\SPCConfigUtil;
11-
use SPC\util\SPCTarget;
1210

1311
trait postgresql
1412
{
1513
public function patchBeforeBuild(): bool
1614
{
17-
// fix aarch64 build on glibc 2.17 (e.g. CentOS 7)
18-
if (SPCTarget::getLibcVersion() === '2.17' && GNU_ARCH === 'aarch64') {
19-
try {
20-
FileSystem::replaceFileStr("{$this->source_dir}/src/port/pg_popcount_aarch64.c", 'HWCAP_SVE', '0');
21-
FileSystem::replaceFileStr(
22-
"{$this->source_dir}/src/port/pg_crc32c_armv8_choose.c",
23-
'#if defined(__linux__) && !defined(__aarch64__) && !defined(HWCAP2_CRC32)',
24-
'#if defined(__linux__) && !defined(HWCAP_CRC32)'
25-
);
26-
} catch (FileSystemException) {
27-
// allow file not-existence to make it compatible with old and new version
28-
}
29-
}
3015
// skip the test on platforms where libpq infrastructure may be provided by statically-linked libraries
3116
FileSystem::replaceFileStr("{$this->source_dir}/src/interfaces/libpq/Makefile", 'invokes exit\'; exit 1;', 'invokes exit\';');
3217
// disable shared libs build

src/globals/test-extensions.php

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@
1313

1414
// test php version (8.1 ~ 8.4 available, multiple for matrix)
1515
$test_php_version = [
16-
'8.1',
17-
'8.2',
18-
'8.3',
19-
'8.4',
16+
// '8.1',
17+
// '8.2',
18+
// '8.3',
19+
// '8.4',
2020
'8.5',
2121
// 'git',
2222
];
@@ -26,12 +26,12 @@
2626
// 'macos-15-intel', // bin/spc for x86_64
2727
// '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
30-
// 'ubuntu-24.04', // bin/spc for x86_64
31-
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
32-
// 'ubuntu-24.04-arm', // bin/spc for arm64
29+
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
30+
'ubuntu-24.04', // bin/spc for x86_64
31+
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
32+
'ubuntu-24.04-arm', // bin/spc for arm64
3333
// 'windows-2022', // .\bin\spc.ps1
34-
'windows-2025',
34+
// 'windows-2025',
3535
];
3636

3737
// whether enable thread safe
@@ -50,13 +50,13 @@
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' => 'mysqli,gmp',
53+
'Linux', 'Darwin' => 'pgsql',
5454
'Windows' => 'com_dotnet',
5555
};
5656

5757
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
5858
$shared_extensions = match (PHP_OS_FAMILY) {
59-
'Linux' => 'grpc,mysqlnd_parsec,mysqlnd_ed25519',
59+
'Linux' => '',
6060
'Darwin' => '',
6161
'Windows' => '',
6262
};
@@ -66,7 +66,7 @@
6666

6767
// If you want to test extra libs for extensions, add them below (comma separated, example `libwebp,libavif`). Unnecessary, when $with_suggested_libs is true.
6868
$with_libs = match (PHP_OS_FAMILY) {
69-
'Linux', 'Darwin' => 'libwebp',
69+
'Linux', 'Darwin' => '',
7070
'Windows' => '',
7171
};
7272

0 commit comments

Comments
 (0)