Suggestions

This commit is contained in:
crazywhalecc
2025-06-29 16:00:17 +08:00
parent 0598eff9c5
commit 977fbaa8ef
30 changed files with 196 additions and 215 deletions

View File

@@ -4,7 +4,6 @@ declare(strict_types=1);
namespace SPC\store;
use SPC\builder\linux\SystemUtil;
use SPC\exception\DownloaderException;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
@@ -594,12 +593,8 @@ class Downloader
{
$os_family = PHP_OS_FAMILY;
$gnu_arch = getenv('GNU_ARCH') ?: 'unknown';
$libc = match (getenv('SPC_TARGET')) {
SPCTarget::MUSL_STATIC, SPCTarget::MUSL => 'musl',
SPCTarget::GLIBC => 'glibc',
default => 'default',
};
$libc_version = SystemUtil::getLibcVersionIfExists() ?? 'default';
$libc = SPCTarget::getLibc();
$libc_version = SPCTarget::getLibcVersion() ?? 'default';
return "{$source}-{$os_family}-{$gnu_arch}-{$libc}-{$libc_version}";
}

View File

@@ -11,6 +11,7 @@ use SPC\builder\unix\UnixBuilderBase;
use SPC\exception\FileSystemException;
use SPC\exception\RuntimeException;
use SPC\exception\WrongUsageException;
use SPC\util\SPCTarget;
class SourcePatcher
{
@@ -456,7 +457,7 @@ class SourcePatcher
public static function patchFfiCentos7FixO3strncmp(): bool
{
if (PHP_OS_FAMILY !== 'Linux' || SystemUtil::getLibcVersionIfExists() > '2.17') {
if (!($ver = SPCTarget::getLibcVersion()) || version_compare($ver, '2.17', '>')) {
return false;
}
if (!file_exists(SOURCE_PATH . '/php-src/main/php_version.h')) {

View File

@@ -7,7 +7,6 @@ namespace SPC\store\pkg;
use SPC\store\Downloader;
use SPC\store\FileSystem;
use SPC\store\LockFile;
use SPC\util\GlobalEnvManager;
class GoXcaddy extends CustomPackage
{
@@ -62,7 +61,6 @@ class GoXcaddy extends CustomPackage
FileSystem::extractPackage($name, $source_type, $filename, $extract);
GlobalEnvManager::init();
// install xcaddy
shell()
->appendEnv([