Skip to content

Commit bebcb97

Browse files
committed
conflicts with shared tests
1 parent ba7f994 commit bebcb97

File tree

4 files changed

+9
-10
lines changed

4 files changed

+9
-10
lines changed

src/SPC/builder/linux/SystemUtil.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66

77
use SPC\builder\traits\UnixSystemUtilTrait;
88
use SPC\exception\RuntimeException;
9+
use SPC\toolchain\ToolchainManager;
10+
use SPC\toolchain\ZigToolchain;
911

1012
class SystemUtil
1113
{
@@ -231,8 +233,7 @@ public static function getLibcVersionIfExists(string $libc): ?string
231233

232234
public static function getExtraRuntimeObjects(): string
233235
{
234-
$cc = getenv('CC');
235-
if (!$cc || !str_contains($cc, 'zig')) {
236+
if (ToolchainManager::getToolchainClass() !== ZigToolchain::class) {
236237
return '';
237238
}
238239

src/SPC/toolchain/ToolchainManager.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ class ToolchainManager
2020
public static function getToolchainClass(): string
2121
{
2222
$libc = getenv('SPC_LIBC');
23-
if ($libc !== false) {
23+
if ($libc !== false && !getenv('SPC_TARGET')) {
2424
logger()->warning('SPC_LIBC is deprecated, please use SPC_TARGET instead.');
2525
return match ($libc) {
2626
'musl' => SystemUtil::isMuslDist() ? GccNativeToolchain::class : MuslToolchain::class,
27-
'glibc' => !SystemUtil::isMuslDist() ? GccNativeToolchain::class : throw new WrongUsageException('SPC_TARGET must be musl for musl dist.'),
27+
'glibc' => !SystemUtil::isMuslDist() ? GccNativeToolchain::class : throw new WrongUsageException('SPC_LIBC must be musl for musl dist.'),
2828
default => throw new WrongUsageException('Unsupported SPC_LIBC value: ' . $libc),
2929
};
3030
}

src/SPC/util/SPCConfigUtil.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@
66

77
use SPC\builder\BuilderBase;
88
use SPC\builder\BuilderProvider;
9-
use SPC\builder\linux\SystemUtil;
109
use SPC\builder\macos\MacOSBuilder;
1110
use SPC\exception\FileSystemException;
1211
use SPC\exception\RuntimeException;
1312
use SPC\exception\WrongUsageException;
1413
use SPC\store\Config;
14+
use SPC\toolchain\ToolchainManager;
15+
use SPC\toolchain\ZigToolchain;
1516
use Symfony\Component\Console\Input\ArgvInput;
1617

1718
class SPCConfigUtil
@@ -71,7 +72,7 @@ public function config(array $extensions = [], array $libraries = [], bool $incl
7172
if ($this->builder->hasCpp()) {
7273
$libs .= $this->builder instanceof MacOSBuilder ? ' -lc++' : ' -lstdc++';
7374
}
74-
if (SystemUtil::getCCType() === 'clang') {
75+
if (ToolchainManager::getToolchainClass() === ZigToolchain::class) {
7576
$libs .= ' -lunwind';
7677
}
7778
// mimalloc must come first

src/globals/test-extensions.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
// You can use `common`, `bulk`, `minimal` or `none`.
7373
// note: combination is only available for *nix platform. Windows must use `none` combination
7474
$base_combination = match (PHP_OS_FAMILY) {
75-
'Linux', 'Darwin' => 'common',
75+
'Linux', 'Darwin' => 'minimal',
7676
'Windows' => 'none',
7777
};
7878

@@ -214,9 +214,6 @@ function quote2(string $param): string
214214
passthru($prefix . $down_cmd, $retcode);
215215
break;
216216
case 'build_cmd':
217-
if ($zig) {
218-
passthru("{$prefix}install-pkg zig --debug", $retcode);
219-
}
220217
passthru($prefix . $build_cmd . ' --build-cli --build-micro', $retcode);
221218
break;
222219
case 'build_embed_cmd':

0 commit comments

Comments
 (0)