std: Use usleep temporarily on WASI targets#150291
Conversation
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.
|
r? @ChrisDenton rustbot has assigned @ChrisDenton. Use |
|
Seems reasonable to me, thanks! @bors r+ rollup |
|
☀️ Test successful - checks-actions |
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 differencesShow 4 test diffs4 doctest diffs were found. These are ignored, as they are noisy. Test dashboardRun cargo run --manifest-path src/ci/citool/Cargo.toml -- \
test-dashboard 0ac9e59d8f958a7b05071db9b15a0746ebe91b08 --output-dir test-dashboardAnd then open Job duration changes
How to interpret the job duration changes?Job durations can vary a lot, based on the actual runner instance |
|
Finished benchmarking commit (0ac9e59): comparison URL. Overall result: ✅ improvements - no action needed@rustbot label: -perf-regression Instruction countOur most reliable metric. Used to determine the overall result above. However, even this metric can be noisy.
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.
CyclesThis benchmark run did not return any relevant results for this metric. Binary sizeThis benchmark run did not return any relevant results for this metric. Bootstrap: 482.821s -> 481.756s (-0.22%) |
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.
This fixes some fallout from #147572 where the
thread::sleepfunction is is broken onwasm32-wasip2after that PR. The cause for this is a broken implementation ofnanosleepin 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