Skip to content

Commit 762c554

Browse files
committed
test zig
1 parent a8c7057 commit 762c554

File tree

2 files changed

+21
-9
lines changed

2 files changed

+21
-9
lines changed

src/SPC/util/GlobalEnvManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ public static function init(): void
101101
self::putenv("{$k}={$v}");
102102
}
103103
}
104-
if (str_contains((string)getenv('CC'), 'zig') || str_contains((string)getenv('CXX'), 'zig')) {
104+
if (str_contains((string) getenv('CC'), 'zig') || str_contains((string) getenv('CXX'), 'zig')) {
105105
$zigEnv = Zig::getEnvironment();
106106
foreach ($zigEnv as $key => $value) {
107107
if ($key === 'PATH') {

src/globals/test-extensions.php

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313

1414
// test php version (8.1 ~ 8.4 available, multiple for matrix)
1515
$test_php_version = [
16-
'8.1',
17-
'8.2',
18-
'8.3',
16+
// '8.1',
17+
// '8.2',
18+
// '8.3',
1919
'8.4',
2020
];
2121

@@ -26,12 +26,21 @@
2626
// 'macos-15',
2727
// 'ubuntu-latest',
2828
// 'ubuntu-22.04',
29-
// 'ubuntu-24.04',
3029
// 'ubuntu-22.04-arm',
31-
// 'ubuntu-24.04-arm',
32-
'windows-latest',
30+
'ubuntu-24.04',
31+
'ubuntu-24.04-arm',
32+
// 'windows-latest',
3333
];
3434

35+
$zig = true;
36+
// temporary!
37+
if ($zig) {
38+
putenv('SPC_LIBC=glibc');
39+
putenv('SPC_LIBC_VERSION=2.17');
40+
putenv('CC=zig-cc');
41+
putenv('CXX=zig-c++');
42+
}
43+
3544
// whether enable thread safe
3645
$zts = true;
3746

@@ -48,13 +57,13 @@
4857

4958
// If you want to test your added extensions and libs, add below (comma separated, example `bcmath,openssl`).
5059
$extensions = match (PHP_OS_FAMILY) {
51-
'Linux', 'Darwin' => 'curl',
60+
'Linux', 'Darwin' => 'curl,iconv',
5261
'Windows' => 'intl',
5362
};
5463

5564
// If you want to test shared extensions, add them below (comma separated, example `bcmath,openssl`).
5665
$shared_extensions = match (PHP_OS_FAMILY) {
57-
'Linux' => 'uv',
66+
'Linux' => 'event,uv,intl,gettext',
5867
'Darwin' => '',
5968
'Windows' => '',
6069
};
@@ -208,6 +217,9 @@ function quote2(string $param): string
208217
passthru($prefix . $down_cmd, $retcode);
209218
break;
210219
case 'build_cmd':
220+
if ($zig) {
221+
passthru("{$prefix}install-pkg zig --debug", $retcode);
222+
}
211223
passthru($prefix . $build_cmd . ' --build-cli --build-micro', $retcode);
212224
break;
213225
case 'build_embed_cmd':

0 commit comments

Comments
 (0)