Skip to content

Move a wasm32-wasi-preview1-threads target to tier 2 #661

Closed

Description

Proposal

The support for wasm32-wasi-preview1-threads target was added to a compiler as part of the PR: rust-lang/rust#112922. The target extends wasm32-wasi target (soon becoming a wasm32-wasi-preview1 target: rust-lang/stdarch#1417) by adding support for spawning threads based on the wasi-threads proposal. The wasm32-wasi-preview1-threads target uses the same source code as wasm32-wasi target for stdlib, but it enables additional flags (+atomics,+bulk-memory,+mutable-globals) and links against wasm32-wasi-threads libraries from WASI-SDK.

It was decided by the community that wasi-threads proposal will not proceed to the next stage as the threading support will be in the future added to Core WebAssembly standard (WIP proposal: https://github.com/abrown/thread-spawn). Given the early stage of the new, thread-spawn proposal, the wasi-threads proposal will be finalized even though it doesn't become part of WASI standard (so teams with a need for threading support can use it for the time being).

We propose moving the target to tier 2, given that:

The reason behind adding a new target as oppose to using existing wasm32-wasi / wasm32-wasi-preview1 was well explained in the original MCP: #574

There were also concerns raised by the community regarding adding this target in general, but they are addressed below:

  • wasi-threads is not part of the standard, and thus, experimental - as mentioned above, the proposal wasn't included in the standard, but there's an ongoing effort to finalize it and keep it as an extension of WASI snapshot preview1.
  • we might end-up with multiple WASM targets for supporting various set of features - Threads support is quite different to other extensions, as enabling it affects the implementation of the standard library. There are not many proposals that affect either the implementation of standard library or the ABI, so we don't think it is a concern.

We have reviewed the requirements for the tier 2 targets. The target meets all of the requirements except for documentation gaps which will be added if the MCP is accepted.

Our team at Amazon Prime Video will run tests regularly and fix build failures.

Mentors or Reviewers

@pnkfelix

Process

The main points of the Major Change Process are as follows:

  • File an issue describing the proposal.
  • A compiler team member or contributor who is knowledgeable in the area can second by writing @rustbot second.
    • Finding a "second" suffices for internal changes. If however, you are proposing a new public-facing feature, such as a -C flag, then full team check-off is required.
    • Compiler team members can initiate a check-off via @rfcbot fcp merge on either the MCP or the PR.
  • Once an MCP is seconded, the Final Comment Period begins. If no objections are raised after 10 days, the MCP is considered approved.

You can read more about Major Change Proposals on forge.

Comments

This issue is not meant to be used for technical discussion. There is a Zulip stream for that. Use this issue to leave procedural comments, such as volunteering to review, indicating that you second the proposal (or third, etc), or raising a concern that you would like to be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    T-compilerAdd this label so rfcbot knows to poll the compiler teammajor-changeA proposal to make a major change to rustcmajor-change-acceptedA major change proposal that was accepted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions