<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/library/std/src/sys/pal/wasi, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-28T22:07:15+00:00</updated>
<entry>
<title>std: Start supporting WASIp2 natively</title>
<updated>2025-08-28T22:07:15+00:00</updated>
<author>
<name>Alex Crichton</name>
<email>alex@alexcrichton.com</email>
</author>
<published>2025-08-26T20:53:11+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=5d81f033a5ab2fce07898a22ad8c607380812cf7'/>
<id>urn:sha1:5d81f033a5ab2fce07898a22ad8c607380812cf7</id>
<content type='text'>
This commit is the start of an effort to support WASIp2 natively in the
standard library. Before this commit the `wasm32-wasip2` target behaved
exactly like `wasm32-wasip1` target by importing APIs from the core wasm
module `wasi_snapshot_preview1`. These APIs are satisfied by the
`wasm-component-ld` target by using an [adapter] which implements WASIp1
in terms of WASIp2. This adapter comes at a cost, however, in terms of
runtime indirection and instantiation cost, so ideally the adapter would
be removed entirely. The purpose of this adapter was to provide a
smoother on-ramp from WASIp1 to WASIp2 when it was originally created.

The `wasm32-wasip2` target has been around for long enough now that it's
much more established. Additionally the only thing historically blocking
using WASIp2 directly was implementation effort. Work is now underway to
migrate wasi-libc itself to using WASIp2 directly and now seems as good
a time as any to migrate the Rust standard library too.

Implementation-wise the milestones here are:

* The `wasm32-wasip2` target now also depends on the `wasi` crate at
  version 0.14.* in addition to the preexisting dependency of 0.11.*.
  The 0.14.* release series binds WASIp2 APIs instead of WASIp1 APIs.
* Some preexisting naming around `mod wasi` or `wasi.rs` was renamed to
  `wasip1` where appropriate. For example `std::sys::pal::wasi` is now
  called `std::sys::pal::wasip1`.
* More platform-specific WASI modules are now split between WASIp1 and
  WASIp2. For example getting the current time, randomness, and
  process arguments now use WASIp2 APIs directly instead of using WASIp1
  APIs that require an adapter.

It's worth pointing out that this PR does not migrate the entire
standard library away from using WASIp1 APIs on the `wasm32-wasip2`
target. Everything related to file descriptors and filesystem APIs is
still using WASIp1. Migrating that is left for a future PR. In the
meantime the goal of this change is to lay the groundwork necessary for
migrating in the future. Eventually the goal is to drop the `wasi`
0.11.* dependency on the `wasm32-wasip2` target (the `wasm32-wasip1`
target will continue to retain this dependency).

[adapter]: https://github.com/bytecodealliance/wasmtime/blob/main/crates/wasi-preview1-component-adapter/README.md
</content>
</entry>
<entry>
<title>remove deprecated Error::description in impls</title>
<updated>2025-08-26T06:36:53+00:00</updated>
<author>
<name>Marijn Schouten</name>
<email>mhkbst@gmail.com</email>
</author>
<published>2025-08-23T19:36:19+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=845311a065a5638c516ed96c73b09862b176b329'/>
<id>urn:sha1:845311a065a5638c516ed96c73b09862b176b329</id>
<content type='text'>
</content>
</entry>
<entry>
<title>library: Migrate from `cfg_if` to `cfg_select`</title>
<updated>2025-08-16T12:28:31+00:00</updated>
<author>
<name>Josh Triplett</name>
<email>josh@joshtriplett.org</email>
</author>
<published>2025-08-10T21:25:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=1ae4a0cc3487f28b29f36afe8056535afad21e7b'/>
<id>urn:sha1:1ae4a0cc3487f28b29f36afe8056535afad21e7b</id>
<content type='text'>
Migrate the standard library from using the external `cfg_if` crate to
using the now-built-in `cfg_select` macro.

This does not yet eliminate the dependency from
`library/std/Cargo.toml`, because while the standard library itself no
longer uses `cfg_if`, it also incorporates the `backtrace` crate, which
does.

Migration assisted by the following vim command (after selecting the
full `cfg_if!` invocation):

```
'&lt;,'&gt;s/\(cfg_if::\)\?cfg_if/cfg_select/ | '&lt;,'&gt;s/^\( *\)} else {/\1}\r\1_ =&gt; {/c | '&lt;,'&gt;s/^\( *\)} else if #\[cfg(\(.*\))\] /\1}\r\1\2 =&gt; /e | '&lt;,'&gt;s/if #\[cfg(\(.*\))\] {/\1 =&gt; {/e
```

