Skip to content

Commit 287e8fb

Browse files
authored
Update wasm-tools crates to 226 (#10235)
* Update wasm-tools crates to 226 This commit updates the wasm-tools crates to the 226 track of versions. The most notable change here is the removal and refactoring within wasm-tools of support for multiple and named returns in the component model along with the support for 33+ flags in the `flags` type. This has been gated for some time now and it's just now being removed now that it's been awhile an no issues have been raised. prtest:full * Fix some issues from CI * Fix benchmarks * Switch to crates.io-based crates
1 parent 362b0db commit 287e8fb

File tree

30 files changed

+250
-854
lines changed

30 files changed

+250
-854
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -303,16 +303,16 @@ wit-bindgen = { version = "0.39.0", default-features = false }
303303
wit-bindgen-rust-macro = { version = "0.39.0", default-features = false }
304304

305305
# wasm-tools family:
306-
wasmparser = { version = "0.225.0", default-features = false, features = ['simd'] }
307-
wat = "1.225.0"
308-
wast = "225.0.0"
309-
wasmprinter = "0.225.0"
310-
wasm-encoder = "0.225.0"
311-
wasm-smith = "0.225.0"
312-
wasm-mutate = "0.225.0"
313-
wit-parser = "0.225.0"
314-
wit-component = "0.225.0"
315-
wasm-wave = "0.225.0"
306+
wasmparser = { version = "0.226.0", default-features = false, features = ['simd'] }
307+
wat = "1.226.0"
308+
wast = "226.0.0"
309+
wasmprinter = "0.226.0"
310+
wasm-encoder = "0.226.0"
311+
wasm-smith = "0.226.0"
312+
wasm-mutate = "0.226.0"
313+
wit-parser = "0.226.0"
314+
wit-component = "0.226.0"
315+
wasm-wave = "0.226.0"
316316

317317
# Non-Bytecode Alliance maintained dependencies:
318318
# --------------------------

benches/call.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ mod component {
567567
(func (export "nop")
568568
(canon lift (core func $i "nop"))
569569
)
570-
(func (export "nop-params-and-results") (param "x" u32) (param "y" u64) (result "z" float32)
570+
(func (export "nop-params-and-results") (param "x" u32) (param "y" u64) (result float32)
571571
(canon lift (core func $i "nop-params-and-results"))
572572
)
573573
)

crates/cli-flags/src/lib.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -362,10 +362,6 @@ wasmtime_option_group! {
362362
pub memory64: Option<bool>,
363363
/// Configure support for the component-model proposal.
364364
pub component_model: Option<bool>,
365-
/// Configure support for 33+ flags in the component model.
366-
pub component_model_more_flags: Option<bool>,
367-
/// Component model support for more than one return value.
368-
pub component_model_multiple_returns: Option<bool>,
369365
/// Component model support for async lifting/lowering.
370366
pub component_model_async: Option<bool>,
371367
/// Configure support for the function-references proposal.
@@ -991,8 +987,6 @@ impl CommonOptions {
991987

992988
handle_conditionally_compiled! {
993989
("component-model", component_model, wasm_component_model)
994-
("component-model", component_model_more_flags, wasm_component_model_more_flags)
995-
("component-model", component_model_multiple_returns, wasm_component_model_multiple_returns)
996990
("component-model-async", component_model_async, wasm_component_model_async)
997991
("threads", threads, wasm_threads)
998992
("gc", gc, wasm_gc)

crates/component-macro/tests/codegen/multi-return.wit

Lines changed: 0 additions & 14 deletions
This file was deleted.

crates/component-macro/tests/codegen/variants.wit

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,9 +125,6 @@ interface variants {
125125

126126
is-clone-arg: func(a: is-clone);
127127
is-clone-return: func() -> is-clone;
128-
129-
return-named-option: func() -> (a: option<u8>);
130-
return-named-result: func() -> (a: result<u8, my-errno>);
131128
}
132129

133130
world my-world {

crates/component-macro/tests/expanded/variants.rs

Lines changed: 0 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -527,8 +527,6 @@ pub mod foo {
527527
fn result_simple(&mut self) -> Result<u32, i32>;
528528
fn is_clone_arg(&mut self, a: IsClone) -> ();
529529
fn is_clone_return(&mut self) -> IsClone;
530-
fn return_named_option(&mut self) -> Option<u8>;
531-
fn return_named_result(&mut self) -> Result<u8, MyErrno>;
532530
}
533531
pub trait GetHost<
534532
T,
@@ -780,22 +778,6 @@ pub mod foo {
780778
Ok((r,))
781779
},
782780
)?;
783-
inst.func_wrap(
784-
"return-named-option",
785-
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
786-
let host = &mut host_getter(caller.data_mut());
787-
let r = Host::return_named_option(host);
788-
Ok((r,))
789-
},
790-
)?;
791-
inst.func_wrap(
792-
"return-named-result",
793-
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
794-
let host = &mut host_getter(caller.data_mut());
795-
let r = Host::return_named_result(host);
796-
Ok((r,))
797-
},
798-
)?;
799781
Ok(())
800782
}
801783
pub fn add_to_linker<T, U>(
@@ -916,12 +898,6 @@ pub mod foo {
916898
fn is_clone_return(&mut self) -> IsClone {
917899
Host::is_clone_return(*self)
918900
}
919-
fn return_named_option(&mut self) -> Option<u8> {
920-
Host::return_named_option(*self)
921-
}
922-
fn return_named_result(&mut self) -> Result<u8, MyErrno> {
923-
Host::return_named_result(*self)
924-
}
925901
}
926902
}
927903
}
@@ -1298,8 +1274,6 @@ pub mod exports {
12981274
result_simple: wasmtime::component::Func,
12991275
is_clone_arg: wasmtime::component::Func,
13001276
is_clone_return: wasmtime::component::Func,
1301-
return_named_option: wasmtime::component::Func,
1302-
return_named_result: wasmtime::component::Func,
13031277
}
13041278
#[derive(Clone)]
13051279
pub struct GuestIndices {
@@ -1323,8 +1297,6 @@ pub mod exports {
13231297
result_simple: wasmtime::component::ComponentExportIndex,
13241298
is_clone_arg: wasmtime::component::ComponentExportIndex,
13251299
is_clone_return: wasmtime::component::ComponentExportIndex,
1326-
return_named_option: wasmtime::component::ComponentExportIndex,
1327-
return_named_result: wasmtime::component::ComponentExportIndex,
13281300
}
13291301
impl GuestIndices {
13301302
/// Constructor for [`GuestIndices`] which takes a
@@ -1399,8 +1371,6 @@ pub mod exports {
13991371
let result_simple = lookup("result-simple")?;
14001372
let is_clone_arg = lookup("is-clone-arg")?;
14011373
let is_clone_return = lookup("is-clone-return")?;
1402-
let return_named_option = lookup("return-named-option")?;
1403-
let return_named_result = lookup("return-named-result")?;
14041374
Ok(GuestIndices {
14051375
e1_arg,
14061376
e1_result,
@@ -1422,8 +1392,6 @@ pub mod exports {
14221392
result_simple,
14231393
is_clone_arg,
14241394
is_clone_return,
1425-
return_named_option,
1426-
return_named_result,
14271395
})
14281396
}
14291397
pub fn load(
@@ -1574,18 +1542,6 @@ pub mod exports {
15741542
(IsClone,),
15751543
>(&mut store, &self.is_clone_return)?
15761544
.func();
1577-
let return_named_option = *_instance
1578-
.get_typed_func::<
1579-
(),
1580-
(Option<u8>,),
1581-
>(&mut store, &self.return_named_option)?
1582-
.func();
1583-
let return_named_result = *_instance
1584-
.get_typed_func::<
1585-
(),
1586-
(Result<u8, MyErrno>,),
1587-
>(&mut store, &self.return_named_result)?
1588-
.func();
15891545
Ok(Guest {
15901546
e1_arg,
15911547
e1_result,
@@ -1607,8 +1563,6 @@ pub mod exports {
16071563
result_simple,
16081564
is_clone_arg,
16091565
is_clone_return,
1610-
return_named_option,
1611-
return_named_result,
16121566
})
16131567
}
16141568
}
@@ -2045,40 +1999,6 @@ pub mod exports {
20451999
callee.post_return(store.as_context_mut())?;
20462000
Ok(ret0)
20472001
}
2048-
pub fn call_return_named_option<S: wasmtime::AsContextMut>(
2049-
&self,
2050-
mut store: S,
2051-
) -> wasmtime::Result<Option<u8>>
2052-
where
2053-
<S as wasmtime::AsContext>::Data: Send,
2054-
{
2055-
let callee = unsafe {
2056-
wasmtime::component::TypedFunc::<
2057-
(),
2058-
(Option<u8>,),
2059-
>::new_unchecked(self.return_named_option)
2060-
};
2061-
let (ret0,) = callee.call(store.as_context_mut(), ())?;
2062-
callee.post_return(store.as_context_mut())?;
2063-
Ok(ret0)
2064-
}
2065-
pub fn call_return_named_result<S: wasmtime::AsContextMut>(
2066-
&self,
2067-
mut store: S,
2068-
) -> wasmtime::Result<Result<u8, MyErrno>>
2069-
where
2070-
<S as wasmtime::AsContext>::Data: Send,
2071-
{
2072-
let callee = unsafe {
2073-
wasmtime::component::TypedFunc::<
2074-
(),
2075-
(Result<u8, MyErrno>,),
2076-
>::new_unchecked(self.return_named_result)
2077-
};
2078-
let (ret0,) = callee.call(store.as_context_mut(), ())?;
2079-
callee.post_return(store.as_context_mut())?;
2080-
Ok(ret0)
2081-
}
20822002
}
20832003
}
20842004
}

crates/component-macro/tests/expanded/variants_async.rs

Lines changed: 0 additions & 88 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,6 @@ pub mod foo {
535535
async fn result_simple(&mut self) -> Result<u32, i32>;
536536
async fn is_clone_arg(&mut self, a: IsClone) -> ();
537537
async fn is_clone_return(&mut self) -> IsClone;
538-
async fn return_named_option(&mut self) -> Option<u8>;
539-
async fn return_named_result(&mut self) -> Result<u8, MyErrno>;
540538
}
541539
pub trait GetHost<
542540
T,
@@ -834,26 +832,6 @@ pub mod foo {
834832
})
835833
},
836834
)?;
837-
inst.func_wrap_async(
838-
"return-named-option",
839-
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
840-
wasmtime::component::__internal::Box::new(async move {
841-
let host = &mut host_getter(caller.data_mut());
842-
let r = Host::return_named_option(host).await;
843-
Ok((r,))
844-
})
845-
},
846-
)?;
847-
inst.func_wrap_async(
848-
"return-named-result",
849-
move |mut caller: wasmtime::StoreContextMut<'_, T>, (): ()| {
850-
wasmtime::component::__internal::Box::new(async move {
851-
let host = &mut host_getter(caller.data_mut());
852-
let r = Host::return_named_result(host).await;
853-
Ok((r,))
854-
})
855-
},
856-
)?;
857835
Ok(())
858836
}
859837
pub fn add_to_linker<T, U>(
@@ -975,12 +953,6 @@ pub mod foo {
975953
async fn is_clone_return(&mut self) -> IsClone {
976954
Host::is_clone_return(*self).await
977955
}
978-
async fn return_named_option(&mut self) -> Option<u8> {
979-
Host::return_named_option(*self).await
980-
}
981-
async fn return_named_result(&mut self) -> Result<u8, MyErrno> {
982-
Host::return_named_result(*self).await
983-
}
984956
}
985957
}
986958
}
@@ -1357,8 +1329,6 @@ pub mod exports {
13571329
result_simple: wasmtime::component::Func,
13581330
is_clone_arg: wasmtime::component::Func,
13591331
is_clone_return: wasmtime::component::Func,
1360-
return_named_option: wasmtime::component::Func,
1361-
return_named_result: wasmtime::component::Func,
13621332
}
13631333
#[derive(Clone)]
13641334
pub struct GuestIndices {
@@ -1382,8 +1352,6 @@ pub mod exports {
13821352
result_simple: wasmtime::component::ComponentExportIndex,
13831353
is_clone_arg: wasmtime::component::ComponentExportIndex,
13841354
is_clone_return: wasmtime::component::ComponentExportIndex,
1385-
return_named_option: wasmtime::component::ComponentExportIndex,
1386-
return_named_result: wasmtime::component::ComponentExportIndex,
13871355
}
13881356
impl GuestIndices {
13891357
/// Constructor for [`GuestIndices`] which takes a
@@ -1458,8 +1426,6 @@ pub mod exports {
14581426
let result_simple = lookup("result-simple")?;
14591427
let is_clone_arg = lookup("is-clone-arg")?;
14601428
let is_clone_return = lookup("is-clone-return")?;
1461-
let return_named_option = lookup("return-named-option")?;
1462-
let return_named_result = lookup("return-named-result")?;
14631429
Ok(GuestIndices {
14641430
e1_arg,
14651431
e1_result,
@@ -1481,8 +1447,6 @@ pub mod exports {
14811447
result_simple,
14821448
is_clone_arg,
14831449
is_clone_return,
1484-
return_named_option,
1485-
return_named_result,
14861450
})
14871451
}
14881452
pub fn load(
@@ -1633,18 +1597,6 @@ pub mod exports {
16331597
(IsClone,),
16341598
>(&mut store, &self.is_clone_return)?
16351599
.func();
1636-
let return_named_option = *_instance
1637-
.get_typed_func::<
1638-
(),
1639-
(Option<u8>,),
1640-
>(&mut store, &self.return_named_option)?
1641-
.func();
1642-
let return_named_result = *_instance
1643-
.get_typed_func::<
1644-
(),
1645-
(Result<u8, MyErrno>,),
1646-
>(&mut store, &self.return_named_result)?
1647-
.func();
16481600
Ok(Guest {
16491601
e1_arg,
16501602
e1_result,
@@ -1666,8 +1618,6 @@ pub mod exports {
16661618
result_simple,
16671619
is_clone_arg,
16681620
is_clone_return,
1669-
return_named_option,
1670-
return_named_result,
16711621
})
16721622
}
16731623
}
@@ -2141,44 +2091,6 @@ pub mod exports {
21412091
callee.post_return_async(store.as_context_mut()).await?;
21422092
Ok(ret0)
21432093
}
2144-
pub async fn call_return_named_option<S: wasmtime::AsContextMut>(
2145-
&self,
2146-
mut store: S,
2147-
) -> wasmtime::Result<Option<u8>>
2148-
where
2149-
<S as wasmtime::AsContext>::Data: Send,
2150-
{
2151-
let callee = unsafe {
2152-
wasmtime::component::TypedFunc::<
2153-
(),
2154-
(Option<u8>,),
2155-
>::new_unchecked(self.return_named_option)
2156-
};
2157-
let (ret0,) = callee
2158-
.call_async(store.as_context_mut(), ())
2159-
.await?;
2160-
callee.post_return_async(store.as_context_mut()).await?;
2161-
Ok(ret0)
2162-
}
2163-
pub async fn call_return_named_result<S: wasmtime::AsContextMut>(
2164-
&self,
2165-
mut store: S,
2166-
) -> wasmtime::Result<Result<u8, MyErrno>>
2167-
where
2168-
<S as wasmtime::AsContext>::Data: Send,
2169-
{
2170-
let callee = unsafe {
2171-
wasmtime::component::TypedFunc::<
2172-
(),
2173-
(Result<u8, MyErrno>,),
2174-
>::new_unchecked(self.return_named_result)
2175-
};
2176-
let (ret0,) = callee
2177-
.call_async(store.as_context_mut(), ())
2178-
.await?;
2179-
callee.post_return_async(store.as_context_mut()).await?;
2180-
Ok(ret0)
2181-
}
21822094
}
21832095
}
21842096
}

0 commit comments

Comments
 (0)