Skip to content

Commit 9315be9

Browse files
authored
Merge pull request #110 from wingo/update-wasi-sdk
Update to wasi-sdk 27, for test compilation
2 parents 0603fbe + dd89548 commit 9315be9

File tree

3 files changed

+14
-10
lines changed

3 files changed

+14
-10
lines changed

.github/workflows/compile-tests.yml

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,22 +82,26 @@ jobs:
8282
matrix:
8383
os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm]
8484
env:
85-
WASI_VERSION: 17
85+
WASI_VERSION: 27
8686
steps:
8787
- name: Check out repository code
8888
uses: actions/checkout@v3
8989

9090
- name: Setup WASI SDK download - Linux
9191
if: matrix.os == 'ubuntu-latest'
92-
run: echo SYSTEM_NAME=linux >> $GITHUB_ENV
92+
run: echo SYSTEM_NAME=x86_64-linux >> $GITHUB_ENV
9393

9494
- name: Setup WASI SDK download - MacOS
9595
if: matrix.os == 'macos-latest'
96-
run: echo SYSTEM_NAME=macos >> $GITHUB_ENV
96+
run: echo SYSTEM_NAME=arm64-macos >> $GITHUB_ENV
9797

98-
- name: Setup WASI SDK download - Windows
99-
if: startsWith(matrix.os, 'windows')
100-
run: echo SYSTEM_NAME=mingw >> $env:GITHUB_ENV
98+
- name: Setup WASI SDK download - Windows (x86)
99+
if: matrix.os == 'windows-latest'
100+
run: echo SYSTEM_NAME=x86_64-windows >> $env:GITHUB_ENV
101+
102+
- name: Setup WASI SDK download - Windows (ARM)
103+
if: matrix.os == 'windows-11-arm'
104+
run: echo SYSTEM_NAME=arm64-windows >> $env:GITHUB_ENV
101105

102106
- name: Download WASI SDK
103107
working-directory: tests/c
@@ -112,12 +116,12 @@ jobs:
112116
- name: Check formatting
113117
if: matrix.os == 'ubuntu-latest'
114118
working-directory: tests/c
115-
run: find testsuite -regex '.*\.\(c\|h\)' -print0 | xargs -0 -n1 ./wasi-sdk-${WASI_VERSION}.0/bin/clang-format --style=file --dry-run -Werror
119+
run: find testsuite -regex '.*\.\(c\|h\)' -print0 | xargs -0 -n1 ./wasi-sdk-${WASI_VERSION}.0-${SYSTEM_NAME}/bin/clang-format --style=file --dry-run -Werror
116120

117121
- name: Build tests
118122
shell: bash
119123
working-directory: tests/c
120-
run: CC="./wasi-sdk-${WASI_VERSION}.0/bin/clang" ./build.sh
124+
run: CC="./wasi-sdk-${WASI_VERSION}.0-${SYSTEM_NAME}/bin/clang" ./build.sh
121125

122126
- name: Upload precompiled tests
123127
if: matrix.os == 'ubuntu-latest'

tests/c/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,6 @@ for input in testsuite/*.c; do
88

99
if [ "$input" -nt "$output" ]; then
1010
echo "Compiling $input"
11-
$CC "$input" -o "$output"
11+
$CC --target=wasm32-wasip1 "$input" -o "$output"
1212
fi
1313
done

tests/c/testsuite/fopen-with-no-access.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ int main() {
77
FILE *file = fopen("fs-tests.dir/file", "r");
88

99
assert(file == NULL);
10-
assert(errno == ENOTCAPABLE);
10+
assert(errno == ENOTCAPABLE || errno == ENOENT);
1111

1212
return EXIT_SUCCESS;
1313
}

0 commit comments

Comments
 (0)