mirror of
https://github.com/crazywhalecc/static-php-cli.git
synced 2026-07-17 13:55:35 +08:00
Disable musl-wrapper installation on default situation
This commit is contained in:
@@ -13,6 +13,7 @@ use StaticPHP\Attribute\Doctor\OptionalCheck;
|
|||||||
use StaticPHP\DI\ApplicationContext;
|
use StaticPHP\DI\ApplicationContext;
|
||||||
use StaticPHP\Doctor\CheckResult;
|
use StaticPHP\Doctor\CheckResult;
|
||||||
use StaticPHP\Runtime\Shell\Shell;
|
use StaticPHP\Runtime\Shell\Shell;
|
||||||
|
use StaticPHP\Runtime\SystemTarget;
|
||||||
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
use StaticPHP\Toolchain\Interface\ToolchainInterface;
|
||||||
use StaticPHP\Toolchain\MuslToolchain;
|
use StaticPHP\Toolchain\MuslToolchain;
|
||||||
use StaticPHP\Toolchain\ZigToolchain;
|
use StaticPHP\Toolchain\ZigToolchain;
|
||||||
@@ -27,7 +28,14 @@ class LinuxMuslCheck
|
|||||||
public static function optionalCheck(): bool
|
public static function optionalCheck(): bool
|
||||||
{
|
{
|
||||||
$toolchain = ApplicationContext::get(ToolchainInterface::class);
|
$toolchain = ApplicationContext::get(ToolchainInterface::class);
|
||||||
return $toolchain instanceof MuslToolchain || $toolchain instanceof ZigToolchain && !LinuxUtil::isMuslDist() && !str_contains(getenv('SPC_TARGET') ?: '', 'gnu');
|
return PHP_OS_FAMILY === 'Linux' && (
|
||||||
|
$toolchain instanceof MuslToolchain || (
|
||||||
|
$toolchain instanceof ZigToolchain
|
||||||
|
&& !LinuxUtil::isMuslDist()
|
||||||
|
&& SystemTarget::getLibc() === 'musl'
|
||||||
|
&& !$toolchain->isStatic()
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @noinspection PhpUnused */
|
/** @noinspection PhpUnused */
|
||||||
|
|||||||
Reference in New Issue
Block a user