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

tokio: enable rt-multi-thread for wasm32-wasi-preview1-threads target #6510

Merged
merged 1 commit into from
Apr 24, 2024

Conversation

Brooooooklyn
Copy link
Contributor

Motivation

Enable rt-multi-thread for wasm32-wasi-preview1-threads target

@github-actions github-actions bot added R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR labels Apr 23, 2024
@Brooooooklyn Brooooooklyn marked this pull request as draft April 23, 2024 10:47
@Darksonn Darksonn added A-tokio Area: The main tokio crate M-runtime Module: tokio/runtime T-wasm Topic: Web Assembly labels Apr 23, 2024
Comment on lines +917 to +919
target:
- wasm32-wasi
- wasm32-wasi-preview1-threads
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do these target names interact with #6484?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can change the wasm32-wasi-preview1-threads to wasm32-wasip1-threads after the name changed

tokio/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@Darksonn Darksonn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you.

@Darksonn Darksonn merged commit 9ed5957 into tokio-rs:master Apr 24, 2024
83 checks passed
@namse
Copy link
Contributor

namse commented May 27, 2024

@Darksonn Hello! I'm in need of this particular feature, however it does not appear to have been released yet. Would you happen to know if there is an expected timeframe for when it might become available?

@Darksonn
Copy link
Contributor

This week.

@edusporto
Copy link

I'm trying to compile a project with the feature rt-multi-thread with target --target=wasm32-wasip1-threads on tokio 1.39.3, which should have this feature as per this PR, but I'm getting the following error:

error: Only features sync,macros,io-util,rt,time are supported on wasm.
   --> /Users/me/.cargo/registry/src/index.crates.io-6f17d22bba15001f/tokio-1.39.3/src/lib.rs:467:1
    |
467 | compile_error!("Only features sync,macros,io-util,rt,time are supported on wasm.");
    | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The full command I'm running to get it to compile is:

RUSTFLAGS='-L /opt/wasi-sdk-24.0/share/wasi-sysroot/lib/wasm32-wasip1-threads -lstatic=c++ -lstatic=c++abi' CXXSTDLIB=c++ CC=/opt/wasi-sdk-24.0/bin/clang CXX=/opt/wasi-sdk-24.0/bin/clang++ CXXFLAGS="-fno-exceptions" CFLAGS="-Wno-everything" cargo build --release --target=wasm32-wasip1-threads

Am I missing something? It seems like it should be working since this PR was merged in v1.38.0

@Darksonn
Copy link
Contributor

It's unstable. Please see the docs for information on using unstable features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tokio Area: The main tokio crate M-runtime Module: tokio/runtime R-loom-current-thread Run loom current-thread tests on this PR R-loom-multi-thread Run loom multi-thread tests on this PR R-loom-multi-thread-alt Run loom multi-thread alt tests on this PR T-wasm Topic: Web Assembly
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants