Skip to content

Commit 4c5f250

Browse files
authored
Update wasm-tools crates (bytecodealliance#9952)
* Update wasm-tools crates Pull in recent updates and denying memory64 support in components during validation. * Fix renamings in wave * Fix some bindgen tests
1 parent 0174225 commit 4c5f250

File tree

15 files changed

+186
-164
lines changed

15 files changed

+186
-164
lines changed

Cargo.lock

Lines changed: 80 additions & 79 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
@@ -285,16 +285,16 @@ wit-bindgen = { version = "0.35.0", default-features = false }
285285
wit-bindgen-rust-macro = { version = "0.35.0", default-features = false }
286286

287287
# wasm-tools family:
288-
wasmparser = { version = "0.221.2", default-features = false, features = ['simd'] }
289-
wat = "1.221.2"
290-
wast = "221.0.2"
291-
wasmprinter = "0.221.2"
292-
wasm-encoder = "0.221.2"
293-
wasm-smith = "0.221.2"
294-
wasm-mutate = "0.221.2"
295-
wit-parser = "0.221.2"
296-
wit-component = "0.221.2"
297-
wasm-wave = "0.221.2"
288+
wasmparser = { version = "0.223.0", default-features = false, features = ['simd'] }
289+
wat = "1.223.0"
290+
wast = "223.0.0"
291+
wasmprinter = "0.223.0"
292+
wasm-encoder = "0.223.0"
293+
wasm-smith = "0.223.0"
294+
wasm-mutate = "0.223.0"
295+
wit-parser = "0.223.0"
296+
wit-component = "0.223.0"
297+
wasm-wave = "0.223.0"
298298

299299
# Non-Bytecode Alliance maintained dependencies:
300300
# --------------------------

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ pub mod foo {
230230
fn apple_pear_grape(&mut self) -> ();
231231
fn a0(&mut self) -> ();
232232
/// Comment out identifiers that collide when mapped to snake_case, for now; see
233-
/// https://github.com/WebAssembly/component-model/issues/118
233+
/// https://github.com/WebAssembly/component-model/issues/118
234234
/// APPLE: func()
235235
/// APPLE-pear-GRAPE: func()
236236
/// apple-PEAR-grape: func()
@@ -393,7 +393,7 @@ pub mod foo {
393393
Host::a0(*self)
394394
}
395395
/// Comment out identifiers that collide when mapped to snake_case, for now; see
396-
/// https://github.com/WebAssembly/component-model/issues/118
396+
/// https://github.com/WebAssembly/component-model/issues/118
397397
/// APPLE: func()
398398
/// APPLE-pear-GRAPE: func()
399399
/// apple-PEAR-grape: func()
@@ -756,7 +756,7 @@ pub mod exports {
756756
Ok(())
757757
}
758758
/// Comment out identifiers that collide when mapped to snake_case, for now; see
759-
/// https://github.com/WebAssembly/component-model/issues/118
759+
/// https://github.com/WebAssembly/component-model/issues/118
760760
/// APPLE: func()
761761
/// APPLE-pear-GRAPE: func()
762762
/// apple-PEAR-grape: func()

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub mod foo {
238238
async fn apple_pear_grape(&mut self) -> ();
239239
async fn a0(&mut self) -> ();
240240
/// Comment out identifiers that collide when mapped to snake_case, for now; see
241-
/// https://github.com/WebAssembly/component-model/issues/118
241+
/// https://github.com/WebAssembly/component-model/issues/118
242242
/// APPLE: func()
243243
/// APPLE-pear-GRAPE: func()
244244
/// apple-PEAR-grape: func()
@@ -429,7 +429,7 @@ pub mod foo {
429429
Host::a0(*self).await
430430
}
431431
/// Comment out identifiers that collide when mapped to snake_case, for now; see
432-
/// https://github.com/WebAssembly/component-model/issues/118
432+
/// https://github.com/WebAssembly/component-model/issues/118
433433
/// APPLE: func()
434434
/// APPLE-pear-GRAPE: func()
435435
/// apple-PEAR-grape: func()
@@ -818,7 +818,7 @@ pub mod exports {
818818
Ok(())
819819
}
820820
/// Comment out identifiers that collide when mapped to snake_case, for now; see
821-
/// https://github.com/WebAssembly/component-model/issues/118
821+
/// https://github.com/WebAssembly/component-model/issues/118
822822
/// APPLE: func()
823823
/// APPLE-pear-GRAPE: func()
824824
/// apple-PEAR-grape: func()

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ pub mod foo {
238238
async fn apple_pear_grape(&mut self) -> ();
239239
async fn a0(&mut self) -> ();
240240
/// Comment out identifiers that collide when mapped to snake_case, for now; see
241-
/// https://github.com/WebAssembly/component-model/issues/118
241+
/// https://github.com/WebAssembly/component-model/issues/118
242242
/// APPLE: func()
243243
/// APPLE-pear-GRAPE: func()
244244
/// apple-PEAR-grape: func()
@@ -589,7 +589,7 @@ pub mod foo {
589589
Host::a0(*self).await
590590
}
591591
/// Comment out identifiers that collide when mapped to snake_case, for now; see
592-
/// https://github.com/WebAssembly/component-model/issues/118
592+
/// https://github.com/WebAssembly/component-model/issues/118
593593
/// APPLE: func()
594594
/// APPLE-pear-GRAPE: func()
595595
/// apple-PEAR-grape: func()
@@ -1065,7 +1065,7 @@ pub mod exports {
10651065
Ok(())
10661066
}
10671067
/// Comment out identifiers that collide when mapped to snake_case, for now; see
1068-
/// https://github.com/WebAssembly/component-model/issues/118
1068+
/// https://github.com/WebAssembly/component-model/issues/118
10691069
/// APPLE: func()
10701070
/// APPLE-pear-GRAPE: func()
10711071
/// apple-PEAR-grape: func()

crates/environ/src/component/translate.rs

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,32 @@ impl<'a, 'data> Translator<'a, 'data> {
526526
| wasmparser::CanonicalFunction::ThreadHwConcurrency => {
527527
bail!("unsupported intrinsic")
528528
}
529+
530+
wasmparser::CanonicalFunction::TaskBackpressure
531+
| wasmparser::CanonicalFunction::TaskPoll { .. }
532+
| wasmparser::CanonicalFunction::TaskYield { .. }
533+
| wasmparser::CanonicalFunction::SubtaskDrop
534+
| wasmparser::CanonicalFunction::StreamNew { .. }
535+
| wasmparser::CanonicalFunction::StreamRead { .. }
536+
| wasmparser::CanonicalFunction::StreamWrite { .. }
537+
| wasmparser::CanonicalFunction::StreamCancelRead { .. }
538+
| wasmparser::CanonicalFunction::StreamCancelWrite { .. }
539+
| wasmparser::CanonicalFunction::StreamCloseReadable { .. }
540+
| wasmparser::CanonicalFunction::StreamCloseWritable { .. }
541+
| wasmparser::CanonicalFunction::FutureNew { .. }
542+
| wasmparser::CanonicalFunction::FutureRead { .. }
543+
| wasmparser::CanonicalFunction::FutureWrite { .. }
544+
| wasmparser::CanonicalFunction::FutureCancelRead { .. }
545+
| wasmparser::CanonicalFunction::FutureCancelWrite { .. }
546+
| wasmparser::CanonicalFunction::FutureCloseReadable { .. }
547+
| wasmparser::CanonicalFunction::FutureCloseWritable { .. }
548+
| wasmparser::CanonicalFunction::ErrorContextNew { .. }
549+
| wasmparser::CanonicalFunction::ErrorContextDebugMessage { .. }
550+
| wasmparser::CanonicalFunction::ErrorContextDrop
551+
| wasmparser::CanonicalFunction::TaskReturn { .. }
552+
| wasmparser::CanonicalFunction::TaskWait { .. } => {
553+
bail!("unsupported intrinsic")
554+
}
529555
};
530556
self.result.initializers.push(init);
531557
}
@@ -920,6 +946,9 @@ impl<'a, 'data> Translator<'a, 'data> {
920946
let idx = FuncIndex::from_u32(*idx);
921947
ret.post_return = Some(idx);
922948
}
949+
wasmparser::CanonicalOption::Async | wasmparser::CanonicalOption::Callback(_) => {
950+
todo!()
951+
}
923952
}
924953
}
925954
return ret;

crates/environ/src/component/types_builder.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,9 @@ impl ComponentTypesBuilder {
380380
ComponentDefinedType::Borrow(r) => {
381381
InterfaceType::Borrow(self.resource_id(r.resource()))
382382
}
383+
ComponentDefinedType::Future(_)
384+
| ComponentDefinedType::Stream(_)
385+
| ComponentDefinedType::ErrorContext => bail!("unsupported async type"),
383386
};
384387
let info = self.type_information(&ret);
385388
if info.depth > MAX_TYPE_DEPTH {

crates/wasmtime/src/engine/serialization.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ impl Metadata<'_> {
231231
component_model_nested_names,
232232
component_model_more_flags,
233233
component_model_multiple_returns,
234+
component_model_async,
234235
legacy_exceptions,
235236
gc_types,
236237
stack_switching,
@@ -252,6 +253,7 @@ impl Metadata<'_> {
252253
assert!(!shared_everything_threads);
253254
assert!(!legacy_exceptions);
254255
assert!(!stack_switching);
256+
assert!(!component_model_async);
255257

256258
Metadata {
257259
target: engine.compiler().triple().to_string(),

crates/wasmtime/src/runtime/wave/component.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ impl WasmType for component::Type {
2828
Self::U32 => WasmTypeKind::U32,
2929
Self::S64 => WasmTypeKind::S64,
3030
Self::U64 => WasmTypeKind::U64,
31-
Self::Float32 => WasmTypeKind::Float32,
32-
Self::Float64 => WasmTypeKind::Float64,
31+
Self::Float32 => WasmTypeKind::F32,
32+
Self::Float64 => WasmTypeKind::F64,
3333
Self::Char => WasmTypeKind::Char,
3434
Self::String => WasmTypeKind::String,
3535
Self::List(_) => WasmTypeKind::List,
@@ -122,8 +122,8 @@ impl WasmValue for component::Val {
122122
Self::U32(_) => WasmTypeKind::U32,
123123
Self::S64(_) => WasmTypeKind::S64,
124124
Self::U64(_) => WasmTypeKind::U64,
125-
Self::Float32(_) => WasmTypeKind::Float32,
126-
Self::Float64(_) => WasmTypeKind::Float64,
125+
Self::Float32(_) => WasmTypeKind::F32,
126+
Self::Float64(_) => WasmTypeKind::F64,
127127
Self::Char(_) => WasmTypeKind::Char,
128128
Self::String(_) => WasmTypeKind::String,
129129
Self::List(_) => WasmTypeKind::List,
@@ -152,11 +152,11 @@ impl WasmValue for component::Val {
152152
(Char, char, make_char, unwrap_char)
153153
);
154154

155-
fn make_float32(val: f32) -> Self {
155+
fn make_f32(val: f32) -> Self {
156156
let val = canonicalize_nan32(val);
157157
Self::Float32(val)
158158
}
159-
fn make_float64(val: f64) -> Self {
159+
fn make_f64(val: f64) -> Self {
160160
let val = canonicalize_nan64(val);
161161
Self::Float64(val)
162162
}
@@ -238,12 +238,12 @@ impl WasmValue for component::Val {
238238
Ok(val)
239239
}
240240

241-
fn unwrap_float32(&self) -> f32 {
242-
let val = *unwrap_val!(self, Self::Float32, "float32");
241+
fn unwrap_f32(&self) -> f32 {
242+
let val = *unwrap_val!(self, Self::Float32, "f32");
243243
canonicalize_nan32(val)
244244
}
245-
fn unwrap_float64(&self) -> f64 {
246-
let val = *unwrap_val!(self, Self::Float64, "float64");
245+
fn unwrap_f64(&self) -> f64 {
246+
let val = *unwrap_val!(self, Self::Float64, "f64");
247247
canonicalize_nan64(val)
248248
}
249249
fn unwrap_string(&self) -> Cow<str> {

crates/wasmtime/src/runtime/wave/core.rs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ impl WasmType for crate::ValType {
99
match self {
1010
Self::I32 => WasmTypeKind::S32,
1111
Self::I64 => WasmTypeKind::S64,
12-
Self::F32 => WasmTypeKind::Float32,
13-
Self::F64 => WasmTypeKind::Float64,
12+
Self::F32 => WasmTypeKind::F32,
13+
Self::F64 => WasmTypeKind::F64,
1414
Self::V128 => WasmTypeKind::Tuple,
1515

1616
Self::Ref(_) => WasmTypeKind::Unsupported,
@@ -33,8 +33,8 @@ impl WasmValue for crate::Val {
3333
match self {
3434
Self::I32(_) => WasmTypeKind::S32,
3535
Self::I64(_) => WasmTypeKind::S64,
36-
Self::F32(_) => WasmTypeKind::Float32,
37-
Self::F64(_) => WasmTypeKind::Float64,
36+
Self::F32(_) => WasmTypeKind::F32,
37+
Self::F64(_) => WasmTypeKind::F64,
3838
Self::V128(_) => WasmTypeKind::Tuple,
3939
Self::FuncRef(_) => WasmTypeKind::Unsupported,
4040
Self::ExternRef(_) => WasmTypeKind::Unsupported,
@@ -48,11 +48,11 @@ impl WasmValue for crate::Val {
4848
fn make_s64(val: i64) -> Self {
4949
Self::I64(val)
5050
}
51-
fn make_float32(val: f32) -> Self {
51+
fn make_f32(val: f32) -> Self {
5252
let val = canonicalize_nan32(val);
5353
Self::F32(val.to_bits())
5454
}
55-
fn make_float64(val: f64) -> Self {
55+
fn make_f64(val: f64) -> Self {
5656
let val = canonicalize_nan64(val);
5757
Self::F64(val.to_bits())
5858
}
@@ -88,13 +88,13 @@ impl WasmValue for crate::Val {
8888
*unwrap_val!(self, Self::I64, "s64")
8989
}
9090

91-
fn unwrap_float32(&self) -> f32 {
92-
let val = f32::from_bits(*unwrap_val!(self, Self::F32, "float32"));
91+
fn unwrap_f32(&self) -> f32 {
92+
let val = f32::from_bits(*unwrap_val!(self, Self::F32, "f32"));
9393
canonicalize_nan32(val)
9494
}
9595

96-
fn unwrap_float64(&self) -> f64 {
97-
let val = f64::from_bits(*unwrap_val!(self, Self::F64, "float64"));
96+
fn unwrap_f64(&self) -> f64 {
97+
let val = f64::from_bits(*unwrap_val!(self, Self::F64, "f64"));
9898
canonicalize_nan64(val)
9999
}
100100

0 commit comments

Comments
 (0)