Skip to content

Commit 54826c0

Browse files
authored
Update wasm-tools/wit-bindgen dependencies (#12121)
This pulls in wasm-tools support for custom-descriptors which required adding more match arms in a few locations. Wasmtime doesn't support this, however, so it should all be rejected during validation.
1 parent 245580e commit 54826c0

File tree

13 files changed

+384
-363
lines changed

13 files changed

+384
-363
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -333,22 +333,22 @@ io-lifetimes = { version = "2.0.3", default-features = false }
333333
io-extras = "0.18.4"
334334
rustix = "1.0.8"
335335
# wit-bindgen:
336-
wit-bindgen = { version = "0.48.0", default-features = false }
337-
wit-bindgen-rust-macro = { version = "0.48.0", default-features = false }
336+
wit-bindgen = { version = "0.49.0", default-features = false }
337+
wit-bindgen-rust-macro = { version = "0.49.0", default-features = false }
338338

339339
# wasm-tools family:
340-
wasmparser = { version = "0.242.0", default-features = false, features = ['simd'] }
341-
wat = "1.242.0"
342-
wast = "242.0.0"
343-
wasmprinter = "0.242.0"
344-
wasm-encoder = "0.242.0"
345-
wasm-smith = "0.242.0"
346-
wasm-mutate = "0.242.0"
347-
wit-parser = "0.242.0"
348-
wit-component = "0.242.0"
349-
wasm-wave = "0.242.0"
350-
wasm-compose = "0.242.0"
351-
json-from-wast = "0.242.0"
340+
wasmparser = { version = "0.243.0", default-features = false, features = ['simd'] }
341+
wat = "1.243.0"
342+
wast = "243.0.0"
343+
wasmprinter = "0.243.0"
344+
wasm-encoder = "0.243.0"
345+
wasm-smith = "0.243.0"
346+
wasm-mutate = "0.243.0"
347+
wit-parser = "0.243.0"
348+
wit-component = "0.243.0"
349+
wasm-wave = "0.243.0"
350+
wasm-compose = "0.243.0"
351+
json-from-wast = "0.243.0"
352352

353353
# Non-Bytecode Alliance maintained dependencies:
354354
# --------------------------

crates/environ/src/compile/module_environ.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,6 +369,9 @@ impl<'a, 'data> ModuleEnvironment<'a, 'data> {
369369
self.result.module.num_imported_tags += 1;
370370
EntityType::Tag(tag)
371371
}
372+
TypeRef::FuncExact(_) => {
373+
bail!("custom-descriptors proposal not implemented yet");
374+
}
372375
};
373376
self.declare_import(import.module, import.name, ty);
374377
}
@@ -471,7 +474,7 @@ impl<'a, 'data> ModuleEnvironment<'a, 'data> {
471474
for entry in exports {
472475
let wasmparser::Export { name, kind, index } = entry?;
473476
let entity = match kind {
474-
ExternalKind::Func => {
477+
ExternalKind::Func | ExternalKind::FuncExact => {
475478
let index = FuncIndex::from_u32(index);
476479
self.flag_func_escaped(index);
477480
EntityIndex::Function(index)

crates/environ/src/component/translate.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1394,7 +1394,7 @@ impl<'a, 'data> Translator<'a, 'data> {
13941394
let mut map = HashMap::with_capacity(exports.len());
13951395
for export in exports {
13961396
let idx = match export.kind {
1397-
wasmparser::ExternalKind::Func => {
1397+
wasmparser::ExternalKind::Func | wasmparser::ExternalKind::FuncExact => {
13981398
let index = FuncIndex::from_u32(export.index);
13991399
EntityIndex::Function(index)
14001400
}
@@ -1491,7 +1491,9 @@ impl<'a, 'data> Translator<'a, 'data> {
14911491
name: &'data str,
14921492
) -> LocalInitializer<'data> {
14931493
match kind {
1494-
wasmparser::ExternalKind::Func => LocalInitializer::AliasExportFunc(instance, name),
1494+
wasmparser::ExternalKind::Func | wasmparser::ExternalKind::FuncExact => {
1495+
LocalInitializer::AliasExportFunc(instance, name)
1496+
}
14951497
wasmparser::ExternalKind::Memory => LocalInitializer::AliasExportMemory(instance, name),
14961498
wasmparser::ExternalKind::Table => LocalInitializer::AliasExportTable(instance, name),
14971499
wasmparser::ExternalKind::Global => LocalInitializer::AliasExportGlobal(instance, name),

crates/environ/src/component/types_builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -412,6 +412,7 @@ impl ComponentTypesBuilder {
412412
Memory(ty) => EntityType::Memory((*ty).into()),
413413
Global(ty) => EntityType::Global(self.convert_global_type(ty)?),
414414
Tag(_) => bail!("exceptions proposal not implemented"),
415+
FuncExact(_) => bail!("custom-descriptors proposal not implemented"),
415416
})
416417
}
417418

crates/wasi-preview1-component-adapter/verify/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ fn main() -> Result<()> {
3737
TypeRef::Global(_) => bail!("should not import globals"),
3838
TypeRef::Memory(_) => {}
3939
TypeRef::Tag(_) => bail!("unsupported `tag` type"),
40+
TypeRef::FuncExact(_) => bail!("unsupported exact `func` type"),
4041
}
4142
}
4243
}

crates/wizer/src/component/info.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ impl<'a> ComponentContext<'a> {
112112

113113
pub(crate) fn inc_core(&mut self, kind: wasmparser::ExternalKind) {
114114
match kind {
115-
wasmparser::ExternalKind::Func => {
115+
wasmparser::ExternalKind::Func | wasmparser::ExternalKind::FuncExact => {
116116
self.inc_core_funcs();
117117
}
118118
wasmparser::ExternalKind::Memory => {

crates/wizer/src/info.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ impl<'a> ModuleContext<'a> {
128128
wasmparser::TypeRef::Tag(_) => {
129129
unreachable!("exceptions are unsupported; checked in validation")
130130
}
131+
wasmparser::TypeRef::FuncExact(_) => {
132+
unreachable!("custom-descriptors are unsupported; checked in validation")
133+
}
131134
}
132135
}
133136

crates/wizer/src/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ impl Wizer {
206206
anyhow::bail!("imported memories are not supported")
207207
}
208208
wasmparser::TypeRef::Func(_) => {}
209+
wasmparser::TypeRef::FuncExact(_) => {}
209210
wasmparser::TypeRef::Tag(_) => {}
210211
}
211212
}

crates/wizer/src/parse.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ fn export_section<'a>(
120120
match export.kind {
121121
wasmparser::ExternalKind::Tag
122122
| wasmparser::ExternalKind::Func
123+
| wasmparser::ExternalKind::FuncExact
123124
| wasmparser::ExternalKind::Table
124125
| wasmparser::ExternalKind::Memory
125126
| wasmparser::ExternalKind::Global => {

0 commit comments

Comments
 (0)