code wiki / _hdl_build / nx_decollide.nx

nx_decollide.nx

buildroot/runtime/_hdl_build/nx_decollide.nx

8750 B161 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_decollide.nx -- NAME-COLLISION resolver: two DIFFERENT libraries share a basename in two dirs (0 shared functions -- NOT versions of one lib; converging would delete a real module). Keep the CANONICAL copy's name (e.g. the one that is a build target, or the majority), and rename ONLY the other copy to a distinct semantic name + repoint ONLY the importers that resolve it. Sound + FULL-SCALE by construction: the renamed copy keeps its exact bytes (just a new name), so lib-importers are behaviour-preserved and their transitive dependents are provably unaffected -- only the DIRECT importers can change, so we rebuild EVERY buildable direct importer and require byte-identical. Commit iff all match, else restore every source + rename back (never-brick). Handles the build-target case (keep the target's name) and third-dir importers (they resolve the kept copy -> untouched) that nx_split_resolve cannot. argv: <lib> <keepdir> <rndir> <newname> <buildonly-elf> <direct-importer-srcpath>... e.g. nx_decollide nx_debt runtime/_hdl_build runtime nx_debt_strategy _offc/nx_buildonly.elf <importers> (keep the _hdl_build tool as nx_debt; rename the runtime strategy-lib to nx_debt_strategy) exit: 0 DECOLLIDED | 1 REFUSED (all restored) | 2 usage/precondition | 3 filesystem move error license_tier: ORIGINAL No hw writes (Rule 26): edits .nx source + rebuilds only.

dependencies 4 imports · 0 importers

nx_resolve_lib.nx nx_seat_drive_lib.nx nx_seg_store.nx nx_syscalls.nx nx_decollide.nx

imports: nx_resolve_lib.nxnx_seat_drive_lib.nxnx_seg_store.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sd_w sys_write sys_exit sys_mmap sd_cat rl_mktok_name rl_strlen rl_strlen ↻ rl_read sys_openat_rd sys_read sys_close rl_eq sys_openat_rd ↻ sys_close ↻ rl_basename rl_strlen ↻ rl_tmpp sd_cat ↻ ss_writefile sys_openat_wr sys_write ↻ sys_close ↻ sys_fsync rl_dirname rl_strlen ↻ rl_streq rl_build sys_unlinkat sys_mmap ↻ dep_run_capture sys_fork sys_openat_wr ↻ sys_dup3 sys_mmap ↻ sys_execve_clean sys_close ↻ sys_execve sys_exit ↻

structs

none

consts

20const DC_MAXC: i64 = 256

functions

22func main(argc: i64, argv: *i64) -> i64