From a940200164ebcd4d27cba5610da8fda01956c712 Mon Sep 17 00:00:00 2001 From: crazywhalecc Date: Sun, 30 Mar 2025 20:34:57 +0800 Subject: [PATCH] Return default version for musl and musl-wrapper --- src/SPC/builder/linux/SystemUtil.php | 9 ++++++--- src/SPC/store/Config.php | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/SPC/builder/linux/SystemUtil.php b/src/SPC/builder/linux/SystemUtil.php index b65cb78f..1e56fc68 100644 --- a/src/SPC/builder/linux/SystemUtil.php +++ b/src/SPC/builder/linux/SystemUtil.php @@ -189,7 +189,7 @@ class SystemUtil public static function getLibcVersionIfExists(): ?string { if (PHP_OS_FAMILY === 'Linux' && getenv('SPC_LIBC') === 'glibc') { - $result = shell()->execWithResult('ldd --version'); + $result = shell()->execWithResult('ldd --version', false); if ($result[0] !== 0) { return null; } @@ -202,11 +202,13 @@ class SystemUtil } return null; } + /* + // for musl, disabled temporarily as musl has better compatibility between different patch version? if (PHP_OS_FAMILY === 'Linux' && getenv('SPC_LIBC') === 'musl') { if (self::isMuslDist()) { - $result = shell()->execWithResult('ldd 2>&1'); + $result = shell()->execWithResult('ldd 2>&1', false); } else { - $result = shell()->execWithResult('/usr/local/musl/lib/libc.so 2>&1'); + $result = shell()->execWithResult('/usr/local/musl/lib/libc.so 2>&1', false); } // Match Version * line // match ldd version: "Version 1.2.3" match 1.2.3 @@ -215,6 +217,7 @@ class SystemUtil return $matches[1]; } } + */ return null; } } diff --git a/src/SPC/store/Config.php b/src/SPC/store/Config.php index f7074d47..68ba4399 100644 --- a/src/SPC/store/Config.php +++ b/src/SPC/store/Config.php @@ -31,7 +31,7 @@ class Config if (self::$pre_built === null) { self::$pre_built = FileSystem::loadConfigArray('pre-built'); } - $supported_sys_based = ['match-pattern']; + $supported_sys_based = ['match-pattern', 'prefer-stable', 'repo']; if (in_array($name, $supported_sys_based)) { $m_key = match (PHP_OS_FAMILY) { 'Windows' => ['-windows', '-win', ''],