From 3fb9e6a56e5c0ee2d1c56d8f318a0b6479dc87ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=8BAndrzej=20Ressel?= Date: Fri, 5 Apr 2024 00:05:22 +0200 Subject: [PATCH] Cleanup, update Rust, speed up tests (#114) --- Cargo.lock | 15 --------------- examples/simple/Cargo.toml | 17 +---------------- examples/simple/justfile | 2 +- examples/simple/src/bindings.rs | 18 ------------------ justfile | 11 +++-------- .../output/random_provider/rust-toolchain.toml | 2 +- rust-toolchain.toml | 2 +- 7 files changed, 7 insertions(+), 60 deletions(-) delete mode 100644 examples/simple/src/bindings.rs diff --git a/Cargo.lock b/Cargo.lock index a1929b9ca..bd495a276 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1966,25 +1966,10 @@ version = "0.1.0" dependencies = [ "anyhow", "assert_cmd", - "bitflags 2.5.0", - "futures", - "lazy_static", - "log", - "once_cell", "predicates", - "prost", - "prost-types", "pulumi_wasm_random", "pulumi_wasm_rust", - "rmp", - "rmp-serde", - "rmpv", - "serde", "serde_json", - "tonic", - "uuid", - "wasm_common", - "wit-bindgen-rt", ] [[package]] diff --git a/examples/simple/Cargo.toml b/examples/simple/Cargo.toml index e9fc04ba2..0fd56114b 100644 --- a/examples/simple/Cargo.toml +++ b/examples/simple/Cargo.toml @@ -10,25 +10,10 @@ crate-type = ["cdylib"] [dependencies] anyhow.workspace = true -prost.workspace = true -prost-types.workspace = true -uuid.workspace = true -futures.workspace = true -lazy_static.workspace = true -once_cell.workspace = true -bitflags.workspace = true -wit-bindgen-rt.workspace = true -rmp.workspace = true -rmp-serde.workspace = true -rmpv.workspace = true -serde.workspace = true -tonic.workspace = true -serde_json.workspace = true pulumi_wasm_rust.workspace = true -log.workspace = true -wasm_common.workspace = true pulumi_wasm_random.workspace = true [dev-dependencies] assert_cmd.workspace = true predicates.workspace = true +serde_json.workspace = true \ No newline at end of file diff --git a/examples/simple/justfile b/examples/simple/justfile index a61b03253..ecf368a49 100644 --- a/examples/simple/justfile +++ b/examples/simple/justfile @@ -4,12 +4,12 @@ build: cargo run -p cargo-pulumi run: - just build cargo run -p pulumi_wasm_runner -- run --wasm ../../target/wasm32-wasi/debug/composed.wasm [windows] local-test: #!pwsh + cargo run -p cargo-pulumi $env:PULUMI_CONFIG_PASSPHRASE=" " pulumi destroy -y pulumi up -y \ No newline at end of file diff --git a/examples/simple/src/bindings.rs b/examples/simple/src/bindings.rs deleted file mode 100644 index 894729c29..000000000 --- a/examples/simple/src/bindings.rs +++ /dev/null @@ -1,18 +0,0 @@ -// Generated by `wit-bindgen` 0.20.0. DO NOT EDIT! -// Options used: - -#[cfg(target_arch = "wasm32")] -#[link_section = "component-type:wit-bindgen:0.20.0:pulumi_wasm_example_simple:encoded world"] -#[doc(hidden)] -pub static __WIT_BINDGEN_COMPONENT_TYPE: [u8; 218] = *b"\ -\0asm\x0d\0\x01\0\0\x19\x16wit-component-encoding\x04\0\x07J\x01A\x02\x01A\0\x04\ -\x01?component:pulumi_wasm_example_simple/pulumi_wasm_example_simple\x04\0\x0b\x20\ -\x01\0\x1apulumi_wasm_example_simple\x03\0\0\0G\x09producers\x01\x0cprocessed-by\ -\x02\x0dwit-component\x070.201.0\x10wit-bindgen-rust\x060.20.0"; - -#[inline(never)] -#[doc(hidden)] -#[cfg(target_arch = "wasm32")] -pub fn __link_custom_section_describing_imports() { - wit_bindgen_rt::maybe_link_cabi_realloc(); -} diff --git a/justfile b/justfile index 0ceef07d1..75490f38a 100644 --- a/justfile +++ b/justfile @@ -2,7 +2,7 @@ set windows-shell := ["pwsh.exe", "-c"] @default: build test -build: build-language-plugin regenerate-providers install-requirements build-wasm-components build-libraries fmt +build: build-language-plugin regenerate-providers install-requirements build-wasm-components fmt build-language-plugin: cd pulumi-language-wasm && just @@ -11,16 +11,11 @@ install-requirements: rustup component add rustfmt cargo install cargo-nextest@0.9.68 --locked || cargo-nextest --version cargo install cargo-component@0.10.1 --locked || cargo-component --version - cargo install wasm-tools@1.201.0 --locked || wasm-tools --version + cargo install wasm-tools@1.202.0 --locked || wasm-tools --version build-wasm-components: cargo component build -p pulumi_wasm -p pulumi_wasm_random_provider -p pulumi_wasm_example_simple - -build-libraries: - cargo build -p pulumi_wasm_runner \ - -p pulumi_wasm_rust \ - -p pulumi_wasm_rust_macro \ - -p pulumi_wasm_random + cargo run -p cargo-pulumi -- -p pulumi_wasm_example_simple check: cargo fmt --all -- --check diff --git a/pulumi_wasm_generator/tests/output/random_provider/rust-toolchain.toml b/pulumi_wasm_generator/tests/output/random_provider/rust-toolchain.toml index 60a9c584f..179a9ce32 100644 --- a/pulumi_wasm_generator/tests/output/random_provider/rust-toolchain.toml +++ b/pulumi_wasm_generator/tests/output/random_provider/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.77.0" +channel = "1.77.1" targets = ["wasm32-wasi"] \ No newline at end of file diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 60a9c584f..179a9ce32 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,3 +1,3 @@ [toolchain] -channel = "1.77.0" +channel = "1.77.1" targets = ["wasm32-wasi"] \ No newline at end of file