Skip to content

Add diagnostics for those who build with WASI command line ABI #202

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Runtime/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ export class SwiftRuntime {

setInstance(instance: WebAssembly.Instance) {
this._instance = instance;
if (typeof (this.exports as any)._start === "function") {
throw new Error(
`JavaScriptKit supports only WASI reactor ABI.
Please make sure you are building with:
-Xswiftc -Xclang-linker -Xswiftc -mexec-model=reactor
`
);
}
if (this.exports.swjs_library_version() != this.version) {
throw new Error(
`The versions of JavaScriptKit are incompatible.
Expand Down
6 changes: 6 additions & 0 deletions Sources/JavaScriptKit/Runtime/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions Sources/JavaScriptKit/Runtime/index.mjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.