sanity check after toolset init

This commit is contained in:
DubbleClick
2025-07-01 18:22:05 +07:00
parent a6d68b9ecf
commit 8d47e56010
2 changed files with 14 additions and 3 deletions

View File

@@ -8,6 +8,7 @@ use SPC\builder\traits\UnixSystemUtilTrait;
use SPC\exception\RuntimeException;
use SPC\toolchain\ToolchainManager;
use SPC\toolchain\ZigToolchain;
use SPC\util\SPCTarget;
class SystemUtil
{
@@ -215,10 +216,12 @@ class SystemUtil
return null;
}
if ($libc === 'musl') {
if (self::isMuslDist()) {
if (SPCTarget::getLibc() === 'musl') {
$result = shell()->execWithResult('ldd 2>&1', false);
} else {
} elseif (is_file('/usr/local/musl/lib/libc.so')) {
$result = shell()->execWithResult('/usr/local/musl/lib/libc.so 2>&1', false);
} else {
$result = shell()->execWithResult('/lib/ld-musl-x86_64.so.1 2>&1', false);
}
// Match Version * line
// match ldd version: "Version 1.2.3" match 1.2.3