Skip to content

std: Adjust cfgs again for TLS on WASI - #160868

Merged
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
alexcrichton:adjust-wasi-tls-again
Aug 12, 2026
Merged

std: Adjust cfgs again for TLS on WASI#160868
rust-bors[bot] merged 1 commit into
rust-lang:mainfrom
alexcrichton:adjust-wasi-tls-again

Conversation

@alexcrichton

@alexcrichton alexcrichton commented Aug 10, 2026

Copy link
Copy Markdown
Member

This commit adjusts the changes made in #159733. A wasi-libc bug was discovered in #160828 which is present in certain situations which means that the changes in #159733 expose this bug. The purpose of this PR is to get wasip1/wasip2 targets fixed again while preserving a working implementation for wasip3. This upstream bug is already fixed in wasi-libc meaning that this PR won't be necessary once wasi-sdk-34 is published and used in rust-lang/rust. Until that time, however, this effectively reverts #159733 for wasip1/wasip2. The wasip3 target is Tier 3 still and requires wasi-sdk-34 anyway which is why that's left unchanged.

Closes #160828

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Aug 10, 2026
@rustbot

rustbot commented Aug 10, 2026

Copy link
Copy Markdown
Collaborator

r? @clarfonthey

rustbot has assigned @clarfonthey.
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

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @ChrisDenton, libs
  • @ChrisDenton, libs expanded to 13 candidates
  • Random selection from JohnTitor, Mark-Simulacrum, clarfonthey, nia-e

@rust-log-analyzer

This comment has been minimized.

Comment thread library/std/src/sys/thread_local/mod.rs Outdated
This commit adjusts the changes made in 159733. A wasi-libc bug was
discovered in 160828 which is present in certain situations which means
that the changes in 159733 expose this bug. The purpose of this PR is
to get wasip1/wasip2 targets fixed again while preserving a working
implementation for wasip3. This upstream bug is already fixed in
wasi-libc meaning that this PR won't be necessary once wasi-sdk-34 is
published and used in rust-lang/rust. Until that time, however, this
effectively reverts 159733 for wasip1/wasip2. The wasip3 target is Tier
3 still and requires wasi-sdk-34 anyway which is why that's left
unchanged.

Closes 160828
@alexcrichton
alexcrichton force-pushed the adjust-wasi-tls-again branch from 61e15de to dd905cd Compare August 10, 2026 17:48
@clarfonthey

Copy link
Copy Markdown
Contributor

These are some gnarly cfgs, but I'll trust that you've verified they work on the existing wasi envs.

r=me, like the past WASI PR I reviewed for you I'll let you merge since you have r+ privs and I'm not sure if you wanted to add anything more.

@alexcrichton

Copy link
Copy Markdown
Member Author

@bors r=clarfonthey

Agreed yeah I'd ideally like to clean these up, but I'm not quite prepared to take up the mantle of "clean up every OS at once" vs just the one that I'm personally working on alas :(

@rust-bors

rust-bors Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

📌 Commit dd905cd has been approved by clarfonthey

It is now in the queue for this repository.

@rust-bors rust-bors Bot 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 11, 2026
@clarfonthey

Copy link
Copy Markdown
Contributor

Agreed yeah I'd ideally like to clean these up, but I'm not quite prepared to take up the mantle of "clean up every OS at once" vs just the one that I'm personally working on alas :(

Yeah, no worries, that's why I figured this should be fine for now. These only affect WASI, and I assume you're taking care to not break p1 or p2 when working on p3.

I have some plans for a proposal to clean this up but that's a more lofty goal.

JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 11, 2026
…, r=clarfonthey

std: Adjust cfgs again for TLS on WASI

This commit adjusts the changes made in rust-lang#159733. A wasi-libc bug was discovered in rust-lang#160828 which is present in certain situations which means that the changes in rust-lang#159733 expose this bug. The purpose of this PR is to get wasip1/wasip2 targets fixed again while preserving a working implementation for wasip3. This upstream bug is already fixed in wasi-libc meaning that this PR won't be necessary once wasi-sdk-34 is published and used in rust-lang/rust. Until that time, however, this effectively reverts rust-lang#159733 for wasip1/wasip2. The wasip3 target is Tier 3 still and requires wasi-sdk-34 anyway which is why that's left unchanged.

Closes rust-lang#160828
rust-bors Bot pushed a commit that referenced this pull request Aug 11, 2026
…uwer

Rollup of 10 pull requests

Successful merges:

 - #160620 (Do not pass `-no-pie` on Windows)
 - #160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion)
 - #160760 (Miri: give the incremental session a chance to finish)
 - #160854 (Add -Zwasm-proc-macros flag)
 - #160868 (std: Adjust cfgs again for TLS on WASI)
 - #160894 (Allow running an arbitrary number of try jobs per PR)
 - #160790 (rustc-book: update sys-v abi link)
 - #160878 (Add rust_analyzer to check-cfg names)
 - #160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency)
 - #160920 (No longer mention the removed generic)
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 11, 2026
…, r=clarfonthey

std: Adjust cfgs again for TLS on WASI

This commit adjusts the changes made in rust-lang#159733. A wasi-libc bug was discovered in rust-lang#160828 which is present in certain situations which means that the changes in rust-lang#159733 expose this bug. The purpose of this PR is to get wasip1/wasip2 targets fixed again while preserving a working implementation for wasip3. This upstream bug is already fixed in wasi-libc meaning that this PR won't be necessary once wasi-sdk-34 is published and used in rust-lang/rust. Until that time, however, this effectively reverts rust-lang#159733 for wasip1/wasip2. The wasip3 target is Tier 3 still and requires wasi-sdk-34 anyway which is why that's left unchanged.

