Skip to content

WASM component build hygiene: no .bazelignore + wasm_component.rs escapes the CI lint gate #14

@avrabe

Description

@avrabe

Found while exercising the WASM component build (bazel build //:all) to check the Synth/Meld toolchain. The toolchain itself is fine — the build succeeded (78 targets, 687 actions). But it surfaced two wohl-side gaps.

1. No .bazelignore

bazel build //... and bazel query //... traverse into .claude/worktrees/ (agent worktrees are full repo checkouts with their own BUILD.bazel) and fail:

ERROR: error loading package '.claude/worktrees/.../proofs/rocq':
  Unable to find package for @rules_rocq_rust ...

.claude/ is tooling state, never a build input. Add a .bazelignore at repo root containing .claude. Without it, the future "bazel build in CI" job (tracked in #8) is unreliable — it works only when no agent worktree happens to be present.

2. src/wasm_component.rs has zero lint coverage

Each component crate's [lib] points at plain/src/lib.rs. The WASM binding glue in src/wasm_component.rs is compiled only by the Bazel rust_wasm_component_bindgen rule — never by cargo. So CI's cargo clippy --workspace and cargo fmt never see these 6 files. The bazel build revealed warnings that are invisible to the cargo gate:

  • static_mut_refs (Rust 2024 edition) — all 6 wasm_component.rs files use static mut TABLE: Option<...> + fn get_table() -> &'static mut .... Rust 2024 warns on shared/mutable refs to mutable statics (crates/wohl-{leak,temp,air,door,power,alert}/src/wasm_component.rs). Should move to SyncUnsafeCell or a sound singleton.
  • dead codeMAX_OUTPUT_QUEUE unused at crates/wohl-alert/src/wasm_component.rs:15.

Suggested fixes

  • Add .bazelignore with .claude (and bazel-* if not already covered).
  • Either run clippy over the WASM targets in CI (via bazel build with --output_groups or a rust_clippy aspect), or add a cargo lint pass that includes src/wasm_component.rs.
  • Fix the static_mut_refs pattern across all 6 WASM components.
  • Remove the dead MAX_OUTPUT_QUEUE const.

Note on Meld / Loom / Synth

No bug was found in those tools — this issue was filed against wohl because the gaps are in wohl's own build config and binding code. The WASM compile/fuse chain worked correctly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions