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

Add a new wasm32-wasip2 target #119616

Merged
merged 2 commits into from
Feb 27, 2024
Merged

Conversation

rylev
Copy link
Member

@rylev rylev commented Jan 5, 2024

This is the initial implementation of the MCP rust-lang/compiler-team#694 creating a new tier 3 target wasm32-wasip2. That MCP has been seconded and will most likely be approved in a little over a week from now. For more information on the need for this target, please read the MCP.

There is one aspect of this PR that will become insta-stable once these changes reach a stable compiler:

  • A new target_family named wasi is introduced. This target family incorporates all wasi targets including wasm32-wasi and its derivative wasm32-wasi-preview1-threads. The difference between target_family = wasi and target_os = wasi will become much clearer when wasm32-wasi is renamed to wasm32-wasi-preview1 and the target_os becomes wasm32-wasi-preview1. You can read about this target rename in this MCP which has also been seconded and will hopefully be officially approved soon.

Additional technical details include:

  • Both std::sys::wasi_preview2 and std::os::wasi_preview2 have been created and mostly use #[path] annotations on their submodules to reach into the existing wasi (soon to be wasi_preview1) modules. Over time the differences between wasi_preview1 and wasi_preview2 will grow and most like all #[path] based module aliases will fall away.
  • Building wasi-preview2 relies on a wasi-sdk in the same way that wasi-preview1 does (one must include a wasi-root path in the Config.toml pointing to sysroot included in the wasi-sdk). The target should build against wasi-sdk v21 without modifications. However, the wasi-sdk itself is growing preview2 support so this might shift rapidly. We will be following along quickly to make sure that building the target remains possible as the wasi-sdk changes.
  • This requires a patch to libc that we'll need to land in conjunction with this change. Until that patch lands the target won't actually build.

@rustbot
Copy link
Collaborator

rustbot commented Jan 5, 2024

r? @m-ou-se

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added O-wasi Operating system: Wasi, Webassembly System Interface S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Jan 5, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jan 5, 2024

These commits modify compiler targets.
(See the Target Tier Policy.)

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@CryZe
Copy link
Contributor

CryZe commented Jan 7, 2024

The difference between target_family = wasi and target_os = wasi will become much clearer when wasm32-wasi is renamed to wasm32-wasi-preview1 and the target_os becomes wasm32-wasi-preview1

Nothing in that MCP mentions that the target_os is being renamed. Can the preview1 / preview2 not just be a target_env or target_abi?

@rylev
Copy link
Member Author

rylev commented Jan 8, 2024

Leaving target_os as wasi for all wasi related targets is probably an oversight of the MCP. The wasi preview 1 and preview 2 logical OSes have very significant differences that go beyond just the ABI level. I don't believe we would want to rely on target_abi since that setting is not stable. That leaves us just with target_env which according to the reference is " disambiguating information about the target platform". Perhaps target_env is more appropriate.

Preview 2 and preview 1 differ from each other in the following ways:

  • Different ABI
  • Different platform API (i.e., the functions exposed from the host environment significantly differ in shape and semantics)
  • Different binary artifact (i.e., preview 1 emits core Wasm modules while preview 2 emits Wasm components which are an extension of modules)

Does target_env capture those differences?

I tried looking at how Windows versions are handled and surprisingly it seems that target_vendor is often used for different versions like uwp and win7.

cc @alexcrichton.

@alexcrichton
Copy link
Member

Part of the motivation for adding an entirely new target is that existing target_os = "wasi" code will not work indefinitely on the new target. Existing target_os = "wasi" code is probably using items from the wasi_snapshot_preview1 module which is not defined in terms of either the component model or the latest WASI standard. This necessarily means that any code using target_os = "wasi" is highly likely to need an update (e.g. usage of std::os::wasi or the wasi crate on crates.io).

