box: document startup-aware builds and verify archive preservation
This commit is contained in:
+10
-4
@@ -85,14 +85,20 @@ Archive failures return the completed command and an availability notice. Never
|
||||
|
||||
## Build and validation
|
||||
|
||||
From the repository root:
|
||||
Build the shared startup object from the repository root:
|
||||
|
||||
```sh
|
||||
nix develop -c nu --no-config-file userland/cwd-init/build.nu
|
||||
```
|
||||
|
||||
Run the following commands from `userland/` so Cargo loads the shared startup and numeric exit support:
|
||||
|
||||
```sh
|
||||
df -h /
|
||||
export CARGO_TARGET_DIR=/home/surma/src/gitea.surma.technology/surma/sausage/target/p1-tools
|
||||
nix develop -c cargo build --manifest-path userland/Cargo.toml -p box-cli --target wasm32-wasip2 --release --locked
|
||||
nix develop -c cargo build -p box-cli --target wasm32-wasip2 --release --locked
|
||||
nix develop -c kache stats
|
||||
nix develop -c nu userland/box/test.nu
|
||||
nix develop -c nu box/test.nu
|
||||
```
|
||||
|
||||
The existing `userland/bundle.nu` discovers the workspace member and copies its `box` binary into `/bin`.
|
||||
@@ -103,7 +109,7 @@ Stop before a build if disk use exceeds 85%.
|
||||
Run pure unit tests with the native target from `rustc -vV`, for example:
|
||||
|
||||
```sh
|
||||
nix develop -c cargo test --manifest-path userland/Cargo.toml -p box-cli --target aarch64-unknown-linux-gnu --locked
|
||||
nix develop -c cargo test -p box-cli --target aarch64-unknown-linux-gnu --locked
|
||||
```
|
||||
|
||||
The real-service script tests every required command and removes every created box, including after an assertion failure.
|
||||
|
||||
@@ -45,7 +45,8 @@ def main [component: path = '/home/surma/src/gitea.surma.technology/surma/sausag
|
||||
let bytes = (open --raw ($root | path join ($archive | str trim --left --char '/')))
|
||||
check (($bytes | bytes length) == 1200003) 'full binary archive retains byte total'
|
||||
let repeated = (call $component $root [exec $id -- sh -c 'printf collision-check'] | require)
|
||||
check ($repeated.stdout == 'collision-check') 'later archive leaves earlier output intact'
|
||||
check ($repeated.stdout == 'collision-check') 'later exec returns output'
|
||||
check ((open --raw ($root | path join ($archive | str trim --left --char '/'))) == $bytes) 'later archive leaves earlier output intact'
|
||||
let log = (call $component $root [logs $id] | require)
|
||||
check ($log.stderr | str contains 'box build archive:') 'logs retains build archive'
|
||||
let wit = (^wasm-tools component wit $component | complete)
|
||||
|
||||
Reference in New Issue
Block a user