diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 134a9005..471e888f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -33,10 +33,7 @@ jobs: - name: Build WASM support run: | cargo install cargo-component@0.9.0 --locked || cargo-component --version - cargo build --verbose - cargo component build -p pulumi_wasm --verbose - cargo component build -p pulumi_wasm_random --verbose - cargo component build -p pulumi_rust_wasm --verbose - cargo component build -p pulumi_wasm_main --verbose + cargo install wasm-tools@1.0.57 --locked || wasm-tools --version + ./build.sh - name: Run tests run: cargo test --all --verbose diff --git a/Cargo.lock b/Cargo.lock index e394b810..c86b42a9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -379,9 +379,9 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chrono" -version = "0.4.34" +version = "0.4.35" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bc015644b92d5890fab7489e49d21f879d5c990186827d42ec511919404f38b" +checksum = "8eaf5903dcbc0a39312feb77df2ff4c76387d591b9fc7b04a238dcf8bb62639a" dependencies = [ "android-tzdata", "iana-time-zone", @@ -1609,42 +1609,25 @@ dependencies = [ [[package]] name = "pulumi-wasm-parent" version = "0.1.0" -dependencies = [ - "anyhow", - "clap", - "log", - "log4rs", - "prost-types", - "pulumi_rust", - "tokio", - "tonic", -] [[package]] -name = "pulumi_rust" +name = "pulumi_rust_wasm" version = "0.1.0" dependencies = [ "anyhow", - "async-trait", + "bitflags 2.4.2", "futures", + "lazy_static", "log", - "prost", - "prost-types", - "regex", "rmp-serde", "serde", "serde_json", - "tonic", - "tonic-build", - "tonic-web", - "tracing-subscriber", "uuid", - "wasmtime", - "wasmtime-wasi", + "wit-bindgen-rt", ] [[package]] -name = "pulumi_rust_wasm" +name = "pulumi_wasm" version = "0.1.0" dependencies = [ "anyhow", @@ -1652,15 +1635,25 @@ dependencies = [ "futures", "lazy_static", "log", + "once_cell", + "prost", + "prost-types", + "rmp", "rmp-serde", + "rmpv", "serde", "serde_json", + "tonic", + "tonic-build", "uuid", + "wasm_common", + "wasmtime", + "wasmtime-wasi", "wit-bindgen-rt", ] [[package]] -name = "pulumi_wasm" +name = "pulumi_wasm_example_simple" version = "0.1.0" dependencies = [ "anyhow", @@ -1671,13 +1664,13 @@ dependencies = [ "once_cell", "prost", "prost-types", + "pulumi_rust_wasm", "rmp", "rmp-serde", "rmpv", "serde", "serde_json", "tonic", - "tonic-build", "uuid", "wasm_common", "wasmtime", @@ -1686,7 +1679,7 @@ dependencies = [ ] [[package]] -name = "pulumi_wasm_main" +name = "pulumi_wasm_provider_random" version = "0.1.0" dependencies = [ "anyhow", @@ -1697,7 +1690,6 @@ dependencies = [ "once_cell", "prost", "prost-types", - "pulumi_rust_wasm", "rmp", "rmp-serde", "rmpv", @@ -1712,28 +1704,29 @@ dependencies = [ ] [[package]] -name = "pulumi_wasm_random" +name = "pulumi_wasm_runner" version = "0.1.0" dependencies = [ "anyhow", - "bitflags 2.4.2", + "async-trait", + "clap", "futures", - "lazy_static", "log", - "once_cell", + "log4rs", "prost", "prost-types", - "rmp", + "regex", "rmp-serde", - "rmpv", "serde", "serde_json", + "tokio", "tonic", + "tonic-build", + "tonic-web", + "tracing-subscriber", "uuid", - "wasm_common", "wasmtime", "wasmtime-wasi", - "wit-bindgen-rt", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 7cfeb112..01aab0d2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,23 +6,15 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -pulumi_rust = { path = "pulumi_rust" } -tokio.workspace = true -log.workspace = true -anyhow.workspace = true -tonic = { workspace = true, default-features = true } -prost-types.workspace = true -clap.workspace = true -log4rs.workspace = true [workspace] members = [ - "pulumi_rust", + "pulumi_wasm_runner", "pulumi_wasm", - "pulumi_wasm_random", - "pulumi_wasm_main", - "pulumi_rust_wasm", - "wasm_common" + "providers/pulumi_wasm_provider_random", + "pulumi_wasm_rust", + "wasm_common", + "examples/simple" ] [workspace.dependencies] diff --git a/build.bat b/build.bat index 9052edfa..47610a24 100644 --- a/build.bat +++ b/build.bat @@ -1 +1,33 @@ -echo %* \ No newline at end of file +cargo component build -p wasm_common || exit /b 1 +cargo component build -p pulumi_wasm || exit /b 1 +cargo component build -p pulumi_wasm_provider_random || exit /b 1 +cargo component build -p pulumi_wasm_example_simple || exit /b 1 +cargo build -p pulumi_wasm_runner || exit /b 1 +@REM cargo build -p pulumi_rust_wasm || exit /b +@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi_wasm_example_simple.wasm +@REM +echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm.wasm" || exit /b 1 +echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm_example_simple.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm-example-simple.wasm" || exit /b 1 +echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm_provider_random.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm-provider-random.wasm" || exit /b 1 +@REM +@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm +@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm +@REM +wasm-tools compose -o target/wasm32-wasi/debug/composed1.wasm target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm -d target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm || exit /b 1 +wasm-tools compose -o target/wasm32-wasi/debug/composed2.wasm target/wasm32-wasi/debug/composed1.wasm -d target/wasm32-wasi/debug/pulumi-wasm.wasm || exit /b 1 +@REM cargo run -p pulumi_wasm_runner -- compile --wasm target/wasm32-wasi/debug/composed2.wasm --output target/wasm32-wasi/debug/composed2.cwasm || exit /b 1 +@REM wasmtime compile -D debug-info=y,coredump=y,address-map=y -o target/wasm32-wasi/debug/composed2.cwasm target/wasm32-wasi/debug/composed2.wasm || exit /b 1 +@REM +@REM cargo build -p pulumi_entrypoint || exit /b +@REM +@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm +@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm +@REM +@REM wasm-tools component wit target/wasm32-wasi/debug/composed1.wasm +@REM wasm-tools component wit target/wasm32-wasi/debug/composed2.wasm +@REM +wasm-tools component wit target/wasm32-wasi/debug/composed2.wasm || exit /b 1 +wasm-tools print target/wasm32-wasi/debug/composed1.wasm > composed1.wat || exit /b 1 +wasm-tools print target/wasm32-wasi/debug/composed2.wasm > composed2.wat || exit /b 1 + +@REM cargo build --target wasm32-wasi \ No newline at end of file diff --git a/run.sh b/build.sh similarity index 53% rename from run.sh rename to build.sh index 0906aff8..6f30af14 100755 --- a/run.sh +++ b/build.sh @@ -4,21 +4,19 @@ set -e cargo component build -p wasm_common cargo component build -p pulumi_wasm -cargo component build -p pulumi_wasm_random -cargo component build -p pulumi_rust_wasm -cargo component build -p pulumi_wasm_main -cargo build +cargo component build -p pulumi_wasm_provider_random +cargo component build -p pulumi_wasm_example_simple +cargo build -p pulumi_wasm_runner cp "target/wasm32-wasi/debug/pulumi_wasm.wasm" "target/wasm32-wasi/debug/pulumi-wasm.wasm" -cp "target/wasm32-wasi/debug/pulumi_wasm_main.wasm" "target/wasm32-wasi/debug/pulumi-wasm-main.wasm" -cp "target/wasm32-wasi/debug/pulumi_wasm_random.wasm" "target/wasm32-wasi/debug/pulumi-wasm-random.wasm" -cp "target/wasm32-wasi/debug/pulumi_rust_wasm.wasm" "target/wasm32-wasi/debug/pulumi-rust-wasm.wasm" +cp "target/wasm32-wasi/debug/pulumi_wasm_example_simple.wasm" "target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm" +cp "target/wasm32-wasi/debug/pulumi_wasm_provider_random.wasm" "target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm" -wasm-tools compose -o target/wasm32-wasi/debug/composed1.wasm target/wasm32-wasi/debug/pulumi-wasm-main.wasm -d target/wasm32-wasi/debug/pulumi-wasm-random.wasm +wasm-tools compose -o target/wasm32-wasi/debug/composed1.wasm target/wasm32-wasi/debug/pulumi-wasm-example-simple.wasm -d target/wasm32-wasi/debug/pulumi-wasm-provider-random.wasm wasm-tools compose -o target/wasm32-wasi/debug/composed2.wasm target/wasm32-wasi/debug/composed1.wasm -d target/wasm32-wasi/debug/pulumi-wasm.wasm -cargo run -- compile --wasm target/wasm32-wasi/debug/composed2.wasm --output target/wasm32-wasi/debug/composed2.cwasm +#cargo run -p pulumi_wasm_runner -- compile --wasm target/wasm32-wasi/debug/composed2.wasm --output target/wasm32-wasi/debug/composed2.cwasm #wasmtime compile -D debug-info=y,coredump=y,address-map=y -o target/wasm32-wasi/debug/composed2.cwasm target/wasm32-wasi/debug/composed2.wasm || exit /b 1 wasm-tools component wit target/wasm32-wasi/debug/composed2.wasm diff --git a/entrypoint.bat b/entrypoint.bat index 750ffa2b..645ab720 100644 --- a/entrypoint.bat +++ b/entrypoint.bat @@ -4,4 +4,4 @@ @REM cargo run -- run --wasm target/wasm32-wasi/debug/composed2.wasm -.\run.bat && cargo run -- run --wasm target/wasm32-wasi/debug/composed2.wasm \ No newline at end of file +.\build.bat && cargo run -p pulumi_wasm_runner -- run --wasm target/wasm32-wasi/debug/composed2.wasm \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 8b51e9ae..16eae733 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -2,6 +2,6 @@ set -e -./run.sh +./build.sh -cargo run -- run --wasm target/wasm32-wasi/debug/composed2.wasm +cargo run -p pulumi_wasm_runner -- run --wasm target/wasm32-wasi/debug/composed2.wasm diff --git a/pulumi_wasm_main/Cargo.toml b/examples/simple/Cargo.toml similarity index 82% rename from pulumi_wasm_main/Cargo.toml rename to examples/simple/Cargo.toml index f6a9d418..9e5e6ff0 100644 --- a/pulumi_wasm_main/Cargo.toml +++ b/examples/simple/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pulumi_wasm_main" +name = "pulumi_wasm_example_simple" version = "0.1.0" edition = "2021" @@ -24,9 +24,9 @@ rmpv.workspace = true serde.workspace = true tonic.workspace = true serde_json.workspace = true -pulumi_rust_wasm = { path = "../pulumi_rust_wasm" } +pulumi_rust_wasm = { path = "../../pulumi_wasm_rust" } log.workspace = true -wasm_common = { path = "../wasm_common" } +wasm_common = { path = "../../wasm_common" } [dev-dependencies] wasmtime.workspace = true @@ -36,5 +36,5 @@ wasmtime-wasi.workspace = true package = "component:pulumi-wasm-main" [package.metadata.component.target] -path = "../wits/world.wit" +path = "../../wits/world.wit" world = "new-main" diff --git a/pulumi_wasm_main/src/bindings.rs b/examples/simple/src/bindings.rs similarity index 100% rename from pulumi_wasm_main/src/bindings.rs rename to examples/simple/src/bindings.rs diff --git a/pulumi_wasm_main/src/lib.rs b/examples/simple/src/lib.rs similarity index 98% rename from pulumi_wasm_main/src/lib.rs rename to examples/simple/src/lib.rs index 5d837287..ee56c881 100644 --- a/pulumi_wasm_main/src/lib.rs +++ b/examples/simple/src/lib.rs @@ -26,7 +26,7 @@ impl Guest for Component { let length: Output = Output::new(&1).map(|i: i32| i * 3); let _v = create_random_string(RandomStringArgs { - name: "test1234", + name: "test123456", length, }); diff --git a/pulumi_wasm_main/src/random.rs b/examples/simple/src/random.rs similarity index 100% rename from pulumi_wasm_main/src/random.rs rename to examples/simple/src/random.rs diff --git a/pulumi_wasm_random/Cargo.toml b/providers/pulumi_wasm_provider_random/Cargo.toml similarity index 87% rename from pulumi_wasm_random/Cargo.toml rename to providers/pulumi_wasm_provider_random/Cargo.toml index ba544119..501c2d33 100644 --- a/pulumi_wasm_random/Cargo.toml +++ b/providers/pulumi_wasm_provider_random/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pulumi_wasm_random" +name = "pulumi_wasm_provider_random" version = "0.1.0" edition = "2021" @@ -25,7 +25,7 @@ serde.workspace = true tonic.workspace = true serde_json.workspace = true log.workspace = true -wasm_common = { path = "../wasm_common" } +wasm_common = { path = "../../wasm_common" } [dev-dependencies] wasmtime.workspace = true @@ -35,5 +35,5 @@ wasmtime-wasi.workspace = true package = "component:pulumi-provider-random" [package.metadata.component.target] -path = "../wits/world.wit" +path = "../../wits/world.wit" world = "pulumi-provider-random" diff --git a/pulumi_wasm_random/src/bindings.rs b/providers/pulumi_wasm_provider_random/src/bindings.rs similarity index 100% rename from pulumi_wasm_random/src/bindings.rs rename to providers/pulumi_wasm_provider_random/src/bindings.rs diff --git a/pulumi_wasm_random/src/lib.rs b/providers/pulumi_wasm_provider_random/src/lib.rs similarity index 100% rename from pulumi_wasm_random/src/lib.rs rename to providers/pulumi_wasm_provider_random/src/lib.rs diff --git a/pulumi_rust/src/lib.rs b/pulumi_rust/src/lib.rs deleted file mode 100644 index 9f42a886..00000000 --- a/pulumi_rust/src/lib.rs +++ /dev/null @@ -1,6 +0,0 @@ -mod grpc { - #![allow(clippy::all)] - #![allow(clippy::pedantic)] - tonic::include_proto!("pulumirpc"); -} -pub mod pulumi; diff --git a/pulumi_rust/Cargo.toml b/pulumi_wasm_runner/Cargo.toml similarity index 87% rename from pulumi_rust/Cargo.toml rename to pulumi_wasm_runner/Cargo.toml index 6a675c1d..15f31a94 100644 --- a/pulumi_rust/Cargo.toml +++ b/pulumi_wasm_runner/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "pulumi_rust" +name = "pulumi_wasm_runner" version = "0.1.0" edition = "2021" @@ -22,6 +22,9 @@ serde_json.workspace = true futures.workspace = true async-trait.workspace = true regex.workspace = true +tokio.workspace = true +log4rs.workspace = true +clap.workspace = true [build-dependencies] tonic-build.workspace = true diff --git a/pulumi_rust/build.rs b/pulumi_wasm_runner/build.rs similarity index 100% rename from pulumi_rust/build.rs rename to pulumi_wasm_runner/build.rs diff --git a/pulumi_rust/proto/google/protobuf/any.proto b/pulumi_wasm_runner/proto/google/protobuf/any.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/any.proto rename to pulumi_wasm_runner/proto/google/protobuf/any.proto diff --git a/pulumi_rust/proto/google/protobuf/api.proto b/pulumi_wasm_runner/proto/google/protobuf/api.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/api.proto rename to pulumi_wasm_runner/proto/google/protobuf/api.proto diff --git a/pulumi_rust/proto/google/protobuf/descriptor.proto b/pulumi_wasm_runner/proto/google/protobuf/descriptor.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/descriptor.proto rename to pulumi_wasm_runner/proto/google/protobuf/descriptor.proto diff --git a/pulumi_rust/proto/google/protobuf/duration.proto b/pulumi_wasm_runner/proto/google/protobuf/duration.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/duration.proto rename to pulumi_wasm_runner/proto/google/protobuf/duration.proto diff --git a/pulumi_rust/proto/google/protobuf/empty.proto b/pulumi_wasm_runner/proto/google/protobuf/empty.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/empty.proto rename to pulumi_wasm_runner/proto/google/protobuf/empty.proto diff --git a/pulumi_rust/proto/google/protobuf/field_mask.proto b/pulumi_wasm_runner/proto/google/protobuf/field_mask.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/field_mask.proto rename to pulumi_wasm_runner/proto/google/protobuf/field_mask.proto diff --git a/pulumi_rust/proto/google/protobuf/source_context.proto b/pulumi_wasm_runner/proto/google/protobuf/source_context.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/source_context.proto rename to pulumi_wasm_runner/proto/google/protobuf/source_context.proto diff --git a/pulumi_rust/proto/google/protobuf/struct.proto b/pulumi_wasm_runner/proto/google/protobuf/struct.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/struct.proto rename to pulumi_wasm_runner/proto/google/protobuf/struct.proto diff --git a/pulumi_rust/proto/google/protobuf/timestamp.proto b/pulumi_wasm_runner/proto/google/protobuf/timestamp.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/timestamp.proto rename to pulumi_wasm_runner/proto/google/protobuf/timestamp.proto diff --git a/pulumi_rust/proto/google/protobuf/type.proto b/pulumi_wasm_runner/proto/google/protobuf/type.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/type.proto rename to pulumi_wasm_runner/proto/google/protobuf/type.proto diff --git a/pulumi_rust/proto/google/protobuf/wrappers.proto b/pulumi_wasm_runner/proto/google/protobuf/wrappers.proto similarity index 100% rename from pulumi_rust/proto/google/protobuf/wrappers.proto rename to pulumi_wasm_runner/proto/google/protobuf/wrappers.proto diff --git a/pulumi_rust/proto/pulumi/alias.proto b/pulumi_wasm_runner/proto/pulumi/alias.proto similarity index 100% rename from pulumi_rust/proto/pulumi/alias.proto rename to pulumi_wasm_runner/proto/pulumi/alias.proto diff --git a/pulumi_rust/proto/pulumi/analyzer.proto b/pulumi_wasm_runner/proto/pulumi/analyzer.proto similarity index 100% rename from pulumi_rust/proto/pulumi/analyzer.proto rename to pulumi_wasm_runner/proto/pulumi/analyzer.proto diff --git a/pulumi_rust/proto/pulumi/codegen/hcl.proto b/pulumi_wasm_runner/proto/pulumi/codegen/hcl.proto similarity index 100% rename from pulumi_rust/proto/pulumi/codegen/hcl.proto rename to pulumi_wasm_runner/proto/pulumi/codegen/hcl.proto diff --git a/pulumi_rust/proto/pulumi/codegen/loader.proto b/pulumi_wasm_runner/proto/pulumi/codegen/loader.proto similarity index 100% rename from pulumi_rust/proto/pulumi/codegen/loader.proto rename to pulumi_wasm_runner/proto/pulumi/codegen/loader.proto diff --git a/pulumi_rust/proto/pulumi/codegen/mapper.proto b/pulumi_wasm_runner/proto/pulumi/codegen/mapper.proto similarity index 100% rename from pulumi_rust/proto/pulumi/codegen/mapper.proto rename to pulumi_wasm_runner/proto/pulumi/codegen/mapper.proto diff --git a/pulumi_rust/proto/pulumi/converter.proto b/pulumi_wasm_runner/proto/pulumi/converter.proto similarity index 100% rename from pulumi_rust/proto/pulumi/converter.proto rename to pulumi_wasm_runner/proto/pulumi/converter.proto diff --git a/pulumi_rust/proto/pulumi/engine.proto b/pulumi_wasm_runner/proto/pulumi/engine.proto similarity index 100% rename from pulumi_rust/proto/pulumi/engine.proto rename to pulumi_wasm_runner/proto/pulumi/engine.proto diff --git a/pulumi_rust/proto/pulumi/errors.proto b/pulumi_wasm_runner/proto/pulumi/errors.proto similarity index 100% rename from pulumi_rust/proto/pulumi/errors.proto rename to pulumi_wasm_runner/proto/pulumi/errors.proto diff --git a/pulumi_rust/proto/pulumi/language.proto b/pulumi_wasm_runner/proto/pulumi/language.proto similarity index 100% rename from pulumi_rust/proto/pulumi/language.proto rename to pulumi_wasm_runner/proto/pulumi/language.proto diff --git a/pulumi_rust/proto/pulumi/plugin.proto b/pulumi_wasm_runner/proto/pulumi/plugin.proto similarity index 100% rename from pulumi_rust/proto/pulumi/plugin.proto rename to pulumi_wasm_runner/proto/pulumi/plugin.proto diff --git a/pulumi_rust/proto/pulumi/provider.proto b/pulumi_wasm_runner/proto/pulumi/provider.proto similarity index 100% rename from pulumi_rust/proto/pulumi/provider.proto rename to pulumi_wasm_runner/proto/pulumi/provider.proto diff --git a/pulumi_rust/proto/pulumi/resource.proto b/pulumi_wasm_runner/proto/pulumi/resource.proto similarity index 100% rename from pulumi_rust/proto/pulumi/resource.proto rename to pulumi_wasm_runner/proto/pulumi/resource.proto diff --git a/pulumi_rust/proto/pulumi/source.proto b/pulumi_wasm_runner/proto/pulumi/source.proto similarity index 100% rename from pulumi_rust/proto/pulumi/source.proto rename to pulumi_wasm_runner/proto/pulumi/source.proto diff --git a/pulumi_rust/proto/pulumi/testing/language.proto b/pulumi_wasm_runner/proto/pulumi/testing/language.proto similarity index 100% rename from pulumi_rust/proto/pulumi/testing/language.proto rename to pulumi_wasm_runner/proto/pulumi/testing/language.proto diff --git a/src/main.rs b/pulumi_wasm_runner/src/main.rs similarity index 94% rename from src/main.rs rename to pulumi_wasm_runner/src/main.rs index 9c1e2052..e3bd79aa 100644 --- a/src/main.rs +++ b/pulumi_wasm_runner/src/main.rs @@ -5,8 +5,15 @@ use log4rs::Config; use log4rs::config::{Appender, Root}; use log4rs::encode::json::JsonEncoder; use log::LevelFilter; +use crate::pulumi::{Pulumi, WasmFile}; -use pulumi_rust::pulumi::{Pulumi, WasmFile}; +mod pulumi; + +mod grpc { + #![allow(clippy::all)] + #![allow(clippy::pedantic)] + tonic::include_proto!("pulumirpc"); +} #[derive(Parser, Debug)] #[command(version, about, long_about = None)] diff --git a/pulumi_rust/src/pulumi.rs b/pulumi_wasm_runner/src/pulumi.rs similarity index 100% rename from pulumi_rust/src/pulumi.rs rename to pulumi_wasm_runner/src/pulumi.rs diff --git a/pulumi_rust_wasm/Cargo.toml b/pulumi_wasm_rust/Cargo.toml similarity index 100% rename from pulumi_rust_wasm/Cargo.toml rename to pulumi_wasm_rust/Cargo.toml diff --git a/pulumi_rust_wasm/src/bindings.rs b/pulumi_wasm_rust/src/bindings.rs similarity index 100% rename from pulumi_rust_wasm/src/bindings.rs rename to pulumi_wasm_rust/src/bindings.rs diff --git a/pulumi_rust_wasm/src/lib.rs b/pulumi_wasm_rust/src/lib.rs similarity index 100% rename from pulumi_rust_wasm/src/lib.rs rename to pulumi_wasm_rust/src/lib.rs diff --git a/pulumi_rust_wasm/src/output.rs b/pulumi_wasm_rust/src/output.rs similarity index 100% rename from pulumi_rust_wasm/src/output.rs rename to pulumi_wasm_rust/src/output.rs diff --git a/run.bat b/run.bat deleted file mode 100644 index bc53d4ce..00000000 --- a/run.bat +++ /dev/null @@ -1,35 +0,0 @@ -cargo component build -p wasm_common || exit /b 1 -cargo component build -p pulumi_wasm || exit /b 1 -cargo component build -p pulumi_wasm_random || exit /b 1 -cargo component build -p pulumi_rust_wasm || exit /b 1 -cargo component build -p pulumi_wasm_main || exit /b 1 -cargo build || exit /b 1 -@REM cargo build -p pulumi_rust_wasm || exit /b -@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi_wasm_main.wasm -@REM -echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm.wasm" || exit /b 1 -echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm_main.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm-main.wasm" || exit /b 1 -echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_wasm_random.wasm" ".\target\wasm32-wasi\debug\pulumi-wasm-random.wasm" || exit /b 1 -echo F|xcopy /b /v /y ".\target\wasm32-wasi\debug\pulumi_rust_wasm.wasm" ".\target\wasm32-wasi\debug\pulumi-rust-wasm.wasm" || exit /b 1 -@REM -@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-main.wasm -@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-random.wasm -@REM -wasm-tools compose -o target/wasm32-wasi/debug/composed1.wasm target/wasm32-wasi/debug/pulumi-wasm-main.wasm -d target/wasm32-wasi/debug/pulumi-wasm-random.wasm || exit /b 1 -wasm-tools compose -o target/wasm32-wasi/debug/composed2.wasm target/wasm32-wasi/debug/composed1.wasm -d target/wasm32-wasi/debug/pulumi-wasm.wasm || exit /b 1 -cargo run -- compile --wasm target/wasm32-wasi/debug/composed2.wasm --output target/wasm32-wasi/debug/composed2.cwasm || exit /b 1 -wasmtime compile -D debug-info=y,coredump=y,address-map=y -o target/wasm32-wasi/debug/composed2.cwasm target/wasm32-wasi/debug/composed2.wasm || exit /b 1 -@REM -@REM cargo build -p pulumi_entrypoint || exit /b -@REM -@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-random.wasm -@REM @REM wasm-tools component wit target/wasm32-wasi/debug/pulumi-wasm-main.wasm -@REM -@REM wasm-tools component wit target/wasm32-wasi/debug/composed1.wasm -@REM wasm-tools component wit target/wasm32-wasi/debug/composed2.wasm -@REM -wasm-tools component wit target/wasm32-wasi/debug/composed2.wasm || exit /b 1 -wasm-tools print target/wasm32-wasi/debug/composed1.wasm > composed1.wat || exit /b 1 -wasm-tools print target/wasm32-wasi/debug/composed2.wasm > composed2.wat || exit /b 1 - -@REM cargo build --target wasm32-wasi \ No newline at end of file diff --git a/src/lib.rs b/src/lib.rs new file mode 100644 index 00000000..e69de29b