I bring this up in that this is motivation for not only a new target but additionally a new target_os = "..." setting. The MCP could have gone into more depth about this (but let's be real any description of anything could go into more depth about anything) and currently only states:

This could be configured with target_vendor = "preview2" or target_os = "wasi_preview2" for example (TBD).

This PR is sort of where that TBD is being resolved. Given the motivation for adding a brand new target to rustc this is what additionally motivates the addition of a new target_os entry.

I would ideally like to rename the target_os entry of the wasm32-wasi target as part of the rename to wasm32-wasi-preview1 but that's probably too much breakage to take on so it likely won't happen at this time.

@CryZe
Copy link
Contributor

CryZe commented Jan 8, 2024

I do think that using target_env here is a whole lot cleaner. Funnily enough I have a perfectly timed example for as to why I think this is. Before I knew about this PR, I was actually preparing a PR for serde that adds a cfg(target_os = "wasi") to its OsStr handling. This is not code that does any direct calls to any low level WASI functions. I also did a quick search on GitHub for code that uses wasi as its target_os and it seems like almost all code is like this. And that's not very surprising either. Low level crates such as std already in general are concerned about OS versions, where certain Windows API functions or so are only available on Windows 11 for example. However almost all crates above are doing perfectly fine by checking for the general operating system, not any version. This seems to be the same for WASI.

In the case of serde, my PR would've silently been broken by the target_os being changed. From what I'm seeing in the GitHub search, this also is true for a lot of the code I'm seeing. Most of the remaining code would fail to compile... but it had no reason to change, because it never calls into any low level code either. So there's only a tiny fraction of code that would benefit from a changed target_os whereas the rest either unnecessarily stops compiling or even silently misbehaves. Also even if a crate would still accidentally use preview1 functions, isn't there some backwards compatibility in the runtimes? So overall I'm very unconvinced and even concerned if the target_os changes (because of the silent breakage in e.g. serde) and would heavily prefer target_env or target_vendor.

@alexcrichton
Copy link
Member

I think the breakage and what to do can go both ways, so at least in my mind there's not a clear-cut answer of what the best route here is. As you've pointed out a con of changing target_os is that all existing code will need to be updated. This includes code which doesn't interact with wasi_snapshot_preview1 imports directly, such as path-related functionality that you're talking about. A pro, however, is that a new string acknowledges that wasi_snapshot_preview1 is no longer natively supported and is now required to go through an "adapter" and it's best to use component definitions directly.

To me one way to go about solving this is to ignore historical precedent (e.g. the preexisting wasm32-wasi target), decide on a solution, and then see if it can be worked into today's systems. In that sense the preview1 and preview2 targets represent entirely different "OS" definitions (the term "OS" here is a bit loose granted). They're entirely separate embedding APIs which overlap in functionality but to me it's similar-ish to Windows vs Unix. Both have the ability to open a file and such but have very different ways of going about it. Similarly preview1 and preview2 can both open files but behave pretty differently in terms of the fine details (e.g. something that's ignored from the I'm-using-libstd perspective but matters a lot if you're programming directly against the interfaces).

Given all that I at least personally think it makes sense to have different target_os strings. Not to say there aren't similarities to the two targets, however. As you've pointed out the structure of paths being byte-based things with / separators is shared in common across the two targets. This I think is solid motivation for target_family or some similar cfg. That way code can be written to span both.

If you'll continue to walk this hypothetical with me, the next question is that if this state of affairs is desirable does it make sense to retrofit onto the existing ecosystem. Personally I think so. The new component-based target is "new enough" that I'm not sure it's worth it to keep everything working seamlessly as much as possible. This is a good opportunity to rethink what WASI support means and how best to support it. For example libc support is changing, the standard library's platform-specific extensions are changing, the capabilities of the platform are different, etc. All existing code will continue to work for preview1 but code will need to be explicitly ported to preview2.


That's at least my thinking, although I don't know how best to resolve this still myself. I personally think it's best to go with target_os, but I'm certainly not the only stakeholder here!

@rylev
Copy link
Member Author

rylev commented Jan 11, 2024

I don't have strong feelings on how to differentiate between preview1 and preview2, but I do have strong opinions that there needs to be some way of doing it. I agree with @alexcrichton that preview2 is different enough from preview1 that it can argued that preview2 is an entirely different OS, but it can also be argued that preview2 is just a newer version of the same logical operating system (albeit with very deep and significant changes!).

Looking at how the question of new versions of operating systems are already handled in rustc, there's unfortunately not good, clear precedent for what to do. Windows based targets that want to target older versions that what x86_64-pc-windows-msvc does, use target_vendor to do so, but this seems like a strange choice to me. On the Linux side, newer kernel and libc versions are typically targeted through target_env.

What all of this seems to indicate is that there is likely no obviously correct answer, and so we should pick something that:

  • allows one to easily differentiate between preview1 and preview2
  • limits the amount of churn in existing crates ecosystem as there will already be quite a bit of churn
  • seems like a reasonable and easy to understand choice

Talking with a few others, it does seem like perhaps target_env is the best choice to accomplish the goals above. Unless folks feel strongly some other way, I can make the change over to target_env.

@ranile
Copy link
Contributor

ranile commented Jan 11, 2024

One more thing worth noting is that target_os = wasi is used to check if the WASM compilation is for non-browser targets. Here we use wasm-bindgen or tokio depending upon where the WASM output is supposed to run: https://github.com/yewstack/prokio/blob/master/src%2Flib.rs#L59-L64

Not breaking this use case is very important so target_env is the best way to go

@alexcrichton
Copy link
Member

I was talking with Ryan a bit off-thread as well and I agree now too that target_env is the way to go 👍

@bors

This comment was marked as resolved.

@m-ou-se
Copy link
Member

m-ou-se commented Jan 19, 2024

