Skip to content

Commit 8478665

Browse files
Add diagnostics for those who build with WASI command line ABI (#202)
1 parent ac92be3 commit 8478665

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

Runtime/src/index.ts

+8
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ export class SwiftRuntime {
2727

2828
setInstance(instance: WebAssembly.Instance) {
2929
this._instance = instance;
30+
if (typeof (this.exports as any)._start === "function") {
31+
throw new Error(
32+
`JavaScriptKit supports only WASI reactor ABI.
33+
Please make sure you are building with:
34+
-Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor
35+
`
36+
);
37+
}
3038
if (this.exports.swjs_library_version() != this.version) {
3139
throw new Error(
3240
`The versions of JavaScriptKit are incompatible.

Sources/JavaScriptKit/Runtime/index.js

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/JavaScriptKit/Runtime/index.mjs

+6
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)