Repository navigation
std: Add initial support for the wasm32-webp2 target - #165932
Open
alexcrichton wants to merge 1 commit into
Open
alexcrichton wants to merge 1 commit into
alexcrichton wants to merge 1 commit into
Conversation
Collaborator
|
These commits modify compiler targets. |
Collaborator
|
r? @joboet rustbot has assigned @joboet. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed
the
wasm32-webp2-target
branch
from
November 13, 2026 18:19
58ad693 to
62a9399
Compare
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed
the
wasm32-webp2-target
branch
from
November 16, 2026 17:22
62a9399 to
9a8a7d6
Compare
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed
the
wasm32-webp2-target
branch
from
November 16, 2026 20:33
9a8a7d6 to
f6813d4
Compare
This comment has been minimized.
This comment has been minimized.
alexcrichton
force-pushed
the
wasm32-webp2-target
branch
from
November 16, 2026 21:46
f6813d4 to
dcadc12
Compare
This comment has been minimized.
This comment has been minimized.
This commit is intended to be the initial work in adding a `wasm32-webp2` target to the Rust compiler. This has been previously approved in an [MCP/1037][mcp] and discussed on Zulip as well. This is a tier 3 target meaning that there will be no precompiled artifacts nor any testing in CI. I've locally verified that the target builds without warnings and produces components of the expected shape. In general this target is intended to be pretty similar to `target_os = "wasi"` targets. Most of the adjustments in the standard library area accounting for `target_os = "web"` next to `target_os = "wasi"`. Some minor locations differ such as randomness. Otherwise this means that the web target inherits the same general strategy of the WASI targets, which is to use `unix.rs`-style implementations in most places. This places much of the portability burden on wasi-libc which internally has `#define`s and such to use the appropriate implementation. An example of this is `clock_gettime` is used on Web and WASI targets to implement `SystemTime` and `Instant`, and internally wasi-libc implements this with either Web or WASI interfaces depending on the target. This support all requires [a minor change in the `libc` crate][libc] to support the "web" target a well, effectively turning on definitions for all wasi-libc based targets. Locally this was tested with `[patch]`, but this PR does not include that so the `wasm32-webp2` target will not be buildable as-is in-tree until the `libc` crate has a published release and rust-lang/rust updates. [mcp]: rust-lang/compiler-team#1037 [libc]: rust-lang/libc#5733
alexcrichton
force-pushed
the
wasm32-webp2-target
branch
from
November 18, 2026 15:37
dcadc12 to
df5fdc4
Compare
Collaborator
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit is intended to be the initial work in adding a
wasm32-webp2target to the Rust compiler. This has been previously approved in an MCP/1037 and discussed on Zulip as well. This is a tier 3 target meaning that there will be no precompiled artifacts nor any testing in CI. I've locally verified that the target builds without warnings and produces components of the expected shape.In general this target is intended to be pretty similar to
target_os = "wasi"targets. Most of the adjustments in the standard library area accounting fortarget_os = "web"next totarget_os = "wasi". Some minor locations differ such as randomness. Otherwise this means that the web target inherits the same general strategy of the WASI targets, which is to useunix.rs-style implementations in most places. This places much of the portability burden on wasi-libc which internally has#defines and such to use the appropriate implementation. An example of this isclock_gettimeis used on Web and WASI targets to implementSystemTimeandInstant, and internally wasi-libc implements this with either Web or WASI interfaces depending on the target.This support all requires a minor change in the
libccrate to support the "web" target a well, effectively turning on definitions for all wasi-libc based targets. Locally this was tested with[patch], but this PR does not include that so thewasm32-webp2target will not be buildable as-is in-tree until thelibccrate has a published release and rust-lang/rust updates.