-
Notifications
You must be signed in to change notification settings - Fork 69
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
Wasm minimal features target #791
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. Concerns or objections to the proposal should be discussed on Zulip and formally registered here by adding a comment with the following syntax:
Concerns can be lifted with:
See documentation at https://forge.rust-lang.org cc @rust-lang/compiler @rust-lang/compiler-contributors |
@rustbot second |
@rustbot label -final-comment-period +major-change-accepted |
Add wasm32v1-none target (compiler-team/rust-lang#791) This is a preliminary implementation of the MCP discussed in [compiler-team#791](rust-lang/compiler-team#791). It's not especially "major" but you know, process! Anyway it adds a new wasm32v1-none target which just pins down a set of wasm features. I think this is close to the consensus that emerged when discussing it on Zulip so I figured I'd sketch to see how hard it is. Turns out not very.
Rollup merge of rust-lang#131487 - graydon:wasm32v1-none, r=alexcrichton Add wasm32v1-none target (compiler-team/rust-lang#791) This is a preliminary implementation of the MCP discussed in [compiler-team#791](rust-lang/compiler-team#791). It's not especially "major" but you know, process! Anyway it adds a new wasm32v1-none target which just pins down a set of wasm features. I think this is close to the consensus that emerged when discussing it on Zulip so I figured I'd sketch to see how hard it is. Turns out not very.
Proposal
To define a new target that is a variant of
wasm32v1-none
that specifies a small and fixed set of wasm proposals rather than the open-ended (and growing) set currently implied.Currently the evolution of the wasm32-* target(s) is favouring the audience of users who want ever-expanding sets of software to run on wasm. So as wasm features become widely supported, the default set of features enabled in rustc expands. This is understandable given that main audience but it neglects the interests of a different audience, who are aiming to develop minimal, stable, and security-focused implementations. Each new feature that gets enabled in rust's default wasm targets imposes an implementation burden on wasm engines as well as requiring field upgrades of software embedding them in order to keep consuming code produced by stable rustc.
Implementations targeting small / embedded environments, or with limited implementation resources, currently have to resort to getting their target software built with
+nightly -Ctarget-cpu=mvp -Ctarget-features=+mutable-globals -Zbuild-std
in order to get a minimal profile of wasm. It would be nice not to require that: build-std adds overhead to every build, and more significantly nightly requires users to sacrifice the stability guarantees of rust's stable channel, when stability is exactly what this audience desires.If a new target is agreeable, I think there are three main details to hash out:
mutable-globals
made it into 1.0, andbulk-memory
,nontrapping-fptoint
andsign-ext
made it into 2.0. LLVM recognizes "mvp" as a CPU string as well as "bleeding-edge" and "generic". The latter includessign-ext
andmutable-globals
and does not, I think, correspond precisely to any spec. So I think if we're targeting v1, that makes "-Ctarget-cpu=mvp -Ctarget-features=+mutable-globals".wasm32v1-none
(as an abbreviation of the more-formally-correct but annoyingly-verbosewasm32v1-unknown-none
-- assuming nobody's ever going to identify a specific wasm target vendor).std
, given thatstd
is almost entirely non-functional stubs on wasm32-unknown-unknown (no wasi). Zulip consensus seems to be "don't build std". Hence "none" for the -sys component.Since this is a fairly trivial change, I just went ahead and sketched it. It seems to work: rust-lang/rust#131487
Mentors or Reviewers
I suspect @alexcrichton is most likely interested in review, but I could be wrong!
Process
The main points of the Major Change Process are as follows:
@rustbot second
.-C flag
, then full team check-off is required.@rfcbot fcp merge
on either the MCP or the PR.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.
The text was updated successfully, but these errors were encountered: