code wiki / _hdl_build / nx_bless.nx
nx_bless.nx
buildroot/runtime/_hdl_build/nx_bless.nx
about
nx_bless.nx -- the first-class BLESS step (addresses finding F2, project-nishi-eng-findings-2026-06-23): turn a
freshly-built organ into a DURABLE _offc twin so the one clock (and any deploy) can point a registry at a stable
elf instead of an ephemeral /tmp build. Sovereign, build-verify-install:
nx_bless <organ-name> -> build <organ-name> --build-only (the runner) -> verify the /tmp elf (ELF magic +
size) -> atomically install to _offc/<organ-name>.elf (tmp + rename) + chmod +x.
Run it DIRECTLY with the arg (the runner does not forward argv): `/tmp/nx_bless.sov.elf <name>` (or its own
_offc twin once blessed). NOTE: uses single-cast literals as func args + slot-assignments only -- it deliberately
AVOIDS the `"literal" as *u8 as i64` direct-__syscall-arg gotcha (finding F1). license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 11 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 12 | func wn(v: i64) -> i64 { var m: i64=v; if m<0{w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 13 | func bcat(dst: *u8, o: i64, s: *u8) -> i64 { var x: i64=o; var i: i64=0; while s[i]!=(0 as u8){dst[x]=s[i];x=x+1;i=i+1} return x } called by 1: main |
| 15 | func main(argc: i64, argv: *i64) -> i64 |