notes

Somebody else's crate: what crates.io does against the nife std

(Milestone 64, measurement phase, 2026-08-04. Milestone 27 (rust) built a std platform layer on the native ABI (notes/std.md) and claimed it widened real workloads to "most of crates.io that stays off fs and threads". This note is the attempt to find out whether the qualifier is doing as much work as it sounds like. Fifty crates were taken off crates.io and built against the patched std; this is what happened and why.)

The short answer: the qualifier was pessimistic, and the table was measuring the wrong thing. std::fs answering Unsupported for 32 of 54 functions is not what stops crates from building. 39 of 50 probes built with no change at all, including regex, serde_json, tokio's current-thread runtime, rayon, clap, chrono and walkdir. Of the 11 that failed, eight failed on one crate, and it is not part of std.

The split is 43/7 (re-derived 2026-08-18, milestone 64's third pass, by script/crate-probes). Bare script/crate-probes gives 43 built and 7 failed; --no-backend, without entropy_backend, gives 39/11. A crate in two failure classes counts once. How each number was derived is in crates-io-on-nife/probe-results.md.

The measurement, and the reasoning behind every pass over it, is in crates-io-on-nife/.

The long answer has a sting in it, and it is the block's own BUGS entry made concrete: a crate that compiles is not a crate that works. tempfile builds and links, and every one of its operations returns "operation not supported on this platform" at runtime, because it has an explicit fallback arm for platforms it does not know. Nothing in a green build says so. See What compiles and still does nothing.

How to reproduce this

script/crate-probes                  # all fifty: the table and the split
script/crate-probes regex tokio      # two of them
script/crate-probes --no-backend     # the same fifty without entropy_backend
script/crate-probes --keep           # leave the generated probe crates and their build logs

PROVISIONAL NAME (milestone 64 (std), 2026-08-18): names are an architect's and this one is not ratified.

It needs the network, so it is not a CI gate and script/test does not run it. It builds for aarch64 only, deliberately: the PAL speaks the capability ABI rather than an ISA, so a second target would re-measure the same thing at twice the cost. The parity that matters is std_exerciser's, which script/test runs on both.

A failing probe is rebuilt for the host, and reports BODY rather than FAIL if the host build fails too. That is the harness saying "my own call site is wrong, ignore this row", which is the check fifty hand-written mains could not give anyone.

The recipe the harness automates (one throwaway [[bin]] crate per probe, whose main must call the crate so the linker is asked to link it) is in crates-io-on-nife/probe-results.md.

What happened, by crate

Fifty crates, resolved versions as of 2026-08-04, built for aarch64-unknown-nife. 39 built with no change, from the pure-computation floor (itertools, memchr) through regex, serde_json, tokio's rt, rayon, clap and gix-hash. Twelve were rebuilt as executables that call the crate for real, and all twelve linked.

The 11 failures fall into four classes, and the class matters more than the crate:

The full table, the per-class errors and the getrandom decision are in crates-io-on-nife/probe-results.md.

What compiles and still does nothing

tempfile 3.27.0 selects its platform like this:

#[cfg_attr(any(unix, target_os = "redox", target_os = "wasi"), path = "unix.rs")]
#[cfg_attr(windows, path = "windows.rs")]
#[cfg_attr(not(any(unix, target_os = "redox", target_os = "wasi", windows)), path = "other.rs")]
mod platform;

other.rs is six functions, and every one of them is:

Err(io::Error::new(io::ErrorKind::Other, "operation not supported on this platform"))

So tempfile builds, links, and returns an error from NamedTempFile::new(). That matters far beyond tempfile, because gitoxide's atomicity story runs through it: gix-lock's commit calls self.inner.persist(&resource_path), which is gix-tempfile, which is tempfile::persist, which on nife is not_supported(). A gix that built cleanly would fail to write a single ref.

That paragraph was wrong about which failure came first, and the correction is worse than the claim (2026-08-18, milestone 64's third pass). Until that day NamedTempFile::new() did not return an error: it aborted the process. tempfile::env::temp_dir() delegates straight to std::env::temp_dir, nife had no sys/paths backend, and the shared fallback's temp_dir() is panic!("no filesystem on this platform"). The program died there, before other.rs was ever reached. Reading a crate's fallback arm and stopping is how that was missed: the analysis was right about tempfile and never asked what std did on the way in.

It is fixed as of that date (sys/paths/nife.rs), and fixing it changed nothing about the conclusion above, which is the point worth keeping. temp_dir now answers, other.rs now gets reached, and other.rs still refuses everything. The abort became the error this section always described.

The lesson for milestone 99 and 66 is a sequencing one. Do not read a passing build as a working crate, and do not order the work by what fails to compile: tempfile never appears on a build failure list and is on the critical path for git.

The prioritized gap list

This is the deliverable milestones 99 and 66 consume. It is not the order the milestone 27 table suggests, because that table counts functions and this counts demand.

The method: for each probe, take cargo tree -e normal --target aarch64-unknown-nife.json (normal edges only, so cc, autocfg, vcpkg and every proc-macro crate are excluded, since those run on the host and can call anything they like). Then grep every package's src/ for call sites of the std APIs the PAL refuses. The "probes" column is how many of the 50 dependency closures contain at least one call site.

rank gap PAL today probes packages note
1 getrandom backend CLOSED 2026-08-17 8 failed outright rand, uuid, ring, all of gix not a std gap; the entropy_backend workspace crate (named by calef, 2026-08-18). This cell said patches/getrandom-nife, which has never existed under that name
2 std::os::unix fallthrough absent, declined 21 34 mostly benign (behind cfg(unix)); fatal in filetime, gix-sec. See below
3 thread::spawn Unsupported, decided 20 33 rayon, crossbeam, tokio, diesel. The fork was resolved by DECISIONS §105 (declined) (2026-08-22): for want of a customer, not for want of a mechanism. See below, and notes/thread-spawn-fork.md
4 env::var CLOSED 2026-08-17 16 24 chrono (TZ), clap, gix, figment; vars() used to panic
5 fs::create_dir(_all) CLOSED, milestone 64 11 17 bound on MKDIR. create_dir_all also needed rank 19a
6 available_parallelism Ok(1) 11 7 answers honestly
7 fs::read_link Unsupported 10 10 no symlinks in the contract
8 File::set_len CLOSED 2026-08-17 10 9 TRUNCATE existed all along; only the size word was missing
9 fs::symlink_metadata bound 9 13 the row was stale: std routes it to lstat, which this PAL binds
10 std::os::fd absent 9 12 mio, memmap2, is-terminal
11 fs::read_dir CLOSED, milestone 64 8 13 bound on OPENDIR and READDIR
12 fs::remove_file CLOSED, milestone 64 7 12 bound on UNLINK
13 fs::remove_dir(_all) CLOSED, milestone 64, with remove_dir_all at milestone 122 (directory) 7 8 bound on RMDIR; remove_dir_all needed no verb once nested paths resolved
14 fs::hard_link Unsupported 7 4 no verb
15 Permissions readonly is false 7 8 authority is a capability, not a mode bit
16 env::temp_dir CLOSED 2026-08-18 11 9 it was a panic!, not a refusal; re-counted from 7
16a env::split_paths CLOSED 2026-08-18 8 4 also a panic!; no row existed, and no namespace in it
16b process::id CLOSED 2026-08-18 5 5 also a panic!; gix-tempfile's fork check
17 process::Command no PAL at all 6 10 gix-command, gix-credentials
18 env::current_dir Unsupported, declined 6 5 refuses honestly; it is the namespace question
19 Metadata::modified CLOSED 2026-09-19, by path 5 7 bound on GETMTIME, which milestone 47 (navigation)'s touch added on 2026-08-24; the reason column said a wire change was needed for three weeks after it stopped being true. Through an open File it still refuses (the verb takes a name); see notes/std.md
19a Path::is_dir on a directory was always false (not counted) closed with the five above; create_dir_all needed it
20 fs::set_permissions Unsupported 4 3
21 TcpListener CLOSED 2026-08-18 4 11 the LISTEN verb landed at milestone 107 (socket); the reason column was stale for a fortnight
22 ToSocketAddrs / DNS numeric only 4 5
23 Metadata::created Unsupported 3 3
24 set_nonblocking Unsupported 3 4 contract is blocking-only
25 fs::rename CLOSED, milestone 64 2 2 bound on RENAME; undercounted, see BUGS
26 fs::copy CLOSED 2026-08-17 2 2 needs no verb: an open, a read/write loop, two closes
27 fs::canonicalize Unsupported 2 1
28 File::set_times fs::set_times CLOSED 2026-09-19; File::set_times still Unsupported 2 1 SETMTIME_AT sets by name, needing dir::WRITE and dir::SET_MODIFICATION_TIME_AT (§112 (touch's two behaviors need two rights)); a handle has no name, so the File form is design/roadmap/0504-an-mtime-for-an-open-file.md
29 File::try_clone Unsupported 2 1 a handle is one session's token (§27)
30 File::lock/try_lock Unsupported 2 1 gix-tempfile
31 read/write timeouts Unsupported 1 1
32 Metadata::accessed Unsupported 0 0 nobody asked for it

The later passes, and what each found

Milestone 64 worked the list in four passes. The full reasoning for every closure and every refusal is in crates-io-on-nife/later-passes.md.

BUGS

What this says about milestone 99 (gitoxide) and milestone 66 (Vaultwarden)

Milestone 99's decision holds, and the measurement strengthens it. The block says gitoxide's gaps "are this project's own roadmap rather than a compatibility project". That is what was found: gix's blockers are a getrandom backend, gix-sec's uid lookup, and tempfile's persist, plus the five fs bindings above. Every one of them is either PAL surface this tree wants anyway or a small patch under patches/. Nothing in gitoxide's tree wants fork, and nothing wants a C library.

Three things the block does not currently say, which the measurement adds:

  1. getrandom is the first task, not an incidental. Nothing in gix builds without it.
  2. tempfile is the second, and it is invisible to a build-failure list. gix-lock cannot commit a ref until tempfile::persist works, which means fs::rename matters far more than its rank-25 position says.
  3. gix-command and gix-credentials call process::Command, for which there is no PAL at all. Whether the staged git init/commit/log path reaches them is unknown; if it does, it is a design fork (this kernel spawns by capability) rather than a porting task, exactly as the block says for C git.

Milestone 66 is further away than milestone 99, and the measurement says by how much. Rocket fails at socket2 before any Vaultwarden code is reached, diesel needs libsqlite3, and ring needs a C toolchain for this target. Those are three separate subsystems (a readiness IO model, the C seam at library scale, and a socket contract with listen/accept), and none of them is a std gap that widening the PAL would close.