diff --git a/Cargo.lock b/Cargo.lock index d8a6bb2fd..0649d579b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2039,6 +2039,7 @@ dependencies = [ "prost", "prost-types", "pulumi_wasm_proto", + "pulumi_wasm_wit", "regex", "serde", "serde_json", @@ -2084,6 +2085,7 @@ dependencies = [ name = "pulumi_wasm_wit" version = "0.0.0" dependencies = [ + "wasmtime", "wit-bindgen", ] diff --git a/justfile b/justfile index a96813ea8..15f12508c 100644 --- a/justfile +++ b/justfile @@ -62,14 +62,17 @@ regenerate-providers: # DO NOT EDIT - REGENERATE-PROVIDERS - END publish: - cargo publish -p pulumi_wasm_common --allow-dirty - cargo publish -p pulumi_wasm_rust_macro --allow-dirty - cargo publish -p pulumi_wasm_rust --allow-dirty - cargo publish -p pulumi_wasm_generator_lib --allow-dirty - cargo publish -p pulumi_wasm_generator --allow-dirty - cargo publish -p pulumi_wasm_core --allow-dirty - cargo publish -p pulumi_wasm_docker --allow-dirty - cargo publish -p pulumi_wasm_random --allow-dirty + cargo publish -p pulumi_wasm_wit --allow-dirty --all-features + cargo publish -p pulumi_wasm_proto --allow-dirty --all-features + cargo publish -p pulumi_wasm_common --allow-dirty --all-features + cargo publish -p pulumi_wasm_rust_macro --allow-dirty --all-features + cargo publish -p pulumi_wasm_rust --allow-dirty --all-features + cargo publish -p pulumi_wasm_generator_lib --allow-dirty --all-features + cargo publish -p pulumi_wasm_generator --allow-dirty --all-features + cargo publish -p pulumi_wasm_core --allow-dirty --all-features + cargo publish -p pulumi_wasm_docker --allow-dirty --all-features + cargo publish -p pulumi_wasm_random --allow-dirty --all-features + cargo publish -p pulumi_wasm_runner --allow-dirty --all-features test: cargo nextest run --workspace --timings diff --git a/pulumi_wasm_runner/Cargo.toml b/pulumi_wasm_runner/Cargo.toml index 7858ad2a0..aa758ea35 100644 --- a/pulumi_wasm_runner/Cargo.toml +++ b/pulumi_wasm_runner/Cargo.toml @@ -25,3 +25,4 @@ log4rs.workspace = true clap.workspace = true wac-graph.workspace = true pulumi_wasm_proto = { workspace = true, features = ["connectivity"] } +pulumi_wasm_wit = { workspace = true, features = ["server"] } \ No newline at end of file diff --git a/pulumi_wasm_runner/src/pulumi.rs b/pulumi_wasm_runner/src/pulumi.rs index b2b915a52..bc5dbc9e4 100644 --- a/pulumi_wasm_runner/src/pulumi.rs +++ b/pulumi_wasm_runner/src/pulumi.rs @@ -17,6 +17,7 @@ use crate::pulumi::server::component::pulumi_wasm::external_world::Host; use crate::pulumi::server::component::pulumi_wasm::external_world::RegisteredResource; use crate::pulumi::server::Main; use crate::pulumi_state::PulumiState; +use pulumi_wasm_wit::bindings_server as server; pub struct Pulumi { plugin: Main, @@ -24,15 +25,6 @@ pub struct Pulumi { store: Store, } -pub(crate) mod server { - wasmtime::component::bindgen!({ - path: "../wits/world.wit", - world: "main", - async: true, - trappable_imports: true, - }); -} - struct SimplePluginCtx { table: ResourceTable, context: WasiCtx, diff --git a/pulumi_wasm_wit/Cargo.toml b/pulumi_wasm_wit/Cargo.toml index e91198264..f16902e84 100644 --- a/pulumi_wasm_wit/Cargo.toml +++ b/pulumi_wasm_wit/Cargo.toml @@ -8,6 +8,8 @@ edition.workspace = true [features] pulumi-wasm-rust = [] logger = [] +server = ["dep:wasmtime"] [dependencies] wit-bindgen.workspace = true +wasmtime = { workspace = true, optional = true } \ No newline at end of file diff --git a/pulumi_wasm_wit/src/lib.rs b/pulumi_wasm_wit/src/lib.rs index f3dbc89d6..40b91fbd1 100644 --- a/pulumi_wasm_wit/src/lib.rs +++ b/pulumi_wasm_wit/src/lib.rs @@ -21,3 +21,16 @@ pub mod bindings_logger { world: "logger", }); } + +#[allow(clippy::all)] +#[allow(dead_code)] +#[allow(unused_variables)] +#[allow(unused_unsafe)] +#[cfg(feature = "server")] +pub mod bindings_server { + wasmtime::component::bindgen!({ + world: "main", + async: true, + trappable_imports: true, + }); +} \ No newline at end of file