👍 for /library/*, but this needs another reviewer for the other parts:

r? compiler

@rustbot rustbot assigned petrochenkov and unassigned m-ou-se Jan 19, 2024
@petrochenkov
Copy link
Contributor

The rustc_target infra looks good to me, but I'm not familiar with wasi specifics.
Unless some more wasi-specific review is required, r=me after rebase and the target_env changes (#119616 (comment)).
@rustbot author

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 19, 2024
@rylev rylev force-pushed the wasm32-wasi-preview2 branch 2 times, most recently from 25d3cd2 to 8209450 Compare January 22, 2024 18:21
@rust-log-analyzer

This comment has been minimized.

Signed-off-by: Ryan Levick <me@ryanlevick.com>
@alexcrichton
Copy link
Member

For historical reference and if anyone's interested, here's the notes for the last meeting where the naming of "p2" vs "preview2" was discussed. The salient points in the notes, to copy/paste here, are:

Pat Hickey: We’ve received feedback from our community that the word Preview throws them off because they don’t know what it means. We are already using semver. We use it in the WIT. Most developers already know semver. When we say WASI is at 0.2 right now that can get across better than Preview 2 is that we’re not at 1.0. And 0.2.2, 0.2.3, etc means that we’re not breaking anything. Let’s communicate better by using terms most folks are already familiar with. WASI 0.2 is recommended for most audiences. This is what you’ll see in wit docs and import names.

...

Pat Hickey: I’d like to salute the go community for seeing this problem coming. Go decided to use wasm32-wasip1 and wasm32-wasip2. Folks in the rust community saw that and also has chosen to adopt this triple.

This was discussed a bit more in-depth in that meeting that the notes don't capture super well, but the consensus was that the "p2" naming is the best going forward as it means "preview 2" in the standards context, "point two" to folks who just want to know what it is, it aligns with what others are already leaning towards (Go), and it's easier to type.

@jeffparsons
Copy link
Contributor

@petrochenkov or @m-ou-se would one of y'all be ok re-r+-ing this to go back into the queue?

Okay, now it looks like it's ready for Bors. 😊

@m-ou-se
Copy link
Member

m-ou-se commented Feb 27, 2024

@bors r=petrochenkov,m-ou-se

@bors
Copy link
Contributor

bors commented Feb 27, 2024

📌 Commit 5e9bed7 has been approved by petrochenkov,m-ou-se

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 Feb 27, 2024
@bors
Copy link
Contributor

bors commented Feb 27, 2024

⌛ Testing commit 5e9bed7 with merge ef32456...

@bors
Copy link
Contributor

bors commented Feb 27, 2024

☀️ Test successful - checks-actions
Approved by: petrochenkov,m-ou-se
Pushing ef32456 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Feb 27, 2024
@bors bors merged commit ef32456 into rust-lang:master Feb 27, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Feb 27, 2024
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Feb 28, 2024
This commit adds a new target called `wasm32-wasip1` to rustc.
This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to
`wasm32-wasip1` to better live alongside the [new
`wasm32-wasip2` target](rust-lang#119616).
This new target is added alongside the `wasm32-wasi` target and has the
exact same definition as the previous target. This PR is effectively a
rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that
as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi`
target is not being removed at this time. This change will reach stable
Rust before even a warning about the rename will be printed. At this
time this change is just the start where a new target is introduced and
users can start migrating if they support only Nightly for example.
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (ef32456): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is a highly reliable metric that was used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-0.1% [-0.1%, -0.1%] 1
All ❌✅ (primary) - - 0

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
- - 0
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-5.1% [-5.1%, -5.1%] 1
All ❌✅ (primary) - - 0

Cycles

This benchmark run did not return any relevant results for this metric.

Binary size

This benchmark run did not return any relevant results for this metric.

Bootstrap: 651.173s -> 651.239s (0.01%)
Artifact size: 311.15 MiB -> 311.17 MiB (0.01%)

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 1, 2024
…ame, r=wesleywiser

Add a new `wasm32-wasip1` target to rustc

This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](rust-lang#119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Mar 1, 2024
…ame, r=wesleywiser

Add a new `wasm32-wasip1` target to rustc

This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](rust-lang#119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 2, 2024
…e, r=wesleywiser

Add a new `wasm32-wasip1` target to rustc

This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](rust-lang#119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
alexcrichton added a commit to alexcrichton/rust that referenced this pull request Mar 2, 2024
This commit adds a new target called `wasm32-wasip1` to rustc.
This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to
`wasm32-wasip1` to better live alongside the [new
`wasm32-wasip2` target](rust-lang#119616).
This new target is added alongside the `wasm32-wasi` target and has the
exact same definition as the previous target. This PR is effectively a
rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that
as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi`
target is not being removed at this time. This change will reach stable
Rust before even a warning about the rename will be printed. At this
time this change is just the start where a new target is introduced and
users can start migrating if they support only Nightly for example.
bors added a commit to rust-lang-ci/rust that referenced this pull request Mar 4, 2024
…e, r=wesleywiser

Add a new `wasm32-wasip1` target to rustc

This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](rust-lang#119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Mar 5, 2024
…eywiser

Add a new `wasm32-wasip1` target to rustc

This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](rust-lang/rust#119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Apr 7, 2024
…eywiser

Add a new `wasm32-wasip1` target to rustc

This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](rust-lang/rust#119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
RalfJung pushed a commit to RalfJung/rust-analyzer that referenced this pull request Apr 27, 2024
…eywiser

Add a new `wasm32-wasip1` target to rustc

This commit adds a new target called `wasm32-wasip1` to rustc. This new target is explained in these two MCPs:

* rust-lang/compiler-team#607
* rust-lang/compiler-team#695

In short, the previous `wasm32-wasi` target is going to be renamed to `wasm32-wasip1` to better live alongside the [new `wasm32-wasip2` target](rust-lang/rust#119616). This new target is added alongside the `wasm32-wasi` target and has the exact same definition as the previous target. This PR is effectively a rename of `wasm32-wasi` to `wasm32-wasip1`. Note, however, that as explained in rust-lang/compiler-team#695 the previous `wasm32-wasi` target is not being removed at this time. This change will reach stable Rust before even a warning about the rename will be printed. At this time this change is just the start where a new target is introduced and users can start migrating if they support only Nightly for example.
wip-sync pushed a commit to NetBSD/pkgsrc-wip that referenced this pull request May 4, 2024
Pkgsrc changes:
 * Adapt checksums and patches, some have beene intregrated upstream.

Upstream chnages:

Version 1.78.0 (2024-05-02)
===========================

Language
--------
- [Stabilize `#[cfg(target_abi = ...)]`]
  (rust-lang/rust#119590)
- [Stabilize the `#[diagnostic]` namespace and
  `#[diagnostic::on_unimplemented]` attribute]
  (rust-lang/rust#119888)
- [Make async-fn-in-trait implementable with concrete signatures]
  (rust-lang/rust#120103)
- [Make matching on NaN a hard error, and remove the rest of
  `illegal_floating_point_literal_pattern`]
  (rust-lang/rust#116284)
- [static mut: allow mutable reference to arbitrary types, not just
  slices and arrays]
  (rust-lang/rust#117614)
- [Extend `invalid_reference_casting` to include references casting
  to bigger memory layout]
  (rust-lang/rust#118983)
- [Add `non_contiguous_range_endpoints` lint for singleton gaps
  after exclusive ranges]
  (rust-lang/rust#118879)
- [Add `wasm_c_abi` lint for use of older wasm-bindgen versions]
  (rust-lang/rust#117918)
  This lint currently only works when using Cargo.
- [Update `indirect_structural_match` and `pointer_structural_match`
  lints to match RFC]
  (rust-lang/rust#120423)
- [Make non-`PartialEq`-typed consts as patterns a hard error]
  (rust-lang/rust#120805)
- [Split `refining_impl_trait` lint into `_reachable`, `_internal` variants]
  (rust-lang/rust#121720)
- [Remove unnecessary type inference when using associated types
  inside of higher ranked `where`-bounds]
  (rust-lang/rust#119849)
- [Weaken eager detection of cyclic types during type inference]
  (rust-lang/rust#119989)
- [`trait Trait: Auto {}`: allow upcasting from `dyn Trait` to `dyn Auto`]
  (rust-lang/rust#119338)

Compiler
--------

- [Made `INVALID_DOC_ATTRIBUTES` lint deny by default]
  (rust-lang/rust#111505)
- [Increase accuracy of redundant `use` checking]
  (rust-lang/rust#117772)
- [Suggest moving definition if non-found macro_rules! is defined later]
  (rust-lang/rust#121130)
- [Lower transmutes from int to pointer type as gep on null]
  (rust-lang/rust#121282)

Target changes:

- [Windows tier 1 targets now require at least Windows 10]
  (rust-lang/rust#115141)
 - [Enable CMPXCHG16B, SSE3, SAHF/LAHF and 128-bit Atomics in tier 1 Windows]
  (rust-lang/rust#120820)
- [Add `wasm32-wasip1` tier 2 (without host tools) target]
  (rust-lang/rust#120468)
- [Add `wasm32-wasip2` tier 3 target]
  (rust-lang/rust#119616)
- [Rename `wasm32-wasi-preview1-threads` to `wasm32-wasip1-threads`]
  (rust-lang/rust#122170)
- [Add `arm64ec-pc-windows-msvc` tier 3 target]
  (rust-lang/rust#119199)
- [Add `armv8r-none-eabihf` tier 3 target for the Cortex-R52]
  (rust-lang/rust#110482)
- [Add `loongarch64-unknown-linux-musl` tier 3 target]
  (rust-lang/rust#121832)

Refer to Rust's [platform support page][platform-support-doc]
for more information on Rust's tiered platform support.

Libraries
---------

- [Bump Unicode to version 15.1.0, regenerate tables]
  (rust-lang/rust#120777)
- [Make align_offset, align_to well-behaved in all cases]
  (rust-lang/rust#121201)
- [PartialEq, PartialOrd: document expectations for transitive chains]
  (rust-lang/rust#115386)
- [Optimize away poison guards when std is built with panic=abort]
  (rust-lang/rust#100603)
- [Replace pthread `RwLock` with custom implementation]
  (rust-lang/rust#110211)
- [Implement unwind safety for Condvar on all platforms]
  (rust-lang/rust#121768)
- [Add ASCII fast-path for `char::is_grapheme_extended`]
  (rust-lang/rust#121138)

Stabilized APIs
---------------

- [`impl Read for &Stdin`]
  (https://doc.rust-lang.org/stable/std/io/struct.Stdin.html#impl-Read-for-%26Stdin)
- [Accept non `'static` lifetimes for several `std::error::Error`
  related implementations] (rust-lang/rust#113833)
- [Make `impl<Fd: AsFd>` impl take `?Sized`]
  (rust-lang/rust#114655)
- [`impl From<TryReserveError> for io::Error`]
  (https://doc.rust-lang.org/stable/std/io/struct.Error.html#impl-From%3CTryReserveError%3E-for-Error)

These APIs are now stable in const contexts:

- [`Barrier::new()`]
  (https://doc.rust-lang.org/stable/std/sync/struct.Barrier.html#method.new)

Cargo
-----

- [Stabilize lockfile v4](rust-lang/cargo#12852)
- [Respect `rust-version` when generating lockfile]
  (rust-lang/cargo#12861)
- [Control `--charset` via auto-detecting config value]
  (rust-lang/cargo#13337)
- [Support `target.<triple>.rustdocflags` officially]
  (rust-lang/cargo#13197)
- [Stabilize global cache data tracking]
  (rust-lang/cargo#13492)

Misc
----

- [rustdoc: add `--test-builder-wrapper` arg to support wrappers
  such as RUSTC_WRAPPER when building doctests]
  (rust-lang/rust#114651)

Compatibility Notes
-------------------

- [Many unsafe precondition checks now run for user code with debug
  assertions enabled] (rust-lang/rust#120594)
  This change helps users catch undefined behavior in their code,
  though the details of how much is checked are generally not
  stable.
- [riscv only supports split_debuginfo=off for now]
  (rust-lang/rust#120518)
- [Consistently check bounds on hidden types of `impl Trait`]
  (rust-lang/rust#121679)
- [Change equality of higher ranked types to not rely on subtyping]
  (rust-lang/rust#118247)
- [When called, additionally check bounds on normalized function return type]
  (rust-lang/rust#118882)
- [Expand coverage for `arithmetic_overflow` lint]
  (rust-lang/rust#119432)

Internal Changes
----------------

These changes do not affect any public interfaces of Rust, but they represent
significant improvements to the performance or internals of rustc and related
tools.

- [Update to LLVM 18](rust-lang/rust#120055)
- [Build `rustc` with 1CGU on `x86_64-pc-windows-msvc`]
  (rust-lang/rust#112267)
- [Build `rustc` with 1CGU on `x86_64-apple-darwin`]
  (rust-lang/rust#112268)
- [Introduce `run-make` V2 infrastructure, a `run_make_support`
  library and port over 2 tests as example]
  (rust-lang/rust#113026)
- [Windows: Implement condvar, mutex and rwlock using futex]
  (rust-lang/rust#121956)
@RalfJung
Copy link
Member

Would be nice to see the PR name and description updated to match what actually landed (in particular regarding the target name). This just confused be quite a bit.^^

@rylev rylev changed the title Add a new wasm32-wasi-preview2 target Add a new wasm32-wasip2 target May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. O-wasi Operating system: Wasi, Webassembly System Interface S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet