notes

UFS2's Rust crates on nife's targets, 2026-10-31 (provisional name)

Name: provisional, minted 2026-10-31 (UTC) by milestone/981-ufs2-launch-filesystem.

Measured 2026-10-31 (UTC) on a Linux x86_64 host, by lane milestone/981-ufs2-launch-filesystem, at base 3a443babb. It is the measurement milestone 981 (UFS2, read and write: a Rust server with FreeBSD's tools as the oracle) made before §34 refused it. It set out to build ufs-core and rufs for the three bare targets, record what stops each, and price the no_std patch. The scripts, probes and patches are in ufs2-builds-2026-10-31/. nife does not build a UFS2 server (§34 (RedoxFS is the primary filesystem, on three conditions), ruled 2026-10-31 UTC on #2927), so nothing here enters the tree beyond this note and its probes.

Result

The table

a, r and x are aarch64, riscv64 and x86_64. "bare" is aarch64-unknown-none-softfloat, riscv64imac-unknown-none-elf and x86_64-unknown-none with no std; "nife" is targets/*-unknown-nife.json with this tree's std. Code lines are lines that are neither blank nor a comment, outside #[cfg(test)] modules.

crate version, released license code lines bare, shipped a/r/x bare, patched nife, shipped nife, patched
ufs-core 0.1.5, 2026-07-25 Apache-2.0 1,218 (974 without its vfs layer) fail: thiserror needs std pass, +6 lines pass pass, same patch
rufs 0.6.0, 2025-09-27 BSD-2-Clause 2,615 fail: bincode needs std pass, +422 -39 lines, not kept fail: no std::os::unix pass, +49 -17 lines

Both pass on the host, shipped and patched. Upkeep, looked up: ufs-core's repository was last pushed 2026-09-20, has one star and six releases in ten days of July 2026. rufs lives in fuse-ufs, last pushed 2026-07-28, with 29 stars and 18 open issues.

What stops each build, and what the patch does

ufs-core, bare

The crate does not declare no_std, so cargo builds thiserror with std and the build stops there. The patch turns thiserror's default features off, declares no_std except under test and the optional vfs feature, and imports Vec and vec! from alloc in three files. Its tests pass with the patch: 68 without vfs, 80 with it.

ufs-core, nife

Nothing stops it.

rufs, nife

Three things, all portability rather than logic. It names errno values through libc, which defines none for os = "nife". It reaches the bytes of an OsStr through std::os::unix, which nife's std does not have. And its convenience opener reads a file's st_blksize. The patch adds an errno module (the host's values on unix, Linux's numbers elsewhere), uses OsStr's portable byte methods, and defaults the block size to 4096 off unix.

One change in it is about behavior, not the build. rename decided that a destination was absent by matching ErrorKind::NotFound, and nife's std reports every raw error code as Uncategorized (decode_error_kind in its PAL). Built for nife unchanged, rename onto a new name would fail with ENOENT. The patch matches the errno instead, which is what the code's own TODO asks.

rufs, bare

The tree does not keep this port; commit 5b3fa280e on #2917 carries its patch and probe. Everything above, plus std::io, std::ffi, std::time and bincode's std feature. The port adds a default std feature that keeps the published behavior and a compat module that re-exports std's io, ffi and time when it is on. With it off, compat supplies small stand-ins: Read, Write, Seek, BufRead, Cursor and an errno-carrying Error; a byte-string OsStr; and a SystemTime whose clock the caller installs with set_clock, since a crate with no std has none. bincode stays, reached through its reader and writer traits instead of std::io. Every other file changes only its use lines.

The host round trip

probe.sh check fetches rufs's own test image, which its maintainers made on FreeBSD with newfs and populated through FreeBSD's kernel (pinned to commit fb4675b7, hash checked). It then runs probes/rufs-host.rs twice, against the published crate and against the nife-std patch, and diffs the two outputs. They are identical, 44 lines each, and the no_std port's run printed the same 44.

The image holds files, three levels of directories, two symlinks (one 1,023 bytes long), three sparse files up to 549,890,457,600 bytes, and three files with extended attributes, one carrying 2,297 of them. ufs-core returns the same bytes as rufs for every regular file, and refuses all three sparse files with impossible geometry: di_size ... exceeds bound 4194304, the volume's length.

The writes were create, a 200,000-byte write, mkdir, symlink, rename without and with replace, truncate to 70,000 bytes, and unlink. Each did what it should except the rename without replace, which returned EEXIST for a name that did not exist: the function looks up the source name in the source directory where it means the destination. Every build shows it, so no patch here changes it.

What this would mean for a server

A UFS2 server would have been a std program, as jig is. It would vendor rufs with the 49-line patch, link user_mode_runtime for capability IPC, and need the clock slot from whoever starts it, because rufs calls SystemTime::now() on every new inode and nife's std panics there without one. Its errors pass through a std::io layer whose kinds carry no information on nife, so it would map rufs's errno values, never ErrorKind. rufs 0.6.0 depends on bincode 2.0.1; upstream's unreleased main replaces it with bincode-next 3.1.1, which passes cargo deny's advisories and licenses. The no_std port measured above would have been the other shape, at +422 −39 lines.

Method, and how to re-take it

From the repository root, after cargo xtask std-src:

notes/ufs2-builds-2026-10-31/probe.sh bare shipped
notes/ufs2-builds-2026-10-31/probe.sh bare patched
notes/ufs2-builds-2026-10-31/probe.sh nife shipped
notes/ufs2-builds-2026-10-31/probe.sh nife patched
notes/ufs2-builds-2026-10-31/probe.sh check

bare patched builds ufs-core alone, since the tree keeps no no_std patch for rufs.

bare builds a freestanding binary with a panic handler and the tree's vendored talc allocator (probes/bare.rs) using the pinned toolchain's prebuilt core and alloc. nife is the 2026-10-07 note's recipe: -Zbuild-std against this worktree's farm, probes generated outside the repository, release, panic = "abort". The patched variant copies the crate from cargo's registry, applies patches/<crate>-<mode>.patch, and builds against the copy, so each line count above is the diff a reader can apply. Every probe calls the crate's read path, and the rufs probes call its write path, so the linker has to resolve them.

The advisory and license results come from cargo deny check advisories licenses, run in the check probes with the tree's deny.toml.

BUGS