Skip to content

Commit

Permalink
Merge pull request #134 from NukeManDan/update-wit-bindgen
Browse files Browse the repository at this point in the history
Update to wit-bindgen-rt 0.23.0
  • Loading branch information
kate-goldenring authored May 3, 2024
2 parents 23d3a28 + ae223be commit 74beecf
Show file tree
Hide file tree
Showing 9 changed files with 59 additions and 26 deletions.
7 changes: 5 additions & 2 deletions component-model/examples/tutorial/adder/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion component-model/examples/tutorial/adder/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
bitflags = "2.4.2"
wit-bindgen-rt = "0.20.0"
wit-bindgen-rt = { version = "0.24.0", features = ["bitflags"] }

[lib]
crate-type = ["cdylib"]
Expand Down
20 changes: 15 additions & 5 deletions component-model/examples/tutorial/adder/src/bindings.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT!
// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT!
// Options used:
#[allow(dead_code)]
pub mod exports {
#[allow(dead_code)]
pub mod docs {
#[allow(dead_code)]
pub mod calculator {
#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod add {
#[used]
#[doc(hidden)]
Expand All @@ -14,6 +17,8 @@ pub mod exports {
#[doc(hidden)]
#[allow(non_snake_case)]
pub unsafe fn _export_add_cabi<T: Guest>(arg0: i32, arg1: i32) -> i32 {
#[cfg(target_arch = "wasm32")]
_rt::run_ctors_once();
let result0 = T::add(arg0 as u32, arg1 as u32);
_rt::as_i32(result0)
}
Expand All @@ -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: AsI32>(t: T) -> i32 {
t.as_i32()
}
Expand Down Expand Up @@ -139,14 +149,14 @@ macro_rules! __export_adder_impl {
pub(crate) use __export_adder_impl as export;

#[cfg(target_arch = "wasm32")]
#[link_section = "component-type:wit-bindgen:0.21.0:adder:encoded world"]
#[link_section = "component-type:wit-bindgen:0.24.0:adder:encoded world"]
#[doc(hidden)]
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 213] = *b"\
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07Z\x01A\x02\x01A\x02\x01\
B\x02\x01@\x02\x01ay\x01by\0y\x04\0\x03add\x01\0\x04\x01\x19docs:calculator/add@\
0.1.0\x05\0\x04\x01\x1bdocs:calculator/[email protected]\x04\0\x0b\x0b\x01\0\x05adder\x03\
\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10wit-\
bindgen-rust\x060.21.0";
\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-component\x070.202.0\x10wit-\
bindgen-rust\x060.24.0";

#[inline(never)]
#[doc(hidden)]
Expand Down
11 changes: 7 additions & 4 deletions component-model/examples/tutorial/calculator/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion component-model/examples/tutorial/calculator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ edition = "2021"

[dependencies]
bitflags = "2.4.2"
wit-bindgen-rt = "0.20.0"
wit-bindgen-rt = { version = "0.24.0", features = ["bitflags"] }

[lib]
crate-type = ["cdylib"]
Expand Down
22 changes: 17 additions & 5 deletions component-model/examples/tutorial/calculator/src/bindings.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT!
// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT!
// Options used:
#[allow(dead_code)]
pub mod docs {
#[allow(dead_code)]
pub mod calculator {
#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod add {
#[used]
#[doc(hidden)]
Expand Down Expand Up @@ -31,10 +33,13 @@ pub mod docs {
}
}
}
#[allow(dead_code)]
pub mod exports {
#[allow(dead_code)]
pub mod docs {
#[allow(dead_code)]
pub mod calculator {
#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod calculate {
#[used]
#[doc(hidden)]
Expand Down Expand Up @@ -76,6 +81,8 @@ pub mod exports {
arg1: i32,
arg2: i32,
) -> i32 {
#[cfg(target_arch = "wasm32")]
_rt::run_ctors_once();
let result0 =
T::eval_expression(Op::_lift(arg0 as u8), arg1 as u32, arg2 as u32);
_rt::as_i32(result0)
Expand Down Expand Up @@ -171,6 +178,11 @@ mod _rt {
self as i32
}
}

#[cfg(target_arch = "wasm32")]
pub fn run_ctors_once() {
wit_bindgen_rt::run_ctors_once();
}
}

/// Generates `#[no_mangle]` functions to export the specified type as the
Expand Down Expand Up @@ -202,7 +214,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.24.0:calculator:encoded world"]
#[doc(hidden)]
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 313] = *b"\
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07\xb8\x01\x01A\x02\x01\
Expand All @@ -211,7 +223,7 @@ ator/[email protected]\x05\0\x01B\x04\x01m\x01\x03add\x04\0\x02op\x03\0\0\x01@\x03\x02op
\x01\x01xy\x01yy\0y\x04\0\x0feval-expression\x01\x02\x04\x01\x1fdocs:calculator/\
[email protected]\x05\x01\x04\x01\x20docs:calculator/[email protected]\x04\0\x0b\x10\
\x01\0\x0acalculator\x03\0\0\0G\x09producers\x01\x0cprocessed-by\x02\x0dwit-comp\
onent\x070.201.0\x10wit-bindgen-rust\x060.21.0";
onent\x070.202.0\x10wit-bindgen-rust\x060.24.0";

#[inline(never)]
#[doc(hidden)]
Expand Down
7 changes: 5 additions & 2 deletions component-model/examples/tutorial/command/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion component-model/examples/tutorial/command/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ world = "app"
anyhow = "1"
clap = { version = "4.3.19", features = ["derive"] }
bitflags = "2.4.2"
wit-bindgen-rt = "0.20.0"
wit-bindgen-rt = { version = "0.24.0", features = ["bitflags"] }
12 changes: 7 additions & 5 deletions component-model/examples/tutorial/command/src/bindings.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Generated by `wit-bindgen` 0.21.0. DO NOT EDIT!
// Generated by `wit-bindgen` 0.24.0. DO NOT EDIT!
// Options used:
#[allow(dead_code)]
pub mod docs {
#[allow(dead_code)]
pub mod calculator {
#[allow(clippy::all)]
#[allow(dead_code, clippy::all)]
pub mod calculate {
#[used]
#[doc(hidden)]
Expand Down Expand Up @@ -132,15 +134,15 @@ mod _rt {
}

#[cfg(target_arch = "wasm32")]
#[link_section = "component-type:wit-bindgen:0.21.0:app:encoded world"]
#[link_section = "component-type:wit-bindgen:0.24.0:app:encoded world"]
#[doc(hidden)]
pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 246] = *b"\
\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07}\x01A\x02\x01A\x02\x01\
B\x04\x01m\x01\x03add\x04\0\x02op\x03\0\0\x01@\x03\x02op\x01\x01xy\x01yy\0y\x04\0\
\x0feval-expression\x01\x02\x03\x01\x1fdocs:calculator/[email protected]\x05\0\x04\
\x01\x19docs:calculator/[email protected]\x04\0\x0b\x09\x01\0\x03app\x03\0\0\0G\x09produ\
cers\x01\x0cprocessed-by\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x06\
0.21.0";
cers\x01\x0cprocessed-by\x02\x0dwit-component\x070.202.0\x10wit-bindgen-rust\x06\
0.24.0";

#[inline(never)]
#[doc(hidden)]
Expand Down

0 comments on commit 74beecf

Please sign in to comment.