Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 34 additions & 55 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,13 @@ wac-parser = { path = "crates/wac-parser", version = "0.9.0-dev", default-featur
wac-resolver = { path = "crates/wac-resolver", version = "0.9.0-dev", default-features = false }
wac-graph = { path = "crates/wac-graph", version = "0.9.0-dev" }
wac-types = { path = "crates/wac-types", version = "0.9.0-dev" }
wit-parser = "0.239.0"
wasmparser = "0.239.0"
wit-component = "0.239.0"
wasm-encoder = "0.239.0"
wasmprinter = "0.239.0"
wasm-metadata = "0.239.0"
wat = "1.238.0"
wit-parser = "0.244.0"
wasmparser = "0.244.0"
wit-component = "0.244.0"
wasm-encoder = "0.244.0"
wasmprinter = "0.244.0"
wasm-metadata = "0.244.0"
wat = "1.244.0"
anyhow = "1.0.81"
clap = { version = "4.5.4", features = ["derive"] }
semver = { version = "1.0.22", features = ["serde"] }
Expand Down
10 changes: 5 additions & 5 deletions crates/wac-graph/src/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,15 @@ impl Encodable {

fn ty(&mut self) -> ComponentTypeEncoder {
match self {
Encodable::Builder(t) => t.ty().1,
Encodable::Builder(t) => t.ty(None).1,
Encodable::Instance(t) => t.ty(),
Encodable::Component(t) => t.ty(),
}
}

fn core_type(&mut self) -> ComponentCoreTypeEncoder {
match self {
Encodable::Builder(t) => t.core_type().1,
Encodable::Builder(t) => t.core_type(None).1,
Encodable::Instance(t) => t.core_type(),
Encodable::Component(t) => t.core_type(),
}
Expand All @@ -79,7 +79,7 @@ impl Encodable {
fn alias(&mut self, alias: Alias) {
match self {
Encodable::Builder(t) => {
t.alias(alias);
t.alias(None, alias);
}
Encodable::Instance(t) => {
t.alias(alias);
Expand Down Expand Up @@ -399,7 +399,7 @@ impl<'a> TypeEncoder<'a> {

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

match state.pop() {
Encodable::Component(ty) => {
let (index, encoder) = state.builder().ty();
let (index, encoder) = state.builder().ty(None);
encoder.component(&ty);
log::debug!("encoded world definition of `{world_id}` to type index {index}");
index
Expand Down
19 changes: 12 additions & 7 deletions crates/wac-graph/src/graph.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,7 @@ impl<'a> CompositionGraphEncoder<'a> {
*index
} else {
let index = if options.define_components {
state.builder().component_raw(package.bytes())
state.builder().component_raw(None, package.bytes())
} else {
let encoder = TypeEncoder::new(&self.0.types);
let ty = encoder.component(state, package.ty());
Expand Down Expand Up @@ -1798,7 +1798,9 @@ impl<'a> CompositionGraphEncoder<'a> {
package = package.name(),
);

let index = state.builder().instantiate(component_index, arguments);
let index = state
.builder()
.instantiate(None, component_index, arguments);

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

let index = state.builder().alias(Alias::InstanceExport {
instance,
kind: kind.into(),
name: export,
});
let index = state.builder().alias(
None,
Alias::InstanceExport {
instance,
kind: kind.into(),
name: export,
},
);

log::debug!(
"alias of export `{export}` encoded to {kind} index {index}",
Expand Down
3 changes: 3 additions & 0 deletions crates/wac-types/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,9 @@ impl From<wasmparser::HeapType> for HeapType {
wasmparser::HeapType::Concrete(index) => {
Self::Concrete(index.as_module_index().unwrap())
}
wasmparser::HeapType::Exact(_) => {
todo!("wasmparser::HeapType::Exact");
}
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions crates/wac-types/src/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -758,6 +758,9 @@ impl<'a> TypeConverter<'a> {
let ty = self.component_val_type(*ty)?;
ValueType::Defined(self.types.add_defined_type(DefinedType::List(ty)))
}
wasmparser::component_types::ComponentDefinedType::Map(_, _) => {
todo!("wasmparser::component_types::ComponentDefinedType::Map");
}
};

self.cache.insert(key, Entity::Type(Type::Value(ty)));
Expand Down Expand Up @@ -807,6 +810,9 @@ impl<'a> TypeConverter<'a> {
wasmparser::types::EntityType::Memory(ty) => ty.into(),
wasmparser::types::EntityType::Global(ty) => ty.into(),
wasmparser::types::EntityType::Tag(ty) => CoreExtern::Tag(self.func_type(ty)),
wasmparser::types::EntityType::FuncExact(_) => {
todo!("wasmparser::types::EntityType::FuncExact")
}
}
}

Expand Down