#!/usr/bin/env nu # Build the shared startup object and describe its standard WASI numeric-exit import. def main [] { let here = $env.FILE_PWD ^wasm-tools component embed ($here | path join exit.wit) --only-custom -o ($here | path join exit-meta.bin) if $env.LAST_EXIT_CODE != 0 { error make {msg: 'startup metadata failed'} } ^rustc ($here | path join init.rs) --edition 2024 --crate-type lib --emit=obj --target wasm32-wasip2 -C opt-level=s -C panic=abort -o ($here | path join init.o) if $env.LAST_EXIT_CODE != 0 { error make {msg: 'startup object compile failed'} } }