Commit a853591
committed
build(wasm_sandbox): commit compiled WIT artifact + CI drift check
host_bindgen!() consumes a compiled WIT component (sandbox-world.wasm),
which was previously .gitignored and only produced by `just wasm
guest-compile-wit`. That left silent breakage for source-distribution
consumers (`pip install git+...`, `cargo install`, etc.) because
the artifact is read by transitive deps -- specifically the
hyperlight-wasm-runtime proc-macro -- BEFORE our own build scripts can
run. A build.rs in this crate cannot solve the bootstrap (the runtime
is compiled first in the dep graph, and would race ABI with our
fresh bindings even if it succeeded).
The pragmatic, well-trodden fix used by most WIT-component projects:
check the compiled artifact into git so it exists from clone time.
Changes:
- .gitignore: add `!src/wasm_sandbox/wit/sandbox-world.wasm` to opt
this specific artifact out of the broad `*.wasm` exclusion.
- Commit the current 16235-byte canonical artifact produced by
`wasm-tools component wit ... -w`.
- CI: add a `Check WIT artifact is in sync` step to the wasm-sandbox
matrix job that regenerates the file via `just wasm
guest-compile-wit` then `git diff --exit-code`s it, failing fast
if a contributor edits the .wit source without committing the
regenerated artifact.
Developer flow stays the same: edit .wit, run `just wasm
guest-compile-wit` (also chained inside `just wasm build`), commit
both files together.
Signed-off-by: Simon Davies <simongdavies@users.noreply.github.com>1 parent cda573b commit a853591
3 files changed
Lines changed: 14 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
90 | 99 | | |
91 | 100 | | |
92 | 101 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
Binary file not shown.
0 commit comments