You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix: Replace embedded wit_bindgen runtime with proper crate dependency
The rust_wasm_component_bindgen rule had embedded broken runtime stubs
for wit_bindgen::rt module with unsafe dummy pointer hacks:
- Returned dummy pointer (1 as *mut u8) causing UB
- 114 lines of manual stub code requiring maintenance
- Version drift risk when wit-bindgen updates
- Incomplete allocator integration
Replace embedded stubs with proper wit-bindgen crate dependency:
1. Added wit-bindgen v0.43.0 crate to MODULE.bazel
2. Simplified wrapper from 114 lines to 4 lines (pub use wit_bindgen)
3. Added @crates//:wit-bindgen dependency to bindings libraries
4. Removed complex filtering logic (80 lines of Python scripts)
- ✅ Correct: Proper allocator integration, no UB
- ✅ Maintainable: 97% reduction in custom runtime code
- ✅ Future-proof: Automatic version updates via crate_universe
- ✅ Cross-platform: Real implementation works everywhere
Run after pulling:
bazel mod tidy
bazel build //examples/basic:hello_component
bazel test //examples/basic:hello_component_test
See docs/embedded_runtime_fix.md for full details.
0 commit comments