Files
sausage/spikes/s6-esbuild/diagnose.nu
T
surma 9e9cde5241 spikes: six v3 spikes (V8 harness, WASI shell, git, builder, http hook, esbuild)
Throwaway prototypes for Sausage v3. Plan and decisions:
~/research/sausage-v3/PLAN.md. Results and evidence: the spike READMEs.
2026-11-06 14:03:20 +00:00

20 lines
925 B
Nu

# Compare Go initialization and exact runtime clock calls with the stock adapter.
def main [] {
let fixture = $env.FILE_PWD
let root = '/tmp/s6-esbuild'
with-env {GOOS: wasip1, GOARCH: wasm} {
^go build -o $'($root)/hello-http.wasm' ($fixture | path join hello.go)
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'Go probe build failed'} }
}
for probe in [
{input: $'($root)/hello-http.wasm', output: hello-http},
{input: ($fixture | path join clocks.wat), output: clocks}
] {
^wasm-tools component new $probe.input --adapt $'wasi_snapshot_preview1=($root)/adapter-v49.wasm' -o $'($root)/($probe.output).component.wasm'
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'probe adaptation failed'} }
^wasmtime run $'($root)/($probe.output).component.wasm'
if $env.LAST_EXIT_CODE != 0 { error make {msg: 'probe execution failed'} }
print $'PASS stock adapter: ($probe.output)'
}
}