From 6f0825617ddd274d4116e37bd4ab37b594267e16 Mon Sep 17 00:00:00 2001 From: Ralf Anton Beier Date: Fri, 14 Nov 2025 19:22:07 +0100 Subject: [PATCH] fix: make bitflags macro publicly accessible from generated bindings Changed pub(crate) use bitflags; to pub use bitflags::bitflags; in the embedded wit_bindgen runtime. This allows external crates that depend on the generated bindings to access the bitflags macro when they use WASI filesystem interfaces. The pub(crate) visibility restricted access to within the bindings crate itself, preventing downstream users from accessing the macro through the expected path: crate::wit_bindgen::rt::bitflags::bitflags! Tested with: - //examples/basic:hello_component_bindings_host (native-guest mode) - //tools/checksum_updater_wasm:checksum_updater_wasm_component (WASI filesystem) --- rust/rust_wasm_component_bindgen.bzl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rust/rust_wasm_component_bindgen.bzl b/rust/rust_wasm_component_bindgen.bzl index 0436d490..a6477113 100644 --- a/rust/rust_wasm_component_bindgen.bzl +++ b/rust/rust_wasm_component_bindgen.bzl @@ -160,9 +160,9 @@ pub mod wit_bindgen { // Bitflags module for WASI interfaces pub mod bitflags { - // Re-export bitflags macro without #[macro_export] + // Re-export bitflags macro for public access from other crates // Generated code expects: crate::wit_bindgen::rt::bitflags::bitflags! - pub(crate) use bitflags; + pub use bitflags::bitflags; } } } @@ -254,9 +254,9 @@ pub mod wit_bindgen { // Bitflags module for WASI interfaces pub mod bitflags { - // Re-export bitflags macro without #[macro_export] + // Re-export bitflags macro for public access from other crates // Generated code expects: crate::wit_bindgen::rt::bitflags::bitflags! - pub(crate) use bitflags; + pub use bitflags::bitflags; } } }