diff --git a/Cargo.lock b/Cargo.lock index 2318d0ad..6ad025fe 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6015,27 +6015,6 @@ dependencies = [ "wick-test-logger", ] -[[package]] -name = "wick-component-wasm" -version = "0.3.0" -dependencies = [ - "async-trait", - "derive_builder", - "flow-component", - "parking_lot", - "serde_json", - "structured-output", - "thiserror", - "tokio", - "tracing", - "wasmtime", - "wasmtime-wasi", - "wick-config", - "wick-interface-types", - "wick-packet", - "wick-wasm-engine", -] - [[package]] name = "wick-component-wasmrs" version = "0.3.0" @@ -6394,7 +6373,6 @@ dependencies = [ "wasmrs-codec", "wasmtime", "wasmtime-wasi", - "wick-component-wasm", "wick-component-wasmrs", "wick-config", "wick-http-client", diff --git a/Cargo.toml b/Cargo.toml index d7cb2fca..afa8f348 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -100,7 +100,6 @@ wick-asset-reference = { path = "./crates/wick/wick-asset-reference", version = wick-component = { path = "./crates/wick/wick-component", version = "0.16.0", default-features = false } wick-component-cli = { path = "./crates/wick/wick-component-cli", version = "0.2.0", default-features = false } wick-component-codegen = { path = "./crates/wick/wick-component-codegen", version = "0.5.0" } -wick-component-wasm = { path = "./crates/wick/wick-component-wasm", version = "0.3.0" } wick-component-wasmrs = { path = "./crates/wick/wick-component-wasmrs", version = "0.3.0" } wick-config = { path = "./crates/wick/wick-config", version = "0.27.0", default-features = false } wick-host = { path = "./crates/wick/wick-host", version = "0.5.0" } diff --git a/crates/wick/wick-component-wasm/Cargo.toml b/crates/wick/wick-component-wasm/Cargo.toml deleted file mode 100644 index 8df2ddb0..00000000 --- a/crates/wick/wick-component-wasm/Cargo.toml +++ /dev/null @@ -1,34 +0,0 @@ -[package] -name = "wick-component-wasm" -version = "0.3.0" -edition = "2021" -license = "Elastic-2.0" -repository = "https://github.com/candlecorp/wick" -description = "Implementation and loader for Wick WASM components." -readme = "README.md" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html -[features] - -[dependencies] -# Wick -wick-config = { workspace = true, features = ["config"] } -wick-packet = { workspace = true } -flow-component = { workspace = true, features = ["invocation"] } -wick-interface-types = { workspace = true } -wick-wasm-engine = { workspace = true } - -# Wasmtime -wasmtime = { workspace = true, features = ["component-model", "async"] } -wasmtime-wasi = { workspace = true, features = ["tokio"] } - -tokio = { workspace = true, features = ["sync"] } - -# Misc -thiserror = { workspace = true } -tracing = { workspace = true } -async-trait = { workspace = true } -serde_json = { workspace = true } -structured-output = { workspace = true } -parking_lot = { workspace = true } -derive_builder = { workspace = true } diff --git a/crates/wick/wick-component-wasm/src/component.rs b/crates/wick/wick-component-wasm/src/component.rs deleted file mode 100644 index c4e01e19..00000000 --- a/crates/wick/wick-component-wasm/src/component.rs +++ /dev/null @@ -1,99 +0,0 @@ -mod bindgen; -mod setup; -mod state; - -use std::fmt; - -use flow_component::Component as FlowComponent; -use state::ComponentState; -use tracing::Span; -use wasmtime::component::{Instance, Linker}; -use wasmtime::Store; -use wasmtime_wasi::preview2::Table; -use wick_config::FetchableAssetReference; -use wick_interface_types::ComponentSignature; - -use self::setup::ComponentSetup; -pub use self::setup::{ComponentSetupBuilder, ComponentSetupBuilderError}; -use crate::wasi::{compute_preopen_dirs, init_ctx}; -use crate::Error; - -#[derive()] -#[allow(missing_debug_implementations)] -#[non_exhaustive] -pub struct WasmComponent { - #[allow(unused)] - bindings: bindgen::generated::Component, - #[allow(unused)] - instance: Instance, -} - -impl FlowComponent for WasmComponent { - fn handle( - &self, - _invocation: wick_packet::Invocation, - _data: Option, - _callback: flow_component::LocalScope, - ) -> flow_component::BoxFuture> { - todo!() - } - - fn signature(&self) -> &ComponentSignature { - todo!() - } -} - -impl WasmComponent { - pub async fn try_load( - ns: &str, - asset: FetchableAssetReference<'_>, - options: ComponentSetup, - span: Span, - ) -> Result { - let location = asset.location(); - span.in_scope(|| trace!("loading wasm component from {} for ns {}", location, ns)); - - let mut table = Table::new(); - let perms = options.permissions.unwrap_or_default(); - - let preopen_dirs = compute_preopen_dirs(perms.dirs().iter())?; - let wasi = init_ctx(&mut table, preopen_dirs, &[], &[])?; - - let path = asset.path().map_err(|e| Error::Asset(Box::new(e)))?; - - let component = wick_wasm_engine::store::fetch_component(&path) - .await - .map_err(Error::ComponentFetch)?; - let engine = wick_wasm_engine::wasm_engine(); - - let mut linker = Linker::::new(engine); - - wasmtime_wasi::preview2::command::add_to_linker(&mut linker).map_err(Error::Linker)?; - - let mut store = Store::new(engine, ComponentState::new(wasi, table, options.callback)); - - bindgen::generated::add_to_linker(&mut linker, |state: &mut ComponentState| state).map_err(Error::Linker)?; - let fut = bindgen::generated::Component::instantiate_async(&mut store, &component, &linker); - // bindgen::generated::add_to_linker(&mut linker, |state: &mut ComponentState| state).map_err(Error::Linker)?; - // let fut = bindgen::generated::Component::instantiate_async(&mut store, lock.component(), &linker); - - let (bindings, instance) = fut.await.map_err(Error::Instantiation)?; - - // let cmd = preview2::command::Command::new(&mut store, &instance).map_err(Error::WasiCommand)?; - - // let exit = cmd - // .wasi_cli_run() - // .call_run(&mut store) - // .await - // .map_err(Error::CommandRun)? - // .map_or(false, |_| true); - - Ok(Self { bindings, instance }) - } -} - -impl fmt::Display for WasmComponent { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - write!(f, "Cli Trigger",) - } -} diff --git a/crates/wick/wick-component-wasm/src/component/bindgen.rs b/crates/wick/wick-component-wasm/src/component/bindgen.rs deleted file mode 100644 index 598fa95b..00000000 --- a/crates/wick/wick-component-wasm/src/component/bindgen.rs +++ /dev/null @@ -1,36 +0,0 @@ -pub(super) mod generated { - #![allow(clippy::future_not_send, clippy::impl_trait_in_params)] - use wasmtime::component::bindgen; - bindgen!({ - world: "component", - path: "../../../wit/", - async:true, - }); - pub(crate) use candle::wick::wick::*; -} - -#[async_trait::async_trait] -#[allow(unused)] -impl generated::Host for super::state::ComponentState { - async fn request_sync( - &mut self, - invocation: generated::Invocation, - ) -> wasmtime::Result> { - todo!() - } - - async fn request_async(&mut self, invocation: generated::Invocation) -> wasmtime::Result { - todo!() - } - - async fn get_response( - &mut self, - id: u64, - ) -> wasmtime::Result> { - todo!() - } - - async fn cancel_request(&mut self, id: u64) -> wasmtime::Result<()> { - todo!() - } -} diff --git a/crates/wick/wick-component-wasm/src/component/setup.rs b/crates/wick/wick-component-wasm/src/component/setup.rs deleted file mode 100644 index c41762a2..00000000 --- a/crates/wick/wick-component-wasm/src/component/setup.rs +++ /dev/null @@ -1,36 +0,0 @@ -use std::collections::HashMap; - -use flow_component::LocalScope; -use wick_config::config::Permissions; -use wick_packet::RuntimeConfig; - -#[derive(Clone, Default, derive_builder::Builder)] -#[builder(default)] -#[non_exhaustive] -pub struct ComponentSetup { - #[builder(setter(strip_option), default)] - pub engine: Option, - #[builder(setter(), default)] - pub config: Option, - #[builder(setter(), default)] - pub buffer_size: Option, - #[builder(setter(), default)] - pub callback: LocalScope, - #[builder(default, setter(into))] - pub provided: HashMap, - #[builder(default, setter(into))] - pub imported: HashMap, - #[builder(setter(), default)] - pub permissions: Option, -} - -impl std::fmt::Debug for ComponentSetup { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("ComponentSetup") - .field("config", &self.config) - .field("buffer_size", &self.buffer_size) - .field("provided", &self.provided) - .field("imported", &self.provided) - .finish() - } -} diff --git a/crates/wick/wick-component-wasm/src/component/state.rs b/crates/wick/wick-component-wasm/src/component/state.rs deleted file mode 100644 index 17edf9de..00000000 --- a/crates/wick/wick-component-wasm/src/component/state.rs +++ /dev/null @@ -1,40 +0,0 @@ -use flow_component::LocalScope; -use wasmtime_wasi::preview2::{Table, WasiCtx, WasiView}; - -pub(super) struct ComponentState { - pub(super) wasi: WasiCtx, - pub(super) table: Table, - #[allow(unused)] - callback: LocalScope, -} - -impl std::fmt::Debug for ComponentState { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - f.debug_struct("ComponentState").field("table", &self.table).finish() - } -} - -impl WasiView for ComponentState { - fn table(&self) -> &Table { - &self.table - } - - fn table_mut(&mut self) -> &mut Table { - &mut self.table - } - - fn ctx(&self) -> &WasiCtx { - &self.wasi - } - - fn ctx_mut(&mut self) -> &mut WasiCtx { - &mut self.wasi - } -} - -impl ComponentState { - #[must_use] - pub(super) const fn new(wasi: WasiCtx, table: Table, callback: LocalScope) -> Self { - Self { wasi, table, callback } - } -} diff --git a/crates/wick/wick-component-wasm/src/error.rs b/crates/wick/wick-component-wasm/src/error.rs deleted file mode 100644 index 1d02e5ef..00000000 --- a/crates/wick/wick-component-wasm/src/error.rs +++ /dev/null @@ -1,40 +0,0 @@ -#[derive(thiserror::Error, Debug)] -#[allow(clippy::exhaustive_enums)] -/// Crate error. -pub enum Error { - /// Failed to initialize WASI context - #[error("failed to initialize WASI context, {0}")] - WasiCtx(wasmtime::Error), - - /// Failed to open directory for component - #[error("failed to open directory for component, {0}")] - OpenDir(std::io::Error), - - /// Failed to fetch wasm bytes - #[error("failed to fetch wasm bytes, {0}")] - ComponentFetch(wasmtime::Error), - - /// Failure dealing with asset reference - #[error("failed to get asset path, {0}")] - Asset(Box), - - /// Failed to link component - #[error("failed to link component, {0}")] - Linker(wasmtime::Error), - - /// Failed to build WASI context - #[error("failed to build WASI context, {0}")] - WasiBuild(wasmtime::Error), - - /// Could not instantiate component. - #[error("could not instantiate component, {0}")] - Instantiation(wasmtime::Error), - - /// Could not link with WASI Command bindings. - #[error("could not link with WASI Command bindings, {0}")] - WasiCommand(wasmtime::Error), - - /// Error running component. - #[error("component returned with error, {0}")] - CommandRun(wasmtime::Error), -} diff --git a/crates/wick/wick-component-wasm/src/lib.rs b/crates/wick/wick-component-wasm/src/lib.rs deleted file mode 100644 index 2e4aa14c..00000000 --- a/crates/wick/wick-component-wasm/src/lib.rs +++ /dev/null @@ -1,122 +0,0 @@ -// !!START_LINTS -// Wick lints -// Do not change anything between the START_LINTS and END_LINTS line. -// This is automatically generated. Add exceptions after this section. -#![allow(unknown_lints)] -#![deny( - clippy::await_holding_lock, - clippy::borrow_as_ptr, - clippy::branches_sharing_code, - clippy::cast_lossless, - clippy::clippy::collection_is_never_read, - clippy::cloned_instead_of_copied, - clippy::cognitive_complexity, - clippy::create_dir, - clippy::deref_by_slicing, - clippy::derivable_impls, - clippy::derive_partial_eq_without_eq, - clippy::equatable_if_let, - clippy::exhaustive_structs, - clippy::expect_used, - clippy::expl_impl_clone_on_copy, - clippy::explicit_deref_methods, - clippy::explicit_into_iter_loop, - clippy::explicit_iter_loop, - clippy::filetype_is_file, - clippy::flat_map_option, - clippy::format_push_string, - clippy::fn_params_excessive_bools, - clippy::future_not_send, - clippy::get_unwrap, - clippy::implicit_clone, - clippy::if_then_some_else_none, - clippy::impl_trait_in_params, - clippy::implicit_clone, - clippy::inefficient_to_string, - clippy::inherent_to_string, - clippy::iter_not_returning_iterator, - clippy::large_types_passed_by_value, - clippy::large_include_file, - clippy::let_and_return, - clippy::manual_assert, - clippy::manual_ok_or, - clippy::manual_split_once, - clippy::manual_let_else, - clippy::manual_string_new, - clippy::map_flatten, - clippy::map_unwrap_or, - clippy::missing_enforced_import_renames, - clippy::missing_assert_message, - clippy::missing_const_for_fn, - clippy::must_use_candidate, - clippy::mut_mut, - clippy::needless_for_each, - clippy::needless_option_as_deref, - clippy::needless_pass_by_value, - clippy::needless_collect, - clippy::needless_continue, - clippy::non_send_fields_in_send_ty, - clippy::nonstandard_macro_braces, - clippy::option_if_let_else, - clippy::option_option, - clippy::rc_mutex, - clippy::redundant_else, - clippy::same_name_method, - clippy::semicolon_if_nothing_returned, - clippy::str_to_string, - clippy::string_to_string, - clippy::too_many_lines, - clippy::trivially_copy_pass_by_ref, - clippy::trivial_regex, - clippy::try_err, - clippy::unnested_or_patterns, - clippy::unused_async, - clippy::unwrap_or_else_default, - clippy::useless_let_if_seq, - bad_style, - clashing_extern_declarations, - dead_code, - deprecated, - explicit_outlives_requirements, - improper_ctypes, - invalid_value, - missing_copy_implementations, - missing_debug_implementations, - mutable_transmutes, - no_mangle_generic_items, - non_shorthand_field_patterns, - overflowing_literals, - path_statements, - patterns_in_fns_without_body, - private_in_public, - trivial_bounds, - trivial_casts, - trivial_numeric_casts, - type_alias_bounds, - unconditional_recursion, - unreachable_pub, - unsafe_code, - unstable_features, - unused, - unused_allocation, - unused_comparisons, - unused_import_braces, - unused_parens, - unused_qualifications, - while_true, - missing_docs -)] -#![warn(clippy::exhaustive_enums)] -#![allow(unused_attributes, clippy::derive_partial_eq_without_eq, clippy::box_default)] -// !!END_LINTS -// Add exceptions here -#![allow(missing_docs)] - -#[macro_use] -extern crate tracing; - -pub mod component; -mod error; -pub use component::WasmComponent; -pub use error::*; -mod wasi; diff --git a/crates/wick/wick-component-wasm/src/wasi.rs b/crates/wick/wick-component-wasm/src/wasi.rs deleted file mode 100644 index c389884a..00000000 --- a/crates/wick/wick-component-wasm/src/wasi.rs +++ /dev/null @@ -1,41 +0,0 @@ -use std::path::PathBuf; - -use wasmtime_wasi::preview2::{DirPerms, FilePerms, Table, WasiCtx}; -use wasmtime_wasi::{ambient_authority, Dir}; - -use crate::Error; - -pub(crate) fn init_ctx( - table: &mut Table, - preopen_dirs: Vec<(String, Dir)>, - argv: &[String], - env: &[(String, String)], -) -> Result { - let mut ctx_builder = wasmtime_wasi::preview2::WasiCtxBuilder::new(); - - ctx_builder.inherit_stdio().args(argv).envs(env); - - for (path, opendir) in preopen_dirs { - let dir_perms = DirPerms::all(); - let file_perms = FilePerms::all(); - ctx_builder.preopened_dir(opendir, dir_perms, file_perms, path); - } - - ctx_builder.build(table).map_err(Error::WasiCtx) -} - -pub(crate) fn compute_preopen_dirs<'a, T: Iterator>( - map_dirs: T, -) -> Result, Error> { - let ambient_authority = ambient_authority(); - let mut preopen_dirs = Vec::new(); - - for (guest_path, host_path) in map_dirs { - preopen_dirs.push(( - guest_path.clone(), - Dir::open_ambient_dir(host_path, ambient_authority).map_err(Error::OpenDir)?, - )); - } - - Ok(preopen_dirs) -} diff --git a/crates/wick/wick-runtime/Cargo.toml b/crates/wick/wick-runtime/Cargo.toml index 6104ef93..c4747b43 100644 --- a/crates/wick/wick-runtime/Cargo.toml +++ b/crates/wick/wick-runtime/Cargo.toml @@ -22,7 +22,6 @@ wick-packet = { workspace = true, features = ["validation", "rng", "std"] } wick-interface-types = { workspace = true, features = ["value"] } wick-config = { workspace = true, features = ["config"] } wick-component-wasmrs = { workspace = true } -wick-component-wasm = { workspace = true } wick-rpc = { workspace = true } wick-interface-http = { workspace = true } wick-interface-cli = { workspace = true } diff --git a/crates/wick/wick-runtime/src/components.rs b/crates/wick/wick-runtime/src/components.rs index 56960014..898374e6 100644 --- a/crates/wick/wick-runtime/src/components.rs +++ b/crates/wick/wick-runtime/src/components.rs @@ -15,7 +15,7 @@ use uuid::Uuid; use wick_component_wasmrs::component::WasmrsComponent; use wick_component_wasmrs::error::LinkError; use wick_config::config::components::ManifestComponent; -use wick_config::config::{Metadata, Permissions, PermissionsBuilder, WasmComponentDefinition, WasmRsComponent}; +use wick_config::config::{Metadata, Permissions, PermissionsBuilder, WasmRsComponent}; use wick_config::{AssetReference, FetchOptions, Resolver, WickConfiguration}; use wick_packet::validation::expect_configuration_matches; use wick_packet::{Entity, Invocation, RuntimeConfig}; @@ -76,44 +76,6 @@ pub(crate) async fn init_wasmrs_component( Ok(NamespaceHandler::new(namespace, Box::new(service))) } -pub(crate) async fn init_wasm_component( - reference: &AssetReference, - namespace: String, - opts: ChildInit, - permissions: Option, - provided: HashMap, - imported: HashMap, -) -> ComponentInitResult { - opts - .span - .in_scope(|| trace!(namespace = %namespace, ?opts, ?permissions, "registering wasmrs component")); - - let mut options = FetchOptions::default(); - options - .set_allow_latest(opts.allow_latest) - .set_allow_insecure(opts.allowed_insecure.clone()); - let asset = reference.with_options(options); - - use wick_component_wasm::component::{ComponentSetupBuilder, WasmComponent}; - - let setup = ComponentSetupBuilder::default() - .permissions(permissions) - .config(opts.root_config) - .callback(make_link_callback(opts.runtime_id)) - .provided(provided) - .imported(imported) - .build() - .unwrap(); - - let component = WasmComponent::try_load(&namespace, asset, setup, opts.span).await?; - - let component = Arc::new(component); - - let service = NativeComponentService::new(component); - - Ok(NamespaceHandler::new(namespace, Box::new(service))) -} - pub(crate) async fn init_wasmrs_def( kind: &WasmRsComponent, namespace: String, @@ -135,17 +97,6 @@ pub(crate) async fn init_wasmrs_def( .await } -pub(crate) async fn init_wasm_def( - kind: &WasmComponentDefinition, - namespace: String, - opts: ChildInit, - permissions: Option, - provided: HashMap, - imported: HashMap, -) -> ComponentInitResult { - init_wasm_component(kind.reference(), namespace, opts, permissions, provided, imported).await -} - pub(crate) fn make_link_callback(scope_id: Uuid) -> LocalScope { LocalScope::new(Arc::new(move |compref, op, stream, inherent, config, span| { let origin_url = compref.get_origin_url(); @@ -221,31 +172,8 @@ pub(crate) async fn init_impl( opts.rng_seed = rng.seed(); let metadata = manifest.metadata(); match manifest.component() { - config::ComponentImplementation::Wasm(wasmimpl) => { - let mut dirs = HashMap::new(); - for volume in wasmimpl.volumes() { - let resource = (resolver)(volume.resource())?.try_resource()?.try_volume()?; - dirs.insert(volume.path().to_owned(), resource.path()?); - } - let perms = (!dirs.is_empty()).then(|| PermissionsBuilder::default().dirs(dirs).build().unwrap()); - - let imported: HashMap = manifest - .import() - .iter() - .map(|i| (i.id().to_owned(), Entity::component(i.id()).url())) - .collect(); - let comp = init_wasm_def(wasmimpl, id.clone(), opts, perms, provided, imported).await?; - let signed_sig = comp.component().signature(); - let manifest_sig = manifest.signature()?; - span.in_scope(|| { - expect_signature_match( - Some(&PathBuf::from(&id)), - signed_sig, - Some(&PathBuf::from(wasmimpl.reference().location())), - &manifest_sig, - ) - })?; - Ok(comp) + config::ComponentImplementation::Wasm(_) => { + unimplemented!("WASM components are not yet supported in wick releases"); } config::ComponentImplementation::WasmRs(wasmimpl) => { let mut dirs = HashMap::new(); diff --git a/crates/wick/wick-runtime/src/components/error.rs b/crates/wick/wick-runtime/src/components/error.rs index 1be25045..33d5520c 100644 --- a/crates/wick/wick-runtime/src/components/error.rs +++ b/crates/wick/wick-runtime/src/components/error.rs @@ -23,12 +23,6 @@ pub enum ComponentError { RpcHandlerError(#[from] Box), } -impl From for ComponentError { - fn from(e: wick_component_wasm::Error) -> Self { - ComponentError::Downstream(Box::new(e)) - } -} - impl From for ComponentError { fn from(e: wick_component_wasmrs::Error) -> Self { ComponentError::Downstream(Box::new(e)) diff --git a/crates/wick/wick-runtime/src/runtime/scope/error.rs b/crates/wick/wick-runtime/src/runtime/scope/error.rs index cf989b45..6b3e26d2 100644 --- a/crates/wick/wick-runtime/src/runtime/scope/error.rs +++ b/crates/wick/wick-runtime/src/runtime/scope/error.rs @@ -52,9 +52,6 @@ pub enum ScopeError { #[error(transparent)] WasmRs(#[from] Box), - #[error(transparent)] - Wasm(#[from] Box), - #[error("constraint not met, {0}")] InvalidConstraint(ConstraintFailure), @@ -102,11 +99,6 @@ impl From for ScopeError { ScopeError::WasmRs(Box::new(e)) } } -impl From for ScopeError { - fn from(e: wick_component_wasm::Error) -> Self { - ScopeError::Wasm(Box::new(e)) - } -} impl From for ScopeError { fn from(e: flow_graph::error::Error) -> Self { diff --git a/crates/wick/wick-trigger-wasm-command/src/state.rs b/crates/wick/wick-trigger-wasm-command/src/state.rs index ef564da5..564b6e04 100644 --- a/crates/wick/wick-trigger-wasm-command/src/state.rs +++ b/crates/wick/wick-trigger-wasm-command/src/state.rs @@ -8,7 +8,6 @@ pub(super) mod generated { path: "../../../wit/", async:true, }); - pub(crate) use candle::wick::wick::*; } pub(super) struct SimpleState { @@ -33,29 +32,3 @@ impl WasiView for SimpleState { &mut self.wasi } } - -#[async_trait::async_trait] -#[allow(unused)] -impl generated::Host for SimpleState { - async fn request_sync( - &mut self, - invocation: generated::Invocation, - ) -> wasmtime::Result> { - todo!() - } - - async fn request_async(&mut self, invocation: generated::Invocation) -> wasmtime::Result { - todo!() - } - - async fn get_response( - &mut self, - id: u64, - ) -> wasmtime::Result> { - todo!() - } - - async fn cancel_request(&mut self, id: u64) -> wasmtime::Result<()> { - todo!() - } -} diff --git a/crates/wick/wick-trigger-wasm-command/src/trigger.rs b/crates/wick/wick-trigger-wasm-command/src/trigger.rs index d8207554..de8b3c93 100644 --- a/crates/wick/wick-trigger-wasm-command/src/trigger.rs +++ b/crates/wick/wick-trigger-wasm-command/src/trigger.rs @@ -61,8 +61,6 @@ impl Trigger for WasmTrigger { let wasi = wasi.build(&mut table).map_err(Error::WasiBuild)?; let mut store = Store::new(engine, SimpleState { wasi, table }); - state::generated::add_to_linker(&mut linker, |state: &mut SimpleState| state).map_err(Error::Linker)?; - let (_bindings, instance) = state::generated::CommandTrigger::instantiate_async(&mut store, &component, &linker) .await .map_err(Error::Instantiation)?; diff --git a/wit/wick.wit b/wit/wick.wit deleted file mode 100644 index e84e7b20..00000000 --- a/wit/wick.wit +++ /dev/null @@ -1,28 +0,0 @@ -interface wick { - type json = string - - record invocation { - target: operation, - payload: json, - } - - record operation { - name: string, - component: string, - } - - record response { - payload: json, - } - - variant invocation-error { - internal, - } - - request-sync: func(invocation: invocation) -> result - - request-async: func(invocation: invocation) -> u64 - get-response: func(id: u64) -> result - cancel-request: func(id: u64) -> () -} - diff --git a/wit/worlds.wit b/wit/worlds.wit index d7d8222d..571031e1 100644 --- a/wit/worlds.wit +++ b/wit/worlds.wit @@ -1,10 +1,5 @@ package candle:wick world command-trigger { - import wick } -world component { - import wick - export wick -} \ No newline at end of file