Closes rust-lang#160828
JonathanBrouwer added a commit to JonathanBrouwer/rust that referenced this pull request Aug 11, 2026
…, r=clarfonthey

std: Adjust cfgs again for TLS on WASI

This commit adjusts the changes made in rust-lang#159733. A wasi-libc bug was discovered in rust-lang#160828 which is present in certain situations which means that the changes in rust-lang#159733 expose this bug. The purpose of this PR is to get wasip1/wasip2 targets fixed again while preserving a working implementation for wasip3. This upstream bug is already fixed in wasi-libc meaning that this PR won't be necessary once wasi-sdk-34 is published and used in rust-lang/rust. Until that time, however, this effectively reverts rust-lang#159733 for wasip1/wasip2. The wasip3 target is Tier 3 still and requires wasi-sdk-34 anyway which is why that's left unchanged.

Closes rust-lang#160828
rust-bors Bot pushed a commit that referenced this pull request Aug 11, 2026
…uwer

Rollup of 14 pull requests

Successful merges:

 - #160620 (Do not pass `-no-pie` on Windows)
 - #160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion)
 - #160760 (Miri: give the incremental session a chance to finish)
 - #160854 (Add -Zwasm-proc-macros flag)
 - #160868 (std: Adjust cfgs again for TLS on WASI)
 - #160894 (Allow running an arbitrary number of try jobs per PR)
 - #160790 (rustc-book: update sys-v abi link)
 - #160878 (Add rust_analyzer to check-cfg names)
 - #160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency)
 - #160920 (No longer mention the removed generic)
 - #160921 (rustdoc: Fix invalid CSS classes generated for notable items)
 - #160924 (split up `rustc_session`)
 - #160934 (Ensure TLS accesses don't call the global allocator through panic)
 - #160937 (Store the names of `Fn` trait parameters in the AST, fix rustfmt bug)
rust-bors Bot pushed a commit that referenced this pull request Aug 12, 2026
Rollup of 14 pull requests

Successful merges:

 - #160620 (Do not pass `-no-pie` on Windows)
 - #160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion)
 - #160854 (Add -Zwasm-proc-macros flag)
 - #160868 (std: Adjust cfgs again for TLS on WASI)
 - #160882 (Add basic `splat` support to `rustdoc`)
 - #160894 (Allow running an arbitrary number of try jobs per PR)
 - #160790 (rustc-book: update sys-v abi link)
 - #160878 (Add rust_analyzer to check-cfg names)
 - #160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency)
 - #160920 (No longer mention the removed generic)
 - #160921 (rustdoc: Fix invalid CSS classes generated for notable items)
 - #160924 (split up `rustc_session`)
 - #160934 (Ensure TLS accesses don't call the global allocator through panic)
 - #160937 (Store the names of `Fn` trait parameters in the AST, fix rustfmt bug)
@rust-bors
rust-bors Bot merged commit 60365e5 into rust-lang:main Aug 12, 2026
13 checks passed
@rustbot rustbot added this to the 1.99.0 milestone Aug 12, 2026
rust-timer added a commit that referenced this pull request Aug 12, 2026
Rollup merge of #160868 - alexcrichton:adjust-wasi-tls-again, r=clarfonthey

std: Adjust cfgs again for TLS on WASI

This commit adjusts the changes made in #159733. A wasi-libc bug was discovered in #160828 which is present in certain situations which means that the changes in #159733 expose this bug. The purpose of this PR is to get wasip1/wasip2 targets fixed again while preserving a working implementation for wasip3. This upstream bug is already fixed in wasi-libc meaning that this PR won't be necessary once wasi-sdk-34 is published and used in rust-lang/rust. Until that time, however, this effectively reverts #159733 for wasip1/wasip2. The wasip3 target is Tier 3 still and requires wasi-sdk-34 anyway which is why that's left unchanged.

Closes #160828
flip1995 pushed a commit to flip1995/rust-clippy that referenced this pull request Aug 17, 2026
Rollup of 14 pull requests

Successful merges:

 - rust-lang/rust#160620 (Do not pass `-no-pie` on Windows)
 - rust-lang/rust#160731 (Arc: Remove unnecessary fmt::Display use for overflow assertion)
 - rust-lang/rust#160854 (Add -Zwasm-proc-macros flag)
 - rust-lang/rust#160868 (std: Adjust cfgs again for TLS on WASI)
 - rust-lang/rust#160882 (Add basic `splat` support to `rustdoc`)
 - rust-lang/rust#160894 (Allow running an arbitrary number of try jobs per PR)
 - rust-lang/rust#160790 (rustc-book: update sys-v abi link)
 - rust-lang/rust#160878 (Add rust_analyzer to check-cfg names)
 - rust-lang/rust#160909 (tests/run-make-cargo/thumb-none-cortex-m: bump `cortex-m` dependency)
 - rust-lang/rust#160920 (No longer mention the removed generic)
 - rust-lang/rust#160921 (rustdoc: Fix invalid CSS classes generated for notable items)
 - rust-lang/rust#160924 (split up `rustc_session`)
 - rust-lang/rust#160934 (Ensure TLS accesses don't call the global allocator through panic)
 - rust-lang/rust#160937 (Store the names of `Fn` trait parameters in the AST, fix rustfmt bug)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. 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.

wasm32-wasip2 spins on pthread_key_delete

5 participants