Commit 0467e30
committed
feat(bazel): full AADL → WIT → wit-bindgen → .wasm component chain builds
Real end-to-end Bazel build using rules_wasm_component pinned to a
specific main-branch SHA (the v1.0.0 tag predates the Bazel-9
CcInfo migration). The chain:
arch/kvs.wit
│
▼ wit_library + rust_wasm_component_bindgen
│ (in BUILD.bazel)
│
src/lib.rs implements the wit-bindgen-generated `Guest` trait
│
▼ rust + WASI sysroot toolchain (pulled by rules_wasm_component)
│
bazel-bin/.../kvs_component_*_wasm_base.wasm ← real .wasm
Local + CI:
bazel build //... ✓ Build completed successfully
bazel test //:kvs_component_test ✓ PASSED
If src/lib.rs's `impl Guest for Component` doesn't match the WIT
signatures (renamed method, wrong arity, drifted error variant),
the Rust compile fails. The binary contract is enforced at build
time — the operational difference from eclipse-score's
interface-as-documentation model is now demonstrably real, not
narrative.
## Files
- MODULE.bazel — rules_wasm_component via git_override (SHA-pinned
to main; v1.0.0 tag has a Bazel-9 incompat issue); rules_rust,
bazel_skylib, platforms; crate_universe (`@crates`) wired to
Cargo.toml for the bitflags + wit-bindgen runtime deps the
bindgen rule needs (known wart in rules_wasm_component — its
docstring explicitly tells external consumers to wire this).
- BUILD.bazel — wit_library + rust_wasm_component_bindgen +
rust_wasm_component_test.
- Cargo.toml + Cargo.lock — bitflags + wit-bindgen 0.46 (matched
to the CLI version rules_wasm_component embeds).
- src/lib.rs — in-memory KVS impl. ~80 LOC; implements the WIT
`Guest` trait with store / load / delete / snapshot_create /
snapshot_restore. Key validation gates per
COMP-REQ-KVS-KEY-NAMING.
- .github/workflows/validate.yml — bazel-wasm-component job
installs bazelisk and runs `bazel build //...` + `bazel test`
on every push/PR.
- .gitignore — bazel-* outputs, MODULE.bazel.lock, target/
README updated to reflect that the chain actually builds (status
table at the top now uses ✅ / 📄 instead of "real infrastructure
/ skeleton" prose).
This closes the user's "but then you need the full stack with
bazel as well or?" question: yes, and it does now.1 parent aecaf86 commit 0467e30
9 files changed
Lines changed: 709 additions & 19 deletions
File tree
- .github/workflows
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
0 commit comments