Skip to content
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

wasm32-wasip1-threads #55

Draft
wants to merge 2 commits into
base: wasm32-wasi
Choose a base branch
from
Draft

wasm32-wasip1-threads #55

wants to merge 2 commits into from

Conversation

kkebo
Copy link
Owner

@kkebo kkebo commented Jun 8, 2024

No description provided.

@kkebo kkebo self-assigned this Jun 8, 2024
@kkebo
Copy link
Owner Author

kkebo commented Jun 9, 2024

a-Shell cannot run this executable.

$ swift-format-threads.wasm lint -rs format_test/
wasm: TypeError: import env:memory must be an object (evaluating 'new WebAssembly.Instance(module, wasi.getImports(module))')

@kkebo
Copy link
Owner Author

kkebo commented Jun 9, 2024

Wasmtime also cannot run it.

$ wasmtime --dir / --wasm max-wasm-stack=$STACK_SIZE .build/release/swift-formatPackageTests.wasm
Error: failed to run main module `.build/release/swift-formatPackageTests.wasm`

Caused by:
    0: failed to instantiate ".build/release/swift-formatPackageTests.wasm"
    1: unknown import: `env::memory` has not been defined

@kkebo
Copy link
Owner Author

kkebo commented Jun 9, 2024

It seems that runtime support is required to run binaries that built for wasm32-unknown-wasip1-threads.

https://surma.dev/postits/wasi-threads/

@kkebo
Copy link
Owner Author

kkebo commented Jun 9, 2024

Wasmtime 21.0.1 requires the --wasi-modules experimental-wasi-threads -S threads flag.

@kkebo kkebo force-pushed the wasm32-wasip1-threads branch 2 times, most recently from 9e9cf60 to da9d9b5 Compare September 1, 2024 03:56
Package.swift Outdated Show resolved Hide resolved
@kkebo kkebo force-pushed the wasm32-wasip1-threads branch 2 times, most recently from 566e554 to 63da388 Compare September 17, 2024 17:06
@kkebo
Copy link
Owner Author

kkebo commented Oct 7, 2024

Now, the wasm32-wasip1-threads branches of swift-markdown and swift-cmark have been unified with the wasm32-wasi branches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant