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

Document WebAssembly target feature expectations #128511

Merged
merged 9 commits into from
Aug 23, 2024

Conversation

alexcrichton
Copy link
Member

@alexcrichton alexcrichton commented Aug 1, 2024

This commit is a result of the discussion on #128475 and incorporates parts of #109807 as well. This is all done as a new page of documentation for the wasm32-unknown-unknown target which previously did not exist. This new page goes into details about the preexisting target and additionally documents the expectations for WebAssembly features and code generation.

The tl;dr is that LLVM will enable features over time after most engines have had support for awhile. Compiling without features requires -Ctarget-cpu=mvp to rustc plus -Zbuild-std to Cargo.

Closes #109807
Closes #119811
Closes #128475

EDIT: for the relnotes label please see this comment for recommended release notes.

This commit is a result of the discussion on rust-lang#128475 and incorporates
parts of rust-lang#109807 as well. This is all done as a new page of
documentation for the `wasm32-unknown-unknown` target which previously
did not exist. This new page goes into details about the preexisting
target and additionally documents the expectations for WebAssembly
features and code generation.

The tl;dr is that LLVM will enable features over time after most engines
have had support for awhile. Compiling without features requires
`-Ctarget-cpu=mvp` to rustc plus `-Zbuild-std` to Cargo.

Closes rust-lang#109807
Closes rust-lang#128475
@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2024

r? @GuillaumeGomez

rustbot has assigned @GuillaumeGomez.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 1, 2024
@rustbot
Copy link
Collaborator

rustbot commented Aug 1, 2024

Some changes occurred in src/doc/rustc/src/platform-support

cc @Noratrieb

@alexcrichton
Copy link
Member Author

If this is accepted then I will additionally comment on #127513 with a recommended rewording of the release notes to indicate that this does affect WebAssembly binaries.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

Copy link

@bb010g bb010g left a comment

Choose a reason for hiding this comment

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

A wording nit & spelling nits.

src/doc/rustc/src/platform-support/wasm32-wasip1.md Outdated Show resolved Hide resolved
src/doc/rustc/src/platform-support/wasm32-wasip2.md Outdated Show resolved Hide resolved
@workingjubilee
Copy link
Member

@alexcrichton Is it possible to get an rmake test for the workarounds here, or landing a test in rust-lang/cargo?

@alexcrichton
Copy link
Member Author

I was looking into that yeah and was hoping I could combine -Clto somehow to get a test in-tree, but the conclusion ended up being that it didn't have the right behavior of rewriting target features per function that I thought was happening. That means that such a test requires -Zbuild-std which while there is one test in tree that does this that test looks relatively complicated and specialized so I was wary to try to copy it.

I can look into adding a test in Cargo, yeah, but it feels like an odd location for such a test given that the regressions, if any, would likely come from this repo instead of Cargo. One option would be to refactor the existing Zbuild-std test in this repo, but I'm also not sure if folks are keen on expanding that due to the amount of time such a test would take compiling the standard library.

@jieyouxu
Copy link
Member

jieyouxu commented Aug 9, 2024

I was looking into that yeah and was hoping I could combine -Clto somehow to get a test in-tree, but the conclusion ended up being that it didn't have the right behavior of rewriting target features per function that I thought was happening. That means that such a test requires -Zbuild-std which while there is one test in tree that does this that test looks relatively complicated and specialized so I was wary to try to copy it.

Yeah, unfortunately the compiler-builtins test takes a really long time to build the stdlib again, since it relies on very specific configurations. I don't have a good solution for this either, if it requires building yet another customized version of std.

@alexcrichton
Copy link
Member Author

ping @GuillaumeGomez would you be able to review this? Or should I try to get a different sign-off?

@GuillaumeGomez
Copy link
Member

I'm often assigned for such PRs but I have nothing to do with this part. Please pick someone else. ^^'

@jieyouxu jieyouxu added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 22, 2024
Copy link
Member

@jieyouxu jieyouxu left a comment

Choose a reason for hiding this comment

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

Since we double-checked that this does not need a T-compiler FCP, this LGTM now.

@alexcrichton
Copy link
Member Author

@bors: r=jieyouxu

@bors
Copy link
Contributor

bors commented Aug 22, 2024

📌 Commit 7d2595f has been approved by jieyouxu

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 22, 2024
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 22, 2024
…jieyouxu

Document WebAssembly target feature expectations

This commit is a result of the discussion on rust-lang#128475 and incorporates parts of rust-lang#109807 as well. This is all done as a new page of documentation for the `wasm32-unknown-unknown` target which previously did not exist. This new page goes into details about the preexisting target and additionally documents the expectations for WebAssembly features and code generation.

The tl;dr is that LLVM will enable features over time after most engines have had support for awhile. Compiling without features requires `-Ctarget-cpu=mvp` to rustc plus `-Zbuild-std` to Cargo.

Closes rust-lang#109807
Closes rust-lang#119811
Closes rust-lang#128475
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 22, 2024
…jieyouxu

Document WebAssembly target feature expectations

This commit is a result of the discussion on rust-lang#128475 and incorporates parts of rust-lang#109807 as well. This is all done as a new page of documentation for the `wasm32-unknown-unknown` target which previously did not exist. This new page goes into details about the preexisting target and additionally documents the expectations for WebAssembly features and code generation.

The tl;dr is that LLVM will enable features over time after most engines have had support for awhile. Compiling without features requires `-Ctarget-cpu=mvp` to rustc plus `-Zbuild-std` to Cargo.

Closes rust-lang#109807
Closes rust-lang#119811
Closes rust-lang#128475
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#126985 (Implement `-Z embed-source` (DWARFv5 source code embedding extension))
 - rust-lang#128511 (Document WebAssembly target feature expectations)
 - rust-lang#128935 (More work on `zstd` compression)
 - rust-lang#129263 (Add a missing compatibility note in the 1.80.0 release notes)
 - rust-lang#129386 (Use a LocalDefId in ResolvedArg.)
 - rust-lang#129408 (Fix handling of macro arguments within the `dropping_copy_types` lint)
 - rust-lang#129417 (Don't trigger refinement lint if predicates reference errors)

r? `@ghost`
`@rustbot` modify labels: rollup
tgross35 added a commit to tgross35/rust that referenced this pull request Aug 23, 2024
…jieyouxu

Document WebAssembly target feature expectations

This commit is a result of the discussion on rust-lang#128475 and incorporates parts of rust-lang#109807 as well. This is all done as a new page of documentation for the `wasm32-unknown-unknown` target which previously did not exist. This new page goes into details about the preexisting target and additionally documents the expectations for WebAssembly features and code generation.

The tl;dr is that LLVM will enable features over time after most engines have had support for awhile. Compiling without features requires `-Ctarget-cpu=mvp` to rustc plus `-Zbuild-std` to Cargo.

Closes rust-lang#109807
Closes rust-lang#119811
Closes rust-lang#128475
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
Rollup of 7 pull requests

Successful merges:

 - rust-lang#126985 (Implement `-Z embed-source` (DWARFv5 source code embedding extension))
 - rust-lang#128349 (Enable `f16` tests on x86 and x86-64)
 - rust-lang#128511 (Document WebAssembly target feature expectations)
 - rust-lang#129263 (Add a missing compatibility note in the 1.80.0 release notes)
 - rust-lang#129276 (Stabilize feature `char_indices_offset`)
 - rust-lang#129350 (adapt integer comparison tests for LLVM 20 IR changes)
 - rust-lang#129408 (Fix handling of macro arguments within the `dropping_copy_types` lint)

r? `@ghost`
`@rustbot` modify labels: rollup
GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Aug 23, 2024
…jieyouxu

Document WebAssembly target feature expectations

This commit is a result of the discussion on rust-lang#128475 and incorporates parts of rust-lang#109807 as well. This is all done as a new page of documentation for the `wasm32-unknown-unknown` target which previously did not exist. This new page goes into details about the preexisting target and additionally documents the expectations for WebAssembly features and code generation.

The tl;dr is that LLVM will enable features over time after most engines have had support for awhile. Compiling without features requires `-Ctarget-cpu=mvp` to rustc plus `-Zbuild-std` to Cargo.

Closes rust-lang#109807
Closes rust-lang#119811
Closes rust-lang#128475
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
…llaumeGomez

Rollup of 9 pull requests

Successful merges:

 - rust-lang#128511 (Document WebAssembly target feature expectations)
 - rust-lang#129243 (do not build `cargo-miri` by default on stable channel)
 - rust-lang#129263 (Add a missing compatibility note in the 1.80.0 release notes)
 - rust-lang#129276 (Stabilize feature `char_indices_offset`)
 - rust-lang#129350 (adapt integer comparison tests for LLVM 20 IR changes)
 - rust-lang#129408 (Fix handling of macro arguments within the `dropping_copy_types` lint)
 - rust-lang#129426 (rustdoc-search: use tighter json for names and parents)
 - rust-lang#129437 (Fix typo in a help diagnostic)
 - rust-lang#129457 (kobzol vacation)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 440076d into rust-lang:master Aug 23, 2024
6 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Aug 23, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 23, 2024
Rollup merge of rust-lang#128511 - alexcrichton:doc-wasm-features, r=jieyouxu

Document WebAssembly target feature expectations

This commit is a result of the discussion on rust-lang#128475 and incorporates parts of rust-lang#109807 as well. This is all done as a new page of documentation for the `wasm32-unknown-unknown` target which previously did not exist. This new page goes into details about the preexisting target and additionally documents the expectations for WebAssembly features and code generation.

The tl;dr is that LLVM will enable features over time after most engines have had support for awhile. Compiling without features requires `-Ctarget-cpu=mvp` to rustc plus `-Zbuild-std` to Cargo.

Closes rust-lang#109807
Closes rust-lang#119811
Closes rust-lang#128475
@alexcrichton alexcrichton deleted the doc-wasm-features branch August 23, 2024 14:53
@Mark-Simulacrum Mark-Simulacrum added relnotes Marks issues that should be documented in the release notes of the next release. and removed relnotes Marks issues that should be documented in the release notes of the next release. labels Aug 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-wasm Target: WASM (WebAssembly), http://webassembly.org/ relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-release Relevant to the release subteam, which will review and decide on the PR/issue.
Projects
None yet