diff --git a/Cargo.lock b/Cargo.lock index 68b1455..c96106b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -41,7 +41,6 @@ dependencies = [ name = "aggregate-wit-ui" version = "0.1.0" dependencies = [ - "bitflags 2.5.0", "minijinja", "thiserror", "wasmtime", @@ -212,7 +211,6 @@ checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" name = "calculator" version = "0.1.0" dependencies = [ - "bitflags 2.5.0", "wit-bindgen-rt", ] @@ -696,7 +694,6 @@ dependencies = [ name = "edwards-ui" version = "0.1.0" dependencies = [ - "bitflags 2.5.0", "wit-bindgen-rt", "wurbo 0.3.2", ] @@ -705,7 +702,6 @@ dependencies = [ name = "edwards-wit" version = "0.1.0" dependencies = [ - "bitflags 2.5.0", "ed25519-dalek", "serde", "serde_json", @@ -1157,7 +1153,6 @@ dependencies = [ name = "math" version = "0.1.0" dependencies = [ - "bitflags 2.5.0", "wit-bindgen-rt", ] @@ -1578,7 +1573,6 @@ dependencies = [ name = "seed-keeper-wallet" version = "0.1.0" dependencies = [ - "bitflags 2.5.0", "seed-keeper-core", "serde", "serde_json", @@ -1593,7 +1587,6 @@ name = "seed-keeper-wit-ui" version = "0.1.0" dependencies = [ "base64ct", - "bitflags 2.5.0", "seed-keeper-events", "serde", "serde_json", @@ -2698,9 +2691,12 @@ dependencies = [ [[package]] name = "wit-bindgen-rt" -version = "0.24.0" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0780cf7046630ed70f689a098cd8d56c5c3b22f2a7379bbdb088879963ff96" +checksum = "29c7526379ace8709ee9ab9f2bb50f112d95581063a59ef3097d9c10153886c9" +dependencies = [ + "bitflags 2.5.0", +] [[package]] name = "wit-parser" diff --git a/Cargo.toml b/Cargo.toml index ef1009b..611dd8f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,8 +10,7 @@ description = "Tools for working with crypto seeds." [workspace.dependencies] seed-keeper-core = { path = "crates/seed-keeper-core" } seed-keeper-events = { path = "crates/seed-keeper-events" } -bitflags = "2.5.0" -wit-bindgen-rt = "0.24.0" +wit-bindgen-rt = { version = "0.26.0", features = ["bitflags"] } wurbo = "0.3.2" [package] diff --git a/crates/seed-keeper-wallet/Cargo.toml b/crates/seed-keeper-wallet/Cargo.toml index cd4fc51..0125a95 100644 --- a/crates/seed-keeper-wallet/Cargo.toml +++ b/crates/seed-keeper-wallet/Cargo.toml @@ -6,8 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bitflags = { workspace = true } -wit-bindgen-rt = { workspace = true } +wit-bindgen-rt = { workspace = true, features = ["bitflags"] } seed-keeper-core = { workspace = true } [dev-dependencies] diff --git a/crates/seed-keeper-wallet/src/bindings.rs b/crates/seed-keeper-wallet/src/bindings.rs index 219aad8..f4778a3 100644 --- a/crates/seed-keeper-wallet/src/bindings.rs +++ b/crates/seed-keeper-wallet/src/bindings.rs @@ -1,8 +1,10 @@ -// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! // Options used: +#[allow(dead_code)] pub mod seed_keeper { + #[allow(dead_code)] pub mod wallet { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod types { #[used] #[doc(hidden)] @@ -32,10 +34,13 @@ pub mod seed_keeper { } } } +#[allow(dead_code)] pub mod exports { + #[allow(dead_code)] pub mod seed_keeper { + #[allow(dead_code)] pub mod wallet { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod config { #[used] #[doc(hidden)] @@ -56,6 +61,8 @@ pub mod exports { arg5: *mut u8, arg6: usize, ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let len0 = arg1; let len1 = arg3; let result3 = T::set_config( @@ -109,6 +116,8 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_encrypted_cabi() -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let result0 = T::get_encrypted(); let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); match result0 { @@ -155,6 +164,8 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_get_seed_cabi() -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let result0 = T::get_seed(); let ptr1 = _RET_AREA.0.as_mut_ptr().cast::(); match result0 { @@ -249,6 +260,11 @@ pub mod exports { } mod _rt { pub use alloc_crate::vec::Vec; + + #[cfg(target_arch = "wasm32")] + pub fn run_ctors_once() { + wit_bindgen_rt::run_ctors_once(); + } pub unsafe fn invalid_enum_discriminant() -> T { if cfg!(debug_assertions) { panic!("invalid enum discriminant") @@ -297,7 +313,7 @@ macro_rules! __export_keeper_impl { pub(crate) use __export_keeper_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.21.0:keeper:encoded world"] +#[link_section = "component-type:wit-bindgen:0.25.0:keeper:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 417] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xa4\x02\x01A\x02\x01\ @@ -308,7 +324,7 @@ A\x05\x01B\x04\x01p}\x01k\0\x01r\x03\x08username\0\x08password\0\x09encrypted\x0 \x01\x04\x01s\x01@\0\0\x05\x04\0\x0dget-encrypted\x01\x06\x04\0\x08get-seed\x01\x06\ \x04\x01\x1fseed-keeper:wallet/config@0.1.0\x05\x02\x04\x01\x1fseed-keeper:walle\ t/keeper@0.1.0\x04\0\x0b\x0c\x01\0\x06keeper\x03\0\0\0G\x09producers\x01\x0cproc\ -essed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x060.21.0"; +essed-by\x02\x0dwit-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)] diff --git a/crates/seed-keeper-wit-ui/Cargo.toml b/crates/seed-keeper-wit-ui/Cargo.toml index c27ef64..0e086e8 100644 --- a/crates/seed-keeper-wit-ui/Cargo.toml +++ b/crates/seed-keeper-wit-ui/Cargo.toml @@ -7,8 +7,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -bitflags = { workspace = true } -wit-bindgen-rt = { workspace = true } +wit-bindgen-rt = { workspace = true, features = ["bitflags"] } wurbo = "0.2.0" base64ct = { version = "1.6.0", features = ["alloc"] } seed-keeper-events = { path = "../seed-keeper-events" } diff --git a/crates/seed-keeper-wit-ui/src/bindings.rs b/crates/seed-keeper-wit-ui/src/bindings.rs index 53decde..e0fb5cf 100644 --- a/crates/seed-keeper-wit-ui/src/bindings.rs +++ b/crates/seed-keeper-wit-ui/src/bindings.rs @@ -1,8 +1,10 @@ -// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! // Options used: +#[allow(dead_code)] pub mod seed_keeper { + #[allow(dead_code)] pub mod wallet { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod types { #[used] #[doc(hidden)] @@ -31,7 +33,7 @@ pub mod seed_keeper { } } - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod config { #[used] #[doc(hidden)] @@ -226,8 +228,9 @@ pub mod seed_keeper { } } } + #[allow(dead_code)] pub mod wit_ui { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_types { #[used] #[doc(hidden)] @@ -319,7 +322,7 @@ pub mod seed_keeper { } } - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_in { #[used] #[doc(hidden)] @@ -382,10 +385,13 @@ pub mod seed_keeper { } } } +#[allow(dead_code)] pub mod exports { + #[allow(dead_code)] pub mod seed_keeper { + #[allow(dead_code)] pub mod wit_ui { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_out { #[used] #[doc(hidden)] @@ -412,6 +418,8 @@ pub mod exports { arg11: *mut u8, arg12: usize, ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); use super::super::super::super::seed_keeper::wit_ui::wurbo_types::Context as V7; let v7 = match arg0 { 0 => { @@ -555,6 +563,8 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); T::activate(match arg0 { 0 => None, 1 => { @@ -636,6 +646,11 @@ mod _rt { core::hint::unreachable_unchecked() } } + + #[cfg(target_arch = "wasm32")] + pub fn run_ctors_once() { + wit_bindgen_rt::run_ctors_once(); + } pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) { if size == 0 { return; @@ -676,7 +691,7 @@ macro_rules! __export_seedworld_impl { pub(crate) use __export_seedworld_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.21.0:seedworld:encoded world"] +#[link_section = "component-type:wit-bindgen:0.25.0:seedworld:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 982] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xd6\x06\x01A\x02\x01\ @@ -700,7 +715,7 @@ messages\x01\0\x04\0\x04emit\x01\x03\x03\x01!seed-keeper:wit-ui/wurbo-in@0.1.0\x \x01@\x01\x09selectors\x05\x01\0\x04\0\x08activate\x01\x06\x04\x01\"seed-keeper:\ wit-ui/wurbo-out@0.1.0\x05\x07\x04\x01\"seed-keeper:wit-ui/seedworld@0.1.0\x04\0\ \x0b\x0f\x01\0\x09seedworld\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dw\ -it-component\x070.201.0\x10wit-bindgen-rust\x060.21.0"; +it-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)] diff --git a/examples/crates/aggregate-wit-ui/Cargo.toml b/examples/crates/aggregate-wit-ui/Cargo.toml index 8b0a9be..51d74a9 100644 --- a/examples/crates/aggregate-wit-ui/Cargo.toml +++ b/examples/crates/aggregate-wit-ui/Cargo.toml @@ -6,8 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bitflags = { workspace = true } -wit-bindgen-rt = { workspace = true } +wit-bindgen-rt = { workspace = true, features = ["bitflags"] } wurbo = { workspace = true } minijinja = { version = "1.0.12", features = ["json", "loader"] } diff --git a/examples/crates/aggregate-wit-ui/src/bindings.rs b/examples/crates/aggregate-wit-ui/src/bindings.rs index 243e5d7..a355c88 100644 --- a/examples/crates/aggregate-wit-ui/src/bindings.rs +++ b/examples/crates/aggregate-wit-ui/src/bindings.rs @@ -1,8 +1,10 @@ -// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! // Options used: +#[allow(dead_code)] pub mod example { + #[allow(dead_code)] pub mod edwards_ui { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_types { #[used] #[doc(hidden)] @@ -102,7 +104,7 @@ pub mod example { } } - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_out { #[used] #[doc(hidden)] @@ -399,9 +401,11 @@ pub mod example { } } } +#[allow(dead_code)] pub mod seed_keeper { + #[allow(dead_code)] pub mod wit_ui { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_types { #[used] #[doc(hidden)] @@ -493,7 +497,7 @@ pub mod seed_keeper { } } - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_out { #[used] #[doc(hidden)] @@ -830,9 +834,11 @@ pub mod seed_keeper { } } } +#[allow(dead_code)] pub mod wallet { + #[allow(dead_code)] pub mod aggregate_wit_ui { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_types { #[used] #[doc(hidden)] @@ -905,7 +911,7 @@ pub mod wallet { } } - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_in { #[used] #[doc(hidden)] @@ -946,10 +952,13 @@ pub mod wallet { } } } +#[allow(dead_code)] pub mod exports { + #[allow(dead_code)] pub mod wallet { + #[allow(dead_code)] pub mod aggregate_wit_ui { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_out { #[used] #[doc(hidden)] @@ -962,6 +971,8 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_render_cabi(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let l0 = i32::from(*arg0.add(0).cast::()); use super::super::super::super::wallet::aggregate_wit_ui::wurbo_types::Context as V120; let v120 = match l0 { @@ -1553,6 +1564,8 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); T::activate(match arg0 { 0 => None, 1 => { @@ -1614,7 +1627,7 @@ pub mod exports { static mut _RET_AREA: _RetArea = _RetArea([::core::mem::MaybeUninit::uninit(); 12]); } - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod aggregation { #[used] #[doc(hidden)] @@ -1629,6 +1642,8 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); T::activates(match arg0 { 0 => None, 1 => { @@ -1697,6 +1712,11 @@ mod _rt { core::hint::unreachable_unchecked() } } + + #[cfg(target_arch = "wasm32")] + pub fn run_ctors_once() { + wit_bindgen_rt::run_ctors_once(); + } pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) { if size == 0 { return; @@ -1737,7 +1757,7 @@ macro_rules! __export_agg_impl { pub(crate) use __export_agg_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.21.0:agg:encoded world"] +#[link_section = "component-type:wit-bindgen:0.25.0:agg:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 1647] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xf5\x0b\x01A\x02\x01\ @@ -1776,8 +1796,8 @@ ate-wit-ui/wurbo-types@0.1.0\x05\x08\x02\x03\0\x04\x0elisten-details\x01B\x04\x0 ate-wit-ui/wurbo-out@0.1.0\x05\x0c\x01B\x04\x01ps\x01k\0\x01@\x01\x09selectors\x01\ \x01\0\x04\0\x09activates\x01\x02\x04\x01)wallet:aggregate-wit-ui/aggregation@0.\ 1.0\x05\x0d\x04\x01!wallet:aggregate-wit-ui/agg@0.1.0\x04\0\x0b\x09\x01\0\x03agg\ -\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10\ -wit-bindgen-rust\x060.21.0"; +\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.208.1\x10\ +wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)] diff --git a/examples/crates/calculator/Cargo.toml b/examples/crates/calculator/Cargo.toml index 0bdfc69..8251dfd 100644 --- a/examples/crates/calculator/Cargo.toml +++ b/examples/crates/calculator/Cargo.toml @@ -6,8 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bitflags = { workspace = true } -wit-bindgen-rt = { workspace = true } +wit-bindgen-rt = { workspace = true, features = ["bitflags"] } [lib] crate-type = ["cdylib"] diff --git a/examples/crates/calculator/src/bindings.rs b/examples/crates/calculator/src/bindings.rs index c87dda5..3c262b6 100644 --- a/examples/crates/calculator/src/bindings.rs +++ b/examples/crates/calculator/src/bindings.rs @@ -1,8 +1,10 @@ -// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! // Options used: +#[allow(dead_code)] pub mod component { + #[allow(dead_code)] pub mod math { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod addition { #[used] #[doc(hidden)] @@ -31,10 +33,13 @@ pub mod component { } } } +#[allow(dead_code)] pub mod exports { + #[allow(dead_code)] pub mod example { + #[allow(dead_code)] pub mod calculator { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod calculate { #[used] #[doc(hidden)] @@ -45,6 +50,8 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_evaluate_cabi(arg0: *mut u8, arg1: usize) -> i32 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let len0 = arg1; let bytes0 = _rt::Vec::from_raw_parts(arg0.cast(), len0, len0); let result1 = T::evaluate(_rt::string_lift(bytes0)); @@ -141,6 +148,11 @@ mod _rt { self as i32 } } + + #[cfg(target_arch = "wasm32")] + pub fn run_ctors_once() { + wit_bindgen_rt::run_ctors_once(); + } pub use alloc_crate::vec::Vec; pub unsafe fn string_lift(bytes: Vec) -> String { if cfg!(debug_assertions) { @@ -182,7 +194,7 @@ macro_rules! __export_calculator_impl { pub(crate) use __export_calculator_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.21.0:calculator:encoded world"] +#[link_section = "component-type:wit-bindgen:0.25.0:calculator:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 285] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\x9c\x01\x01A\x02\x01\ @@ -190,7 +202,7 @@ A\x04\x01B\x02\x01@\x02\x01xz\x01yz\0z\x04\0\x03add\x01\0\x03\x01\x1dcomponent:m ath/addition@0.1.0\x05\0\x01B\x02\x01@\x01\x04exprs\0z\x04\0\x08evaluate\x01\0\x04\ \x01\x1cexample:calculator/calculate\x05\x01\x04\x01\x1dexample:calculator/calcu\ lator\x04\0\x0b\x10\x01\0\x0acalculator\x03\0\0\0G\x09producers\x01\x0cprocessed\ --by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x060.21.0"; +-by\x02\x0dwit-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)] diff --git a/examples/crates/edwards-ui/Cargo.toml b/examples/crates/edwards-ui/Cargo.toml index 166814e..3bcde31 100644 --- a/examples/crates/edwards-ui/Cargo.toml +++ b/examples/crates/edwards-ui/Cargo.toml @@ -6,8 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bitflags = { workspace = true } -wit-bindgen-rt = { workspace = true } +wit-bindgen-rt = { workspace = true, features = ["bitflags"] } wurbo = { workspace = true } [lib] diff --git a/examples/crates/edwards-ui/src/bindings.rs b/examples/crates/edwards-ui/src/bindings.rs index e48468f..e3266c8 100644 --- a/examples/crates/edwards-ui/src/bindings.rs +++ b/examples/crates/edwards-ui/src/bindings.rs @@ -1,8 +1,10 @@ -// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! // Options used: +#[allow(dead_code)] pub mod example { + #[allow(dead_code)] pub mod edwards_ui { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_types { #[used] #[doc(hidden)] @@ -102,7 +104,7 @@ pub mod example { } } - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_in { #[used] #[doc(hidden)] @@ -143,9 +145,11 @@ pub mod example { } } } +#[allow(dead_code)] pub mod seed_keeper { + #[allow(dead_code)] pub mod edwards_wit { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod operations { #[used] #[doc(hidden)] @@ -255,10 +259,13 @@ pub mod seed_keeper { } } } +#[allow(dead_code)] pub mod exports { + #[allow(dead_code)] pub mod example { + #[allow(dead_code)] pub mod edwards_ui { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod wurbo_out { #[used] #[doc(hidden)] @@ -275,6 +282,8 @@ pub mod exports { arg1: *mut u8, arg2: usize, ) { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); T::activate(match arg0 { 0 => None, 1 => { @@ -307,6 +316,8 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_render_cabi(arg0: *mut u8) -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let l0 = i32::from(*arg0.add(0).cast::()); use super::super::super::super::example::edwards_ui::wurbo_types::Context as V30; let v30 = match l0 { @@ -481,6 +492,8 @@ pub mod exports { arg0: *mut u8, arg1: usize, ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let base6 = arg0; let len6 = arg1; let mut result6 = _rt::Vec::with_capacity(len6); @@ -604,9 +617,14 @@ mod _rt { _ => panic!("invalid bool discriminant"), } } else { - ::core::mem::transmute::(val) + val != 0 } } + + #[cfg(target_arch = "wasm32")] + pub fn run_ctors_once() { + wit_bindgen_rt::run_ctors_once(); + } pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) { if size == 0 { return; @@ -647,7 +665,7 @@ macro_rules! __export_example_impl { pub(crate) use __export_example_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.21.0:example:encoded world"] +#[link_section = "component-type:wit-bindgen:0.25.0:example:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 857] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xdb\x05\x01A\x02\x01\ @@ -668,8 +686,8 @@ ards-ui/wurbo-in@0.1.0\x05\x03\x02\x03\0\x01\x07context\x01B\x0e\x02\x03\x02\x01 \x06\x01o\x02ss\x01p\x07\x01j\0\x01s\x01@\x01\x09templates\x08\0\x09\x04\0\x09cu\ stomize\x01\x0a\x04\x01\"example:edwards-ui/wurbo-out@0.1.0\x05\x05\x04\x01\x20e\ xample:edwards-ui/example@0.1.0\x04\0\x0b\x0d\x01\0\x07example\x03\0\0\0G\x09pro\ -ducers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x06\ -0.21.0"; +ducers\x01\x0cprocessed-by\x02\x0dwit-component\x070.208.1\x10wit-bindgen-rust\x06\ +0.25.0"; #[inline(never)] #[doc(hidden)] diff --git a/examples/crates/edwards-wit/Cargo.toml b/examples/crates/edwards-wit/Cargo.toml index 18deb32..d668a19 100644 --- a/examples/crates/edwards-wit/Cargo.toml +++ b/examples/crates/edwards-wit/Cargo.toml @@ -7,8 +7,7 @@ edition = "2021" crate-type = ["cdylib"] [dependencies] -bitflags = { workspace = true } -wit-bindgen-rt = { workspace = true } +wit-bindgen-rt = { workspace = true, features = ["bitflags"] } ed25519-dalek = "2.1" [dev-dependencies] diff --git a/examples/crates/edwards-wit/src/bindings.rs b/examples/crates/edwards-wit/src/bindings.rs index df3de1b..4acd288 100644 --- a/examples/crates/edwards-wit/src/bindings.rs +++ b/examples/crates/edwards-wit/src/bindings.rs @@ -1,8 +1,10 @@ -// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! // Options used: +#[allow(dead_code)] pub mod seed_keeper { + #[allow(dead_code)] pub mod wallet { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod types { #[used] #[doc(hidden)] @@ -31,7 +33,7 @@ pub mod seed_keeper { } } - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod config { #[used] #[doc(hidden)] @@ -227,10 +229,13 @@ pub mod seed_keeper { } } } +#[allow(dead_code)] pub mod exports { + #[allow(dead_code)] pub mod seed_keeper { + #[allow(dead_code)] pub mod edwards_wit { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod operations { #[used] #[doc(hidden)] @@ -241,6 +246,8 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_sign_cabi(arg0: *mut u8, arg1: usize) -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let len0 = arg1; let result1 = T::sign(_rt::Vec::from_raw_parts(arg0.cast(), len0, len0)); let ptr2 = _RET_AREA.0.as_mut_ptr().cast::(); @@ -293,6 +300,8 @@ pub mod exports { arg2: *mut u8, arg3: usize, ) -> *mut u8 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let len0 = arg1; let len1 = arg3; let result2 = T::verify( @@ -389,6 +398,11 @@ mod _rt { core::hint::unreachable_unchecked() } } + + #[cfg(target_arch = "wasm32")] + pub fn run_ctors_once() { + wit_bindgen_rt::run_ctors_once(); + } pub unsafe fn cabi_dealloc(ptr: *mut u8, size: usize, align: usize) { if size == 0 { return; @@ -429,7 +443,7 @@ macro_rules! __export_example_impl { pub(crate) use __export_example_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.21.0:example:encoded world"] +#[link_section = "component-type:wit-bindgen:0.25.0:example:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 546] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xa4\x03\x01A\x02\x01\ @@ -443,7 +457,7 @@ s\x01@\x01\x07message\0\0\x01\x04\0\x04sign\x01\x02\x01j\x01\x7f\x01s\x01@\x02\x message\0\x09signature\0\0\x03\x04\0\x06verify\x01\x04\x04\x01(seed-keeper:edwar\ ds-wit/operations@0.1.0\x05\x03\x04\x01%seed-keeper:edwards-wit/example@0.1.0\x04\ \0\x0b\x0d\x01\0\x07example\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dw\ -it-component\x070.201.0\x10wit-bindgen-rust\x060.21.0"; +it-component\x070.208.1\x10wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)] diff --git a/examples/crates/math/Cargo.toml b/examples/crates/math/Cargo.toml index 3dcec0b..c404d6d 100644 --- a/examples/crates/math/Cargo.toml +++ b/examples/crates/math/Cargo.toml @@ -6,8 +6,7 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -bitflags = { workspace = true } -wit-bindgen-rt = { workspace = true } +wit-bindgen-rt = { workspace = true, features = ["bitflags"] } [lib] crate-type = ["cdylib"] diff --git a/examples/crates/math/src/bindings.rs b/examples/crates/math/src/bindings.rs index c42c398..d7f0916 100644 --- a/examples/crates/math/src/bindings.rs +++ b/examples/crates/math/src/bindings.rs @@ -1,9 +1,12 @@ -// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT! +// Generated by `wit-bindgen` 0.25.0. DO NOT EDIT! // Options used: +#[allow(dead_code)] pub mod exports { + #[allow(dead_code)] pub mod component { + #[allow(dead_code)] pub mod math { - #[allow(clippy::all)] + #[allow(dead_code, clippy::all)] pub mod addition { #[used] #[doc(hidden)] @@ -14,6 +17,8 @@ pub mod exports { #[doc(hidden)] #[allow(non_snake_case)] pub unsafe fn _export_add_cabi(arg0: i32, arg1: i32) -> i32 { + #[cfg(target_arch = "wasm32")] + _rt::run_ctors_once(); let result0 = T::add(arg0, arg1); _rt::as_i32(result0) } @@ -39,6 +44,11 @@ pub mod exports { } mod _rt { + #[cfg(target_arch = "wasm32")] + pub fn run_ctors_once() { + wit_bindgen_rt::run_ctors_once(); + } + pub fn as_i32(t: T) -> i32 { t.as_i32() } @@ -139,14 +149,14 @@ macro_rules! __export_example_impl { pub(crate) use __export_example_impl as export; #[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.21.0:example:encoded world"] +#[link_section = "component-type:wit-bindgen:0.25.0:example:encoded world"] #[doc(hidden)] pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 218] = *b"\ \0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07]\x01A\x02\x01A\x02\x01\ B\x02\x01@\x02\x01xz\x01yz\0z\x04\0\x03add\x01\0\x04\x01\x1dcomponent:math/addit\ ion@0.1.0\x05\0\x04\x01\x1aexample:math/example@0.1.0\x04\0\x0b\x0d\x01\0\x07exa\ -mple\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\ -\x10wit-bindgen-rust\x060.21.0"; +mple\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.208.1\ +\x10wit-bindgen-rust\x060.25.0"; #[inline(never)] #[doc(hidden)]