Skip to content

std: Use usleep temporarily on WASI targets#150291

Merged
bors merged 1 commit intorust-lang:mainfrom
alexcrichton:wasi-use-usleep
Dec 23, 2025
Merged

std: Use usleep temporarily on WASI targets#150291
bors merged 1 commit intorust-lang:mainfrom
alexcrichton:wasi-use-usleep

Conversation

@alexcrichton
Copy link
Member

@alexcrichton alexcrichton commented Dec 22, 2025

This fixes some fallout from #147572 where the thread::sleep function is is broken on wasm32-wasip2 after that PR. The cause for this is a broken implementation of nanosleep in wasi-libc itself which is being fixed in WebAssembly/wasi-libc#696. Similar to #149864 this avoids the problematic function for now while the wasi-libc changes take some time to propagate into a wasi-sdk release.

Closes #150290

This fixes some fallout from 147572 where the `thread::sleep` function
is is broken on `wasm32-wasip2` after that PR. The cause for this is a
broken implementation of `nanosleep` in wasi-libc itself which is being
fixed in WebAssembly/wasi-libc/696. Similar to 149999 this avoids the
problematic function for now while the wasi-libc changes take some time
to propagate into a wasi-sdk release.
@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 Dec 22, 2025
@rustbot
Copy link
Collaborator

rustbot commented Dec 22, 2025

r? @ChrisDenton

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

@ChrisDenton
Copy link
Member

Seems reasonable to me, thanks!

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Dec 22, 2025

📌 Commit dfbb0fd has been approved by ChrisDenton

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 Dec 22, 2025
@bors
Copy link
Collaborator

bors commented Dec 23, 2025

⌛ Testing commit dfbb0fd with merge 0ac9e59...

@bors
Copy link
Collaborator

bors commented Dec 23, 2025

☀️ Test successful - checks-actions
Approved by: ChrisDenton
Pushing 0ac9e59 to main...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Dec 23, 2025
@bors bors merged commit 0ac9e59 into rust-lang:main Dec 23, 2025
12 checks passed
@rustbot rustbot added this to the 1.94.0 milestone Dec 23, 2025
@github-actions
Copy link
Contributor

What is this? This is an experimental post-merge analysis report that shows differences in test outcomes between the merged PR and its parent PR.

Comparing 5c53093 (parent) -> 0ac9e59 (this PR)

Test differences

Show 4 test diffs

4 doctest diffs were found. These are ignored, as they are noisy.

Test dashboard

Run

cargo run --manifest-path src/ci/citool/Cargo.toml -- \
    test-dashboard 0ac9e59d8f958a7b05071db9b15a0746ebe91b08 --output-dir test-dashboard

And then open test-dashboard/index.html in your browser to see an overview of all executed tests.

Job duration changes

  1. aarch64-apple: 12496.1s -> 9966.8s (-20.2%)
  2. x86_64-rust-for-linux: 3176.6s -> 2609.3s (-17.9%)
  3. dist-apple-various: 4725.2s -> 3963.8s (-16.1%)
  4. i686-gnu-nopt-1: 8403.7s -> 7299.1s (-13.1%)
  5. aarch64-msvc-2: 6701.9s -> 5851.2s (-12.7%)
  6. pr-check-1: 1882.1s -> 1646.6s (-12.5%)
  7. i686-gnu-2: 6110.8s -> 5360.0s (-12.3%)
  8. x86_64-gnu-gcc: 3448.6s -> 3040.6s (-11.8%)
  9. x86_64-gnu-stable: 8588.6s -> 7639.5s (-11.1%)
  10. test-various: 7428.8s -> 6619.1s (-10.9%)
How to interpret the job duration changes?

Job durations can vary a lot, based on the actual runner instance
that executed the job, system noise, invalidated caches, etc. The table above is provided
mostly for t-infra members, for simpler debugging of potential CI slow-downs.

@rust-timer
Copy link
Collaborator

Finished benchmarking commit (0ac9e59): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

Our most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.

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

Max RSS (memory usage)

Results (primary -2.1%, secondary 1.6%)

A less reliable metric. May be of interest, but not used to determine the overall result above.

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

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: 482.821s -> 481.756s (-0.22%)
Artifact size: 390.34 MiB -> 390.37 MiB (0.01%)

rust-bors bot pushed a commit that referenced this pull request Feb 6, 2026
Update wasi-sdk used in CI/releases

This is similar to prior updates such as #149037 in that this is just updating a URL. This update though has some technical updates accompanying it as well, however:

* The `wasm32-wasip2` target no longer uses APIs from WASIp1 on this target, even for startup. This means that the final binary no longer has an "adapter" which can help making instantiation of a component a bit more lean.

* In #147572 libstd was updated to use wasi-libc more often on the `wasm32-wasip2` target. This uncovered a number of bugs in wasi-libc such as #149864, #150291, and #151016. These are all fixed in wasi-sdk-30 so the workarounds in the standard library are all removed.

Overall this is not expected to have any sort of major impact on users of WASI targets. Instead it's expected to be a normal routine update to keep the wheels greased and oiled.
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. 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.

Thread sleep wasm32-wasip2 nightly panics

5 participants