Skip to content

Commit 408b3b4

Browse files
committed
try to test with zig?
1 parent 55fd7ba commit 408b3b4

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

src/SPC/store/scripts/zig-cc.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,12 @@ while [[ $# -gt 0 ]]; do
3434
esac
3535
done
3636

37-
output=$(zig cc -target ${SPC_TARGET} -lstdc++ ${COMPILER_EXTRA} "${PARSED_ARGS[@]}" 2>&1)
37+
TARGET=""
38+
if [ -n "$SPC_TARGET" ]; then
39+
TARGET="-target $SPC_TARGET"
40+
else
41+
42+
output=$(zig cc $TARGET -lstdc++ $COMPILER_EXTRA "${PARSED_ARGS[@]}" 2>&1)
3843
status=$?
3944

4045
if [ $status -eq 0 ]; then
@@ -43,8 +48,8 @@ if [ $status -eq 0 ]; then
4348
fi
4449

4550
if echo "$output" | grep -q "version '.*' in target triple"; then
46-
echo "$output" | grep -v "version '.*' in target triple"
51+
echo "$output" | grep -v "version '.*' in target triple"
4752
exit 0
4853
else
49-
exec zig cc -target ${SPC_TARGET} ${COMPILER_EXTRA} "${PARSED_ARGS[@]}"
54+
exec zig cc $TARGET $COMPILER_EXTRA "${PARSED_ARGS[@]}"
5055
fi

src/SPC/toolchain/ToolchainManager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ToolchainManager
2020
public static function getToolchainClass(): string
2121
{
2222
$libc = getenv('SPC_LIBC');
23-
if ($libc !== false && !getenv('SPC_TARGET')) {
23+
if ($libc && !getenv('SPC_TARGET')) {
2424
// TODO: @crazywhalecc this breaks tests
2525
// logger()->warning('SPC_LIBC is deprecated, please use SPC_TARGET instead.');
2626
return match ($libc) {

src/globals/test-extensions.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
// 'ubuntu-latest', // bin/spc-alpine-docker for x86_64
2828
'ubuntu-22.04', // bin/spc-gnu-docker for x86_64
2929
'ubuntu-24.04', // bin/spc for x86_64
30-
// 'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
31-
// 'ubuntu-24.04-arm', // bin/spc for arm64
30+
'ubuntu-22.04-arm', // bin/spc-gnu-docker for arm64
31+
'ubuntu-24.04-arm', // bin/spc for arm64
3232
// 'windows-latest', // .\bin\spc.ps1
3333
];
3434

@@ -158,6 +158,7 @@ function quote2(string $param): string
158158
break;
159159
case 'ubuntu-24.04':
160160
case 'ubuntu-24.04-arm':
161+
putenv('SPC_TARGET=native-linux-gnu');
161162
if (str_contains((string) getenv('SPC_TARGET'), '-gnu')) {
162163
$shared_cmd = ' --build-shared=' . quote2($shared_extensions) . ' ';
163164
}

0 commit comments

Comments
 (0)