notes

What still ends a nife process

An appendix to notes/std.md, which is the page to read. This file holds the five calls that compiled and then killed the process, and the cargo xtask std-aborts check with its EXAMPLES and BUGS. The directory notes/std/ and this file's stem are provisional names. Naming is calef's.

The records this file cites by number:

What still ends a nife process

(Milestone 64, fourth pass, 2026-08-18.)

The dangerous std call is not the one that returns Unsupported. It is the one that compiles and then kills you. Five have been found so far, each by a different accident:

call what it was found by
std::env::vars() panic!("not supported on this platform") working the ranked gap list and noticing a neighbor
std::env::temp_dir() panic!("no filesystem on this platform") reading every module the PAL falls through
std::env::split_paths() panic!("unsupported") the same reading
std::process::id() panic!("no pids on this platform") the same reading
std::process::exit() crate::intrinsics::abort() cargo xtask std-aborts

None of them could appear on a gap list, because notes/crates-io-on-nife.md's list is built from PAL functions that answer Unsupported, and a function that ends the process never answers. And the fifth could not be found by the method that found the middle three either: sys/exit.rs is not a sys/<module>/mod.rs backend, it is one file with a cfg_select! inside a function, so "read every module the PAL falls through" walks straight past it.

So the reading became a check.

cargo xtask std-aborts       # on its own, against whatever the farm last built
script/test                  # runs it too: `std-exerciser` ends with it

What it does

It asks the compiler which library/std/src/sys/ sources it actually compiled for the nife targets, by unioning every library/std/src/sys/ path out of cargo's own dep-info under std_exerciser/target/. It greps exactly those for bodies that end a process: panic!, unimplemented!, todo!, rtabort!, intrinsics::abort(), panic_nounwind. Comment lines are skipped, because this tree's PAL files discuss the panics they replaced at length.

What it finds is compared against ABORTS_ACCEPTED in xtask/src/farm/aborts.rs, which carries the reason for every entry. A new one fails the build with the file, the line, and the two things it can be. That makes the reading rung two of AGENTS.md's ladder, a check, where it had been rung four, a person reading. Today there are 26 across 79 compiled sources, in three groups:

EXAMPLES

Adding a panic! to a compiled fallback and running the check:

$ cargo xtask std-aborts
std-aborts: a std source compiled for nife ends the process somewhere new:
  sys/net/hostname/unsupported.rs:7: pub fn invented() -> ! { panic!("no hostname on this platform") }

and a clean tree:

$ cargo xtask std-aborts
std-aborts: 26 process-ending bodies across 79 compiled std sources, all accounted for

What the check holds exit to, read off the binary rather than off the source, which is the form of evidence this milestone is short of:

$ llvm-objdump -d --demangle std_exerciser/target/aarch64-unknown-nife/release/std_exerciser
000000000040c290 <std::process::exit>:
  40c290: stp  x30, x19, [sp, #-0x10]!
  40c294: mov  w19, w0
  40c298: bl   0x40eaf0 <std::rt::cleanup>      ; flush stdout, announce end of stream
  40c29c: sxtw x0, w19                          ; the exit code
  40c2a0: mov  x8, xzr                          ; SYS_EXIT
  40c2a4: svc  #0

000000000040c2b0 <std::process::abort>:
  40c2b0: brk  #0                               ; still a fault, which is what abort MEANS

exit flushes and calls SYSTEM_CALL_EXIT; only abort is the brk. The bug this check exists for is exit compiling to that same brk, under the name of the call that is supposed to be the clean one.

BUGS