From d275d6cc69f51adf075d4c8d6180382c273037be Mon Sep 17 00:00:00 2001 From: DubbleClick Date: Tue, 1 Jul 2025 18:06:18 +0700 Subject: [PATCH] fix native chain --- src/SPC/util/SPCTarget.php | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/src/SPC/util/SPCTarget.php b/src/SPC/util/SPCTarget.php index 7298f2c8..8dd640a0 100644 --- a/src/SPC/util/SPCTarget.php +++ b/src/SPC/util/SPCTarget.php @@ -47,18 +47,19 @@ class SPCTarget */ public static function getLibc(): ?string { - $target = getenv('SPC_TARGET'); - if (str_contains($target, '-gnu')) { - return 'glibc'; - } - if (str_contains($target, '-musl')) { - return 'musl'; - } - if (str_contains($target, '-linux')) { - return 'musl'; - } - if (PHP_OS_FAMILY === 'Linux' && str_contains($target, '-native')) { - return 'musl'; + if ($target = getenv('SPC_TARGET')) { + if (str_contains($target, '-gnu')) { + return 'glibc'; + } + if (str_contains($target, '-musl')) { + return 'musl'; + } + if (str_contains($target, '-linux')) { + return 'musl'; + } + if (PHP_OS_FAMILY === 'Linux' && str_contains($target, '-native')) { + return 'musl'; + } } $libc = getenv('SPC_LIBC'); if ($libc !== false) {