Skip to content

Commit 7f6e3f8

Browse files
committed
Update deps
Highlights are that all wasm-tools packages and wasmtime are at their latest versions.
1 parent 5aa9438 commit 7f6e3f8

File tree

13 files changed

+411
-409
lines changed

13 files changed

+411
-409
lines changed

Cargo.lock

Lines changed: 298 additions & 296 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,52 +9,51 @@ name = "componentize_py"
99
crate-type = ["cdylib", "rlib"]
1010

1111
[dependencies]
12-
anyhow = { version = "1.0.86", features = ["backtrace"] }
13-
clap = { version = "4.5.17", features = ["derive"] }
14-
tar = "0.4.41"
15-
tempfile = "3.12.0"
12+
anyhow = { version = "1.0.89", features = ["backtrace"] }
13+
clap = { version = "4.5.20", features = ["derive"] }
14+
tar = "0.4.42"
15+
tempfile = "3.13.0"
1616
zstd = "0.13.2"
1717
componentize-py-shared = { path = "shared" }
18-
wasm-encoder = "0.216.0"
19-
wit-parser = "0.216.0"
20-
wit-component = "0.216.0"
21-
wasmparser = "0.216.0"
22-
indexmap = "2.5.0"
18+
wasm-encoder = "0.219.0"
19+
wit-parser = "0.219.0"
20+
wit-component = "0.219.0"
21+
wasmparser = "0.219.0"
22+
indexmap = "2.6.0"
2323
bincode = "1.3.3"
2424
heck = "0.5.0"
2525
pyo3 = { version = "0.20.0", features = [
2626
"abi3-py37",
2727
"extension-module",
2828
], optional = true }
29-
wasmtime = "24.0.0"
30-
wasmtime-wasi = "24.0.0"
31-
wasi-common = "24.0.0"
32-
once_cell = "1.19.0"
33-
component-init = { git = "https://github.com/dicej/component-init", rev = "bc276826" }
34-
wasm-convert = { git = "https://github.com/dicej/wasm-convert", rev = "afbec48b" }
35-
async-trait = "0.1.82"
36-
futures = "0.3.30"
29+
wasmtime = "25.0.1"
30+
wasmtime-wasi = "25.0.1"
31+
wasi-common = "25.0.1"
32+
once_cell = "1.20.2"
33+
component-init = { git = "https://github.com/benbrandt/component-init", rev = "01e18e7" }
34+
wasm-convert = { git = "https://github.com/benbrandt/wasm-convert", rev = "afa8d0d" }
35+
async-trait = "0.1.83"
36+
futures = "0.3.31"
3737
tokio = { version = "1.40.0", features = [
3838
"macros",
3939
"rt",
4040
"rt-multi-thread",
4141
"fs",
4242
] }
43-
bytes = "1.7.1"
43+
bytes = "1.7.2"
4444
pretty_env_logger = "0.5.0"
45-
cap-std = "3.2.0"
45+
cap-std = "3.3.0"
4646
im-rc = "15.1.0"
47-
serde = { version = "1.0.209", features = ["derive"] }
47+
serde = { version = "1.0.210", features = ["derive"] }
4848
toml = "0.8.19"
4949
semver = "1.0.23"
5050

5151
[dev-dependencies]
52-
async-trait = "0.1.82"
5352
proptest = "1.5.0"
5453
hex = "0.4.3"
5554

5655
[build-dependencies]
57-
anyhow = "1.0.86"
56+
anyhow = "1.0.89"
5857
tar = "0.4.41"
5958
zstd = "0.13.2"
6059
test-generator = { path = "test-generator" }

runtime/Cargo.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,9 @@ edition = "2021"
77
crate-type = ["staticlib"]
88

99
[dependencies]
10-
anyhow = "1.0.86"
11-
once_cell = "1.19.0"
10+
anyhow = "1.0.89"
11+
once_cell = "1.20.2"
1212
pyo3 = { version = "0.20.0", features = ["abi3-py311", "num-bigint"] }
1313
componentize-py-shared = { path = "../shared" }
1414
num-bigint = "0.4.6"
15-
wit-bindgen = "0.16.0"
15+
wit-bindgen = "0.18.0"

src/bindings.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,9 @@ pub fn make_bindings(
4444

4545
for (name, params, results) in IMPORT_SIGNATURES {
4646
let offset = types.len();
47-
types.function(params.iter().copied(), results.iter().copied());
47+
types
48+
.ty()
49+
.function(params.iter().copied(), results.iter().copied());
4850
imports.import("env", name, EntityType::Function(offset));
4951
function_names.push((offset, (*name).to_owned()));
5052
}
@@ -95,7 +97,7 @@ pub fn make_bindings(
9597
let (params, results) = function.core_import_type(resolve);
9698
let offset = types.len();
9799

98-
types.function(params, results);
100+
types.ty().function(params, results);
99101
imports.import(module, name, EntityType::Function(offset));
100102
function_names.push((
101103
offset,
@@ -176,7 +178,7 @@ pub fn make_bindings(
176178
for (index, function) in summary.functions.iter().enumerate() {
177179
let offset = types.len();
178180
let (params, results) = function.core_export_type(resolve);
179-
types.function(params, results);
181+
types.ty().function(params, results);
180182
functions.function(offset);
181183
function_names.push((offset, function.internal_name(resolve)));
182184
let mut gen = FunctionBindgen::new(summary, function, stack_pointer);
@@ -259,9 +261,13 @@ pub fn make_bindings(
259261

260262
{
261263
let dispatch_offset = types.len();
262-
types.function([ValType::I32; DISPATCH_CORE_PARAM_COUNT], []);
264+
types
265+
.ty()
266+
.function([ValType::I32; DISPATCH_CORE_PARAM_COUNT], []);
263267
let dispatchable_offset = types.len();
264-
types.function([ValType::I32; DISPATCHABLE_CORE_PARAM_COUNT], []);
268+
types
269+
.ty()
270+
.function([ValType::I32; DISPATCHABLE_CORE_PARAM_COUNT], []);
265271
functions.function(dispatch_offset);
266272
let name = "componentize-py#CallIndirect";
267273
function_names.push((dispatch_offset, name.to_owned()));
@@ -300,7 +306,7 @@ pub fn make_bindings(
300306
Some(0),
301307
&ConstExpr::global_get(table_base),
302308
Elements::Functions(
303-
&summary
309+
summary
304310
.functions
305311
.iter()
306312
.enumerate()
@@ -309,7 +315,8 @@ pub fn make_bindings(
309315
.is_dispatchable()
310316
.then_some(import_function_count + u32::try_from(index).unwrap())
311317
})
312-
.collect::<Vec<_>>(),
318+
.collect::<Vec<_>>()
319+
.into(),
313320
),
314321
);
315322

src/lib.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ impl Invoker for MyInvoker {
139139
Ok(result)
140140
}
141141

142-
async fn call_float32(&mut self, function: &str) -> Result<f32> {
142+
async fn call_f32(&mut self, function: &str) -> Result<f32> {
143143
let func = self
144144
.instance
145145
.get_typed_func::<(), (f32,)>(&mut self.store, function)?;
@@ -148,7 +148,7 @@ impl Invoker for MyInvoker {
148148
Ok(result)
149149
}
150150

151-
async fn call_float64(&mut self, function: &str) -> Result<f64> {
151+
async fn call_f64(&mut self, function: &str) -> Result<f64> {
152152
let func = self
153153
.instance
154154
.get_typed_func::<(), (f64,)>(&mut self.store, function)?;
@@ -532,7 +532,7 @@ pub async fn componentize(
532532

533533
let pre = InitPre::new(linker.instantiate_pre(component)?)?;
534534
let instance = pre.instance_pre.instantiate_async(&mut store).await?;
535-
let guest = pre.interface0.load(&mut store, &instance)?;
535+
let guest = pre.indices.interface0.load(&mut store, &instance)?;
536536

537537
guest
538538
.call_init(&mut store, &app_name, &symbols, stub_wasi)
@@ -721,7 +721,7 @@ fn make_stub_adapter(_module: &str, stubs: &HashMap<&str, FuncType>) -> Vec<u8>
721721

722722
for (index, (name, ty)) in stubs.iter().enumerate() {
723723
let index = u32::try_from(index).unwrap();
724-
types.function(
724+
types.ty().function(
725725
ty.params().iter().map(|&v| IntoValType(v).into()),
726726
ty.results().iter().map(|&v| IntoValType(v).into()),
727727
);

src/test.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,18 +82,18 @@ async fn make_component(
8282
}
8383

8484
#[derive(Debug, Copy, Clone)]
85-
struct MyFloat32(f32);
85+
struct MyF32(f32);
8686

87-
impl PartialEq<MyFloat32> for MyFloat32 {
87+
impl PartialEq<MyF32> for MyF32 {
8888
fn eq(&self, other: &Self) -> bool {
8989
(self.0.is_nan() && other.0.is_nan()) || (self.0 == other.0)
9090
}
9191
}
9292

9393
#[derive(Debug, Copy, Clone)]
94-
struct MyFloat64(f64);
94+
struct MyF64(f64);
9595

96-
impl PartialEq<MyFloat64> for MyFloat64 {
96+
impl PartialEq<MyF64> for MyF64 {
9797
fn eq(&self, other: &Self) -> bool {
9898
(self.0.is_nan() && other.0.is_nan()) || (self.0 == other.0)
9999
}

src/test/echoes.rs

Lines changed: 32 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
super::{Ctx, MyFloat32, MyFloat64, Tester, SEED},
2+
super::{Ctx, MyF32, MyF64, Tester, SEED},
33
anyhow::Result,
44
async_trait::async_trait,
55
once_cell::sync::Lazy,
@@ -63,11 +63,11 @@ impl componentize_py::test::echoes::Host for Ctx {
6363
Ok(v)
6464
}
6565

66-
async fn echo_float32(&mut self, v: f32) -> Result<f32> {
66+
async fn echo_f32(&mut self, v: f32) -> Result<f32> {
6767
Ok(v)
6868
}
6969

70-
async fn echo_float64(&mut self, v: f64) -> Result<f64> {
70+
async fn echo_f64(&mut self, v: f64) -> Result<f64> {
7171
Ok(v)
7272
}
7373

@@ -115,11 +115,11 @@ impl componentize_py::test::echoes::Host for Ctx {
115115
Ok(v)
116116
}
117117

118-
async fn echo_list_float32(&mut self, v: Vec<f32>) -> Result<Vec<f32>> {
118+
async fn echo_list_f32(&mut self, v: Vec<f32>) -> Result<Vec<f32>> {
119119
Ok(v)
120120
}
121121

122-
async fn echo_list_float64(&mut self, v: Vec<f64>) -> Result<Vec<f64>> {
122+
async fn echo_list_f64(&mut self, v: Vec<f64>) -> Result<Vec<f64>> {
123123
Ok(v)
124124
}
125125

@@ -242,11 +242,11 @@ class Echoes(exports.Echoes):
242242
def echo_s64(self, v):
243243
return echoes.echo_s64(v)
244244
245-
def echo_float32(self, v):
246-
return echoes.echo_float32(v)
245+
def echo_f32(self, v):
246+
return echoes.echo_f32(v)
247247
248-
def echo_float64(self, v):
249-
return echoes.echo_float64(v)
248+
def echo_f64(self, v):
249+
return echoes.echo_f64(v)
250250
251251
def echo_string(self, v):
252252
return echoes.echo_string(v)
@@ -281,11 +281,11 @@ class Echoes(exports.Echoes):
281281
def echo_list_s64(self, v):
282282
return echoes.echo_list_s64(v)
283283
284-
def echo_list_float32(self, v):
285-
return echoes.echo_list_float32(v)
284+
def echo_list_f32(self, v):
285+
return echoes.echo_list_f32(v)
286286
287-
def echo_list_float64(self, v):
288-
return echoes.echo_list_float64(v)
287+
def echo_list_f64(self, v):
288+
return echoes.echo_list_f64(v)
289289
290290
def echo_list_string(self, v):
291291
return echoes.echo_list_string(v)
@@ -433,31 +433,31 @@ fn chars() -> Result<()> {
433433
}
434434

435435
#[test]
436-
fn float32s() -> Result<()> {
436+
fn f32s() -> Result<()> {
437437
TESTER.all_eq(
438-
&proptest::num::f32::ANY.prop_map(MyFloat32),
438+
&proptest::num::f32::ANY.prop_map(MyF32),
439439
|v, instance, store, runtime| {
440-
Ok(MyFloat32(
440+
Ok(MyF32(
441441
runtime.block_on(
442442
instance
443443
.componentize_py_test_echoes()
444-
.call_echo_float32(store, v.0),
444+
.call_echo_f32(store, v.0),
445445
)?,
446446
))
447447
},
448448
)
449449
}
450450

451451
#[test]
452-
fn float64s() -> Result<()> {
452+
fn f64s() -> Result<()> {
453453
TESTER.all_eq(
454-
&proptest::num::f64::ANY.prop_map(MyFloat64),
454+
&proptest::num::f64::ANY.prop_map(MyF64),
455455
|v, instance, store, runtime| {
456-
Ok(MyFloat64(
456+
Ok(MyF64(
457457
runtime.block_on(
458458
instance
459459
.componentize_py_test_echoes()
460-
.call_echo_float64(store, v.0),
460+
.call_echo_f64(store, v.0),
461461
)?,
462462
))
463463
},
@@ -686,42 +686,36 @@ fn list_chars() -> Result<()> {
686686
}
687687

688688
#[test]
689-
fn list_float32s() -> Result<()> {
689+
fn list_f32s() -> Result<()> {
690690
TESTER.all_eq(
691-
&proptest::collection::vec(proptest::num::f32::ANY.prop_map(MyFloat32), 0..MAX_SIZE),
691+
&proptest::collection::vec(proptest::num::f32::ANY.prop_map(MyF32), 0..MAX_SIZE),
692692
|v, instance, store, runtime| {
693693
Ok(runtime
694694
.block_on(
695695
instance
696696
.componentize_py_test_echoes()
697-
.call_echo_list_float32(
698-
store,
699-
&v.into_iter().map(|v| v.0).collect::<Vec<_>>(),
700-
),
697+
.call_echo_list_f32(store, &v.into_iter().map(|v| v.0).collect::<Vec<_>>()),
701698
)?
702699
.into_iter()
703-
.map(MyFloat32)
700+
.map(MyF32)
704701
.collect())
705702
},
706703
)
707704
}
708705

709706
#[test]
710-
fn list_float64s() -> Result<()> {
707+
fn list_f64s() -> Result<()> {
711708
TESTER.all_eq(
712-
&proptest::collection::vec(proptest::num::f64::ANY.prop_map(MyFloat64), 0..MAX_SIZE),
709+
&proptest::collection::vec(proptest::num::f64::ANY.prop_map(MyF64), 0..MAX_SIZE),
713710
|v, instance, store, runtime| {
714711
Ok(runtime
715712
.block_on(
716713
instance
717714
.componentize_py_test_echoes()
718-
.call_echo_list_float64(
719-
store,
720-
&v.into_iter().map(|v| v.0).collect::<Vec<_>>(),
721-
),
715+
.call_echo_list_f64(store, &v.into_iter().map(|v| v.0).collect::<Vec<_>>()),
722716
)?
723717
.into_iter()
724-
.map(MyFloat64)
718+
.map(MyF64)
725719
.collect())
726720
},
727721
)
@@ -743,8 +737,8 @@ fn many() -> Result<()> {
743737
),
744738
(
745739
proptest::num::i64::ANY,
746-
proptest::num::f32::ANY.prop_map(MyFloat32),
747-
proptest::num::f64::ANY.prop_map(MyFloat64),
740+
proptest::num::f32::ANY.prop_map(MyF32),
741+
proptest::num::f64::ANY.prop_map(MyF64),
748742
proptest::char::any(),
749743
proptest::string::string_regex(".*")?,
750744
proptest::collection::vec(proptest::bool::ANY, 0..MAX_SIZE),
@@ -764,7 +758,7 @@ fn many() -> Result<()> {
764758

765759
Ok((
766760
(v1, v2, v3, v4, v5, v6, v7, v8),
767-
(v9, MyFloat32(v10), MyFloat64(v11), v12, v13, v14, v15, v16),
761+
(v9, MyF32(v10), MyF64(v11), v12, v13, v14, v15, v16),
768762
))
769763
},
770764
)

0 commit comments

Comments
 (0)