code wiki / _hdl_build / nx_badimport_probe.nx
nx_badimport_probe.nx source
↩ module page · 17 lines · 1011 B
1// nx_badimport_probe.nx -- FAIL-OPEN PROBE for seq650: an UNRESOLVED import must be a LOUD ERROR.
2// Imports resolve DIRECTORY-LOCAL, and the reported defect is that nx_cc emits an EMPTY elf on an
3// unresolved import instead of hard-erroring -- so three real organs (nx_dataeng_compare_page,
4// nx_site_archetype, nx_site_build) "built successfully" and produced nothing.
5//
6// HOW TO READ THIS PROBE: it is the one probe that PASSES BY FAILING TO BUILD. A loud
7// build failure naming the missing module is the CORRECT outcome. A "BUILT" line -- especially one
8// with a 0-byte or tiny artifact -- is the defect reproducing. Never "fix" this file's import.
9import "nx_syscalls.nx"
10import "nx_this_module_does_not_exist_seq650_probe.nx"
11
12func main() -> i64 {
13 // Unreachable if the toolchain behaves: the import above must stop the build first.
14 sys_write(1, "BADIMPORT-PROBE REACHED MAIN -- seq650 STILL-LIVE (unresolved import produced a runnable binary)\n" as *u8, 97)
15 sys_exit(1)
16 return 1
17}