This is imperfect, but substantially accelerated the process. This
prompts for confirmation on the `} else {` since that can also appear
inside one of the arms. This also requires manual intervention to handle
any multi-line conditions.
</content>
</entry>
<entry>
<title>Constify SystemTime methods</title>
<updated>2025-08-12T18:05:47+00:00</updated>
<author>
<name>ltdk</name>
<email>usr@ltdk.xyz</email>
</author>
<published>2025-07-26T22:51:13+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=7ce620dd7c6fc3371290b40a1ea28146f0d37031'/>
<id>urn:sha1:7ce620dd7c6fc3371290b40a1ea28146f0d37031</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Print thread ID in panic message if thread name is unknown</title>
<updated>2025-08-06T23:59:47+00:00</updated>
<author>
<name>Trevor Gross</name>
<email>tmgross@umich.edu</email>
</author>
<published>2023-09-11T04:59:31+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=289fe36d373c5a13fa7f1b93f39ff88425ab2351'/>
<id>urn:sha1:289fe36d373c5a13fa7f1b93f39ff88425ab2351</id>
<content type='text'>
`panic!` does not print any identifying information for threads that are
unnamed. However, in many cases, the thread ID can be determined.

This changes the panic message from something like this:

    thread '&lt;unnamed&gt;' panicked at src/main.rs:3:5:
    explicit panic

To something like this:

    thread '&lt;unnamed&gt;' (0xff9bf) panicked at src/main.rs:3:5:
    explicit panic

Stack overflow messages are updated as well.

This change applies to both named and unnamed threads. The ID printed is
the OS integer thread ID rather than the Rust thread ID, which should
also be what debuggers print.
</content>
</entry>
<entry>
<title>thread name in stack overflow message</title>
<updated>2025-07-28T16:09:35+00:00</updated>
<author>
<name>joboet</name>
<email>jonasboettiger@icloud.com</email>
</author>
<published>2025-07-26T12:29:00+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=73751a04910d08052bf6b825f8829cacba86c648'/>
<id>urn:sha1:73751a04910d08052bf6b825f8829cacba86c648</id>
<content type='text'>
</content>
</entry>
<entry>
<title>sleep_until: use clock_nanosleep where possible</title>
<updated>2025-07-06T15:36:49+00:00</updated>
<author>
<name>dvdsk</name>
<email>noreply@davidsk.dev</email>
</author>
<published>2025-05-31T13:33:46+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f24ee2c9b15dc3734e9ebd74ba0563a1e6c545db'/>
<id>urn:sha1:f24ee2c9b15dc3734e9ebd74ba0563a1e6c545db</id>
<content type='text'>
Using clock nanosleep leads to more accurate sleep times on platforms
where it is supported.

To enable using clock_nanosleep this makes `sleep_until` platform
specific. That unfortunatly requires identical placeholder
implementations for the other platforms (windows/mac/wasm etc).

we will land platform specific implementations for those later. See the
`sleep_until` tracking issue.

This requires an accessors for the Instant type. As that accessor is only
used on the platforms that have clock_nanosleep it is marked as allow_unused.

32bit time_t targets do not use clock_nanosleep atm, they instead rely
on the same placeholder as the other platforms. We could make them
use clock_nanosleep too in the future using `__clock_nanosleep_time64`.

__clock_nanosleep_time64 is documented at:
https://www.gnu.org/software/libc/manual/html_node/64_002dbit-time-symbol-handling.html
</content>
</entry>
<entry>
<title>Move `sys::pal::os::Env` into `sys::env`</title>
<updated>2025-04-22T03:56:43+00:00</updated>
<author>
<name>Thalia Archibald</name>
<email>thalia@archibald.dev</email>
</author>
<published>2025-04-22T03:56:43+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=90fe2805df75b9d46b985346f0dff2690c285330'/>
<id>urn:sha1:90fe2805df75b9d46b985346f0dff2690c285330</id>
<content type='text'>
Although `Env` (as `Vars`), `Args`, path functions, and OS constants are
publicly exposed via `std::env`, their implementations are each
self-contained. Keep them separate in `std::sys` and make a new module,
`sys::env`, for `Env`.
</content>
</entry>
<entry>
<title>Combine env consts into std::sys::env_consts</title>
<updated>2025-04-19T02:17:08+00:00</updated>
<author>
<name>Thalia Archibald</name>
<email>thalia@archibald.dev</email>
</author>
<published>2025-04-15T12:48:27+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=37712cc01604633fec6aac9bc720210207fa4b54'/>
<id>urn:sha1:37712cc01604633fec6aac9bc720210207fa4b54</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Move args into std::sys</title>
<updated>2025-04-12T10:10:21+00:00</updated>
<author>
<name>Thalia Archibald</name>
<email>thalia@archibald.dev</email>
</author>
<published>2025-04-12T09:26:17+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=6ffebb65d6daf4fcc82cfc7fd14397bff98df1f2'/>
<id>urn:sha1:6ffebb65d6daf4fcc82cfc7fd14397bff98df1f2</id>
<content type='text'>
</content>
</entry>
</feed>
