Skip to content

Commit

Permalink
update wasi-libc and fix out-of-date tests (#403)
Browse files Browse the repository at this point in the history
This updates the `wasi-libc` submodule to point to `main` and also:

- update tests/testcase.sh to use new wasm32-wasip2 target name
- update various tests/**/*.expected files to match Wasmtime output

Signed-off-by: Joel Dice <[email protected]>
  • Loading branch information
dicej authored Apr 3, 2024
1 parent a50a641 commit a7b2182
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/wasi-libc
Submodule wasi-libc updated 40 files
+6 −0 .github/workflows/main.yml
+74 −6 Makefile
+1 −0 expected/wasm32-wasip1-threads/defined-symbols.txt
+1 −0 expected/wasm32-wasip1-threads/include-all.c
+1 −0 expected/wasm32-wasip1/include-all.c
+53 −0 expected/wasm32-wasip2/defined-symbols.txt
+2 −0 expected/wasm32-wasip2/include-all.c
+61 −4 expected/wasm32-wasip2/predefined-macros.txt
+46 −1 libc-bottom-half/cloudlibc/src/libc/poll/poll.c
+56 −1 libc-bottom-half/cloudlibc/src/libc/sys/ioctl/ioctl.c
+38 −64 libc-bottom-half/cloudlibc/src/libc/sys/select/pselect.c
+3 −3 libc-bottom-half/crt/crt1-command.c
+53 −0 libc-bottom-half/headers/private/wasi/sockets_utils.h
+3 −3 libc-bottom-half/headers/public/__header_dirent.h
+34 −0 libc-bottom-half/headers/public/__header_sys_socket.h
+5 −0 libc-bottom-half/headers/public/__wasi_snapshot.h
+75 −0 libc-bottom-half/sources/__wasilibc_fd_renumber.c
+0 −0 libc-bottom-half/sources/accept-wasip1.c
+143 −0 libc-bottom-half/sources/accept-wasip2.c
+53 −0 libc-bottom-half/sources/bind.c
+197 −0 libc-bottom-half/sources/connect.c
+0 −2 libc-bottom-half/sources/descriptor_table.c
+229 −0 libc-bottom-half/sources/getsockpeername.c
+115 −0 libc-bottom-half/sources/listen.c
+238 −0 libc-bottom-half/sources/netdb.c
+257 −0 libc-bottom-half/sources/poll-wasip2.c
+198 −0 libc-bottom-half/sources/recv.c
+249 −0 libc-bottom-half/sources/send.c
+80 −0 libc-bottom-half/sources/shutdown.c
+107 −0 libc-bottom-half/sources/socket.c
+462 −0 libc-bottom-half/sources/sockets_utils.c
+683 −0 libc-bottom-half/sources/sockopt.c
+1 −0 libc-top-half/musl/arch/wasm32/bits/setjmp.h
+5 −0 libc-top-half/musl/include/netdb.h
+6 −4 libc-top-half/musl/include/setjmp.h
+12 −6 libc-top-half/musl/include/sys/socket.h
+26 −10 libc-top-half/musl/src/env/__init_tls.c
+83 −0 libc-top-half/musl/src/setjmp/wasm32/rt.c
+6 −0 libc-top-half/musl/src/thread/pthread_getattr_np.c
+3 −3 test/Makefile
6 changes: 6 additions & 0 deletions tests/general/abort.c.wasm32-wasi.stderr.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Error: failed to run main module `abort.c.---.wasm`

Caused by:
0: failed to invoke command default
1: error while executing at wasm backtrace:
2: wasm trap: wasm `unreachable` instruction executed
6 changes: 6 additions & 0 deletions tests/general/abort.c.wasm32-wasip2.stderr.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Error: failed to run main module `abort.c.---.wasm`

Caused by:
0: failed to invoke `run` function
1: error while executing at wasm backtrace:
2: wasm trap: wasm `unreachable` instruction executed
7 changes: 7 additions & 0 deletions tests/general/assert-fail.c.wasm32-wasip2.stderr.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
Assertion failed: false (assert-fail.c: main: 5)
Error: failed to run main module `assert-fail.c.---.wasm`

Caused by:
0: failed to invoke `run` function
1: error while executing at wasm backtrace:
2: wasm trap: wasm `unreachable` instruction executed
6 changes: 6 additions & 0 deletions tests/general/sigabrt.c.wasm32-wasip2.stderr.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
raising SIGABRT...
Program received fatal signal: Aborted
Error: failed to run main module `sigabrt.c.---.wasm`

Caused by:
0: failed to invoke `run` function
2 changes: 1 addition & 1 deletion tests/testcase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if [ "$runwasi" == "" ]; then
exit 0
fi

if [ "$target" == "wasm32-wasi-preview2" -a -n "$adapter" -a -n "$wasm_tools" ]; then
if [ "$target" == "wasm32-wasip2" -a -n "$adapter" -a -n "$wasm_tools" ]; then
"$wasm_tools" component new --adapt "$adapter" "$wasm" -o "$wasm"
run_args="--wasm component-model"
fi
Expand Down

0 comments on commit a7b2182

Please sign in to comment.