Enhance musl-wrapper and musl-toolchain installation process (#988)

This commit is contained in:
Jerry Ma
2025-12-06 16:50:36 +08:00
committed by GitHub
parent 106b55d4e7
commit 9ad7147155
6 changed files with 31 additions and 10 deletions

View File

@@ -13,6 +13,7 @@ use StaticPHP\Attribute\Doctor\OptionalCheck;
use StaticPHP\DI\ApplicationContext;
use StaticPHP\Doctor\CheckResult;
use StaticPHP\Runtime\Shell\Shell;
use StaticPHP\Toolchain\Interface\ToolchainInterface;
use StaticPHP\Toolchain\MuslToolchain;
use StaticPHP\Toolchain\ZigToolchain;
use StaticPHP\Util\FileSystem;
@@ -25,8 +26,8 @@ class LinuxMuslCheck
{
public static function optionalCheck(): bool
{
return getenv('SPC_TOOLCHAIN') === MuslToolchain::class ||
(getenv('SPC_TOOLCHAIN') === ZigToolchain::class && !LinuxUtil::isMuslDist());
$toolchain = ApplicationContext::get(ToolchainInterface::class);
return $toolchain instanceof MuslToolchain || $toolchain instanceof ZigToolchain && !LinuxUtil::isMuslDist();
}
/** @noinspection PhpUnused */