Skip to content

Commit 78a50d9

Browse files
Export main and execute _initialize and main in test entry
IntegrationTests are unintentionally disabled since 0a38d70 because reactor mode doesn't export `_start` and `WASI.start` doesn't do anything except setting the instance to WASI module. So export `main` manually, and call `_initialize` according to the "new-style commands" described in https://github.com/WebAssembly/WASI/blob/59cbe140561db52fc505555e859de884e0ee7f00/legacy/application-abi.md#current-unstable-abi Symbol support (081784b) broke tests silently, so revert it for now.
1 parent 95d0c4c commit 78a50d9

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

IntegrationTests/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ TestSuites/.build/$(CONFIGURATION)/%.wasm: FORCE
88
--triple wasm32-unknown-wasi \
99
--configuration $(CONFIGURATION) \
1010
-Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor \
11+
-Xlinker --export=main \
1112
$(SWIFT_BUILD_FLAGS)
1213

1314
dist/%.wasm: TestSuites/.build/$(CONFIGURATION)/%.wasm

IntegrationTests/lib.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ const startWasiTask = async (wasmPath) => {
4545
swift.setInstance(instance);
4646
// Start the WebAssembly WASI instance!
4747
wasi.start(instance);
48+
instance.exports._initialize();
49+
instance.exports.main();
4850
};
4951

5052
module.exports = { startWasiTask };

0 commit comments

Comments
 (0)