Skip to content

Commit c8c119e

Browse files
Merge pull request #185 from sunfishcode/sunfishcode/update-wasm-tools
Update to wasm-tools 1.244.
2 parents 9beec0d + b8a41c7 commit c8c119e

File tree

6 files changed

+67
-74
lines changed

6 files changed

+67
-74
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -63,13 +63,13 @@ wac-parser = { path = "crates/wac-parser", version = "0.9.0-dev", default-featur
6363
wac-resolver = { path = "crates/wac-resolver", version = "0.9.0-dev", default-features = false }
6464
wac-graph = { path = "crates/wac-graph", version = "0.9.0-dev" }
6565
wac-types = { path = "crates/wac-types", version = "0.9.0-dev" }
66-
wit-parser = "0.239.0"
67-
wasmparser = "0.239.0"
68-
wit-component = "0.239.0"
69-
wasm-encoder = "0.239.0"
70-
wasmprinter = "0.239.0"
71-
wasm-metadata = "0.239.0"
72-
wat = "1.238.0"
66+
wit-parser = "0.244.0"
67+
wasmparser = "0.244.0"
68+
wit-component = "0.244.0"
69+
wasm-encoder = "0.244.0"
70+
wasmprinter = "0.244.0"
71+
wasm-metadata = "0.244.0"
72+
wat = "1.244.0"
7373
anyhow = "1.0.81"
7474
clap = { version = "4.5.4", features = ["derive"] }
7575
semver = { version = "1.0.22", features = ["serde"] }

crates/wac-graph/src/encoding.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ impl Encodable {
5050

5151
fn ty(&mut self) -> ComponentTypeEncoder {
5252
match self {
53-
Encodable::Builder(t) => t.ty().1,
53+
Encodable::Builder(t) => t.ty(None).1,
5454
Encodable::Instance(t) => t.ty(),
5555
Encodable::Component(t) => t.ty(),
5656
}
5757
}
5858

5959
fn core_type(&mut self) -> ComponentCoreTypeEncoder {
6060
match self {
61-
Encodable::Builder(t) => t.core_type().1,
61+
Encodable::Builder(t) => t.core_type(None).1,
6262
Encodable::Instance(t) => t.core_type(),
6363
Encodable::Component(t) => t.core_type(),
6464
}
@@ -79,7 +79,7 @@ impl Encodable {
7979
fn alias(&mut self, alias: Alias) {
8080
match self {
8181
Encodable::Builder(t) => {
82-
t.alias(alias);
82+
t.alias(None, alias);
8383
}
8484
Encodable::Instance(t) => {
8585
t.alias(alias);
@@ -399,7 +399,7 @@ impl<'a> TypeEncoder<'a> {
399399

400400
match state.pop() {
401401
Encodable::Component(ty) => {
402-
let (index, encoder) = state.builder().ty();
402+
let (index, encoder) = state.builder().ty(None);
403403
encoder.component(&ty);
404404
log::debug!("encoded interface definition of `{iid}` to type index {index}",);
405405
index
@@ -420,7 +420,7 @@ impl<'a> TypeEncoder<'a> {
420420

421421
match state.pop() {
422422
Encodable::Component(ty) => {
423-
let (index, encoder) = state.builder().ty();
423+
let (index, encoder) = state.builder().ty(None);
424424
encoder.component(&ty);
425425
log::debug!("encoded world definition of `{world_id}` to type index {index}");
426426
index

crates/wac-graph/src/graph.rs

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,7 +1754,7 @@ impl<'a> CompositionGraphEncoder<'a> {
17541754
*index
17551755
} else {
17561756
let index = if options.define_components {
1757-
state.builder().component_raw(package.bytes())
1757+
state.builder().component_raw(None, package.bytes())
17581758
} else {
17591759
let encoder = TypeEncoder::new(&self.0.types);
17601760
let ty = encoder.component(state, package.ty());
@@ -1798,7 +1798,9 @@ impl<'a> CompositionGraphEncoder<'a> {
17981798
package = package.name(),
17991799
);
18001800

1801-
let index = state.builder().instantiate(component_index, arguments);
1801+
let index = state
1802+
.builder()
1803+
.instantiate(None, component_index, arguments);
18021804

18031805
log::debug!(
18041806
"instantiation of package `{package}` encoded to instance index {index}",
@@ -1828,11 +1830,14 @@ impl<'a> CompositionGraphEncoder<'a> {
18281830
kind = kind.desc(&self.0.types),
18291831
);
18301832

1831-
let index = state.builder().alias(Alias::InstanceExport {
1832-
instance,
1833-
kind: kind.into(),
1834-
name: export,
1835-
});
1833+
let index = state.builder().alias(
1834+
None,
1835+
Alias::InstanceExport {
1836+
instance,
1837+
kind: kind.into(),
1838+
name: export,
1839+
},
1840+
);
18361841

18371842
log::debug!(
18381843
"alias of export `{export}` encoded to {kind} index {index}",

crates/wac-types/src/core.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,9 @@ impl From<wasmparser::HeapType> for HeapType {
341341
wasmparser::HeapType::Concrete(index) => {
342342
Self::Concrete(index.as_module_index().unwrap())
343343
}
344+
wasmparser::HeapType::Exact(_) => {
345+
todo!("wasmparser::HeapType::Exact");
346+
}
344347
}
345348
}
346349
}

crates/wac-types/src/package.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -758,6 +758,9 @@ impl<'a> TypeConverter<'a> {
758758
let ty = self.component_val_type(*ty)?;
759759
ValueType::Defined(self.types.add_defined_type(DefinedType::List(ty)))
760760
}
761+
wasmparser::component_types::ComponentDefinedType::Map(_, _) => {
762+
todo!("wasmparser::component_types::ComponentDefinedType::Map");
763+
}
761764
};
762765

763766
self.cache.insert(key, Entity::Type(Type::Value(ty)));
@@ -807,6 +810,9 @@ impl<'a> TypeConverter<'a> {
807810
wasmparser::types::EntityType::Memory(ty) => ty.into(),
808811
wasmparser::types::EntityType::Global(ty) => ty.into(),
809812
wasmparser::types::EntityType::Tag(ty) => CoreExtern::Tag(self.func_type(ty)),
813+
wasmparser::types::EntityType::FuncExact(_) => {
814+
todo!("wasmparser::types::EntityType::FuncExact")
815+
}
810816
}
811817
}
812818

0 commit comments

Comments
 (0)