Skip to content

Commit

Permalink
Remove cargo component
Browse files Browse the repository at this point in the history
  • Loading branch information
andrzejressel committed Nov 29, 2024
1 parent 35531fd commit 7baa75f
Show file tree
Hide file tree
Showing 25 changed files with 109 additions and 39,779 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/deploy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,11 @@ jobs:
just build-wasm-components
just build-wasm-components-release
for i in target/wasm32-wasip1/debug/*_provider.wasm; do cp "$i" "${i%.*}-debug.wasm"; done
cp target/wasm32-wasip1/debug/pulumi_wasm.wasm target/wasm32-wasip1/debug/pulumi_wasm-debug.wasm
for i in target/wasm32-wasip2/debug/*_provider.wasm; do cp "$i" "${i%.*}-debug.wasm"; done
cp target/wasm32-wasip2/debug/pulumi_wasm.wasm target/wasm32-wasip2/debug/pulumi_wasm-debug.wasm
for i in target/wasm32-wasip1/release/*_provider.wasm; do cp "$i" "${i%.*}-release.wasm"; done
cp target/wasm32-wasip1/release/pulumi_wasm.wasm target/wasm32-wasip1/release/pulumi_wasm-release.wasm
for i in target/wasm32-wasip2/release/*_provider.wasm; do cp "$i" "${i%.*}-release.wasm"; done
cp target/wasm32-wasip2/release/pulumi_wasm.wasm target/wasm32-wasip2/release/pulumi_wasm-release.wasm
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -139,8 +139,8 @@ jobs:
prerelease: true
body: ""
files: |
target/wasm32-wasip1/release/*-release.wasm
target/wasm32-wasip1/debug/*-debug.wasm
target/wasm32-wasip2/release/*-release.wasm
target/wasm32-wasip2/debug/*-debug.wasm
deploy_language_plugin:
runs-on: ubuntu-24.04
Expand Down
8 changes: 4 additions & 4 deletions Cargo.lock

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

13 changes: 7 additions & 6 deletions examples/dependencies/justfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
set windows-shell := ["pwsh.exe", "-c"]
binary := "../../target/release/pulumi_wasm_runner"
wasm := "../../target/wasm32-wasip1/release/pulumi_wasm_example_dependencies.wasm"
pulumi_wasm := "../../target/wasm32-wasip1/release/pulumi_wasm.wasm"
random := "../../target/wasm32-wasip1/release/pulumi_wasm_random_provider.wasm"
wasm := "../../target/wasm32-wasip2/release/pulumi_wasm_example_dependencies.wasm"
pulumi_wasm := "../../target/wasm32-wasip2/release/pulumi_wasm.wasm"
random := "../../target/wasm32-wasip2/release/pulumi_wasm_random_provider.wasm"
TARGET_NAME := "wasm32-wasip2"

run:
{{binary}} run --pulumi-wasm "{{pulumi_wasm}}" --provider "random={{random}}" "{{wasm}}"
Expand All @@ -15,9 +16,9 @@ local-test:
$PSNativeCommandUseErrorActionPreference = $true

cargo build -p pulumi_wasm_runner --release
cargo component build -p pulumi_wasm --release
cargo component build -p pulumi_wasm_example_dependencies --release
cargo component build -p pulumi_wasm_random_provider --release
cargo build -p pulumi_wasm --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_dependencies --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_random_provider --release --target={{TARGET_NAME}}
$env:PULUMI_CONFIG_PASSPHRASE=" "
pulumi destroy -y
pulumi up -y
13 changes: 7 additions & 6 deletions examples/docker/justfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
set windows-shell := ["pwsh.exe", "-c"]
binary := "../../target/release/pulumi_wasm_runner"
wasm := "../../target/wasm32-wasip1/release/pulumi_wasm_example_docker.wasm"
pulumi_wasm := "../../target/wasm32-wasip1/release/pulumi_wasm.wasm"
docker := "../../target/wasm32-wasip1/release/pulumi_wasm_docker_provider.wasm"
wasm := "../../target/wasm32-wasip2/release/pulumi_wasm_example_docker.wasm"
pulumi_wasm := "../../target/wasm32-wasip2/release/pulumi_wasm.wasm"
docker := "../../target/wasm32-wasip2/release/pulumi_wasm_docker_provider.wasm"
TARGET_NAME := "wasm32-wasip2"

run:
{{binary}} run --pulumi-wasm "{{pulumi_wasm}}" --provider "docker={{docker}}" "{{wasm}}"
Expand All @@ -15,9 +16,9 @@ local-test:
$PSNativeCommandUseErrorActionPreference = $true

cargo build -p pulumi_wasm_runner --release
cargo component build -p pulumi_wasm --release
cargo component build -p pulumi_wasm_example_docker --release
cargo component build -p pulumi_wasm_docker_provider --release
cargo build -p pulumi_wasm --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_docker --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_docker_provider --release --target={{TARGET_NAME}}
$env:PULUMI_CONFIG_PASSPHRASE=" "
pulumi destroy -y
pulumi up -y
17 changes: 9 additions & 8 deletions examples/multiple_providers/justfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
set windows-shell := ["pwsh.exe", "-c"]
binary := "../../target/release/pulumi_wasm_runner"
wasm := "../../target/wasm32-wasip1/release/pulumi_wasm_example_multiple_providers.wasm"
pulumi_wasm := "../../target/wasm32-wasip1/release/pulumi_wasm.wasm"
docker := "../../target/wasm32-wasip1/release/pulumi_wasm_docker_provider.wasm"
random := "../../target/wasm32-wasip1/release/pulumi_wasm_random_provider.wasm"
wasm := "../../target/wasm32-wasip2/release/pulumi_wasm_example_multiple_providers.wasm"
pulumi_wasm := "../../target/wasm32-wasip2/release/pulumi_wasm.wasm"
docker := "../../target/wasm32-wasip2/release/pulumi_wasm_docker_provider.wasm"
random := "../../target/wasm32-wasip2/release/pulumi_wasm_random_provider.wasm"
TARGET_NAME := "wasm32-wasip2"

run:
{{binary}} run --pulumi-wasm "{{pulumi_wasm}}" --provider "docker={{docker}}" --provider "random={{random}}" "{{wasm}}"
Expand All @@ -16,10 +17,10 @@ local-test:
$PSNativeCommandUseErrorActionPreference = $true

cargo build -p pulumi_wasm_runner --release
cargo component build -p pulumi_wasm --release
cargo component build -p pulumi_wasm_example_multiple_providers --release
cargo component build -p pulumi_wasm_docker_provider --release
cargo component build -p pulumi_wasm_random_provider --release
cargo build -p pulumi_wasm --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_multiple_providers --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_docker_provider --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_random_provider --release --target={{TARGET_NAME}}
$env:PULUMI_CONFIG_PASSPHRASE=" "
pulumi destroy -y
pulumi up -y
13 changes: 7 additions & 6 deletions examples/simple/justfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
set windows-shell := ["pwsh.exe", "-c"]
binary := "../../target/release/pulumi_wasm_runner"
wasm := "../../target/wasm32-wasip1/release/pulumi_wasm_example_simple.wasm"
pulumi_wasm := "../../target/wasm32-wasip1/release/pulumi_wasm.wasm"
random := "../../target/wasm32-wasip1/release/pulumi_wasm_random_provider.wasm"
wasm := "../../target/wasm32-wasip2/release/pulumi_wasm_example_simple.wasm"
pulumi_wasm := "../../target/wasm32-wasip2/release/pulumi_wasm.wasm"
random := "../../target/wasm32-wasip2/release/pulumi_wasm_random_provider.wasm"
TARGET_NAME := "wasm32-wasip2"

run:
{{binary}} run --pulumi-wasm "{{pulumi_wasm}}" --provider "random={{random}}" "{{wasm}}"
Expand All @@ -15,9 +16,9 @@ local-test:
$PSNativeCommandUseErrorActionPreference = $true

cargo build -p pulumi_wasm_runner --release
cargo component build -p pulumi_wasm --release
cargo component build -p pulumi_wasm_example_simple --release
cargo component build -p pulumi_wasm_random_provider --release
cargo build -p pulumi_wasm --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_simple --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_random_provider --release --target={{TARGET_NAME}}
$env:PULUMI_CONFIG_PASSPHRASE=" "
pulumi destroy -y
pulumi up -y
34 changes: 15 additions & 19 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
set windows-shell := ["pwsh.exe", "-c"]
# renovate: datasource=crate depName=cargo-nextest packageName=cargo-nextest
NEXTEST_VERSION := "0.9.72"
# renovate: datasource=crate depName=cargo-component packageName=cargo-component
CARGO_COMPONENT_VERSION := "0.19.0"
# renovate: datasource=crate depName=sd packageName=sd
SD_VERSION := "1.0.0"
# renovate: datasource=crate depName=cargo-llvm-cov packageName=cargo-llvm-cov
CARGO_LLVM_COV_VERSION := "0.6.13"

TARGET_NAME := "wasm32-wasip2"

FORMATTABLE_PROJECTS := "-p pulumi_wasm -p pulumi_wasm_common -p pulumi_wasm_generator -p pulumi_wasm_generator_lib \
-p pulumi_wasm_runner -p pulumi_wasm_runner_component_creator -p pulumi_wasm_rust -p pulumi_wasm_rust_macro \
-p pulumi_wasm_example_dependencies -p pulumi_wasm_example_docker -p pulumi_wasm_example_multiple_providers \
Expand All @@ -19,7 +19,6 @@ build: build-language-plugin regenerate-providers install-requirements build-was

# https://stackoverflow.com/questions/74524817/why-is-anyhow-not-working-in-the-stable-version
fix-issues:
cargo component check --workspace
cargo check --workspace

build-language-plugin:
Expand All @@ -32,39 +31,36 @@ install-requirements:
rustup component add rustfmt
rustup component add llvm-tools-preview
cargo binstall --no-confirm cargo-nextest@{{NEXTEST_VERSION}}
cargo binstall --no-confirm cargo-component@{{CARGO_COMPONENT_VERSION}}
cargo binstall --no-confirm sd@{{SD_VERSION}}
cargo binstall --no-confirm cargo-llvm-cov@{{CARGO_LLVM_COV_VERSION}}

# Compiling everything together causes linking issues
build-wasm-components:
cargo component build -p pulumi_wasm --timings
cargo component build -p pulumi_wasm_example_simple --timings
cargo component build -p pulumi_wasm_example_docker --timings
cargo component build -p pulumi_wasm_example_dependencies --timings
cargo component build -p pulumi_wasm_example_multiple_providers --timings
cargo build -p pulumi_wasm --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_simple --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_docker --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_dependencies --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_multiple_providers --target={{TARGET_NAME}}
just build-wasm-providers
cargo build -p pulumi_wasm_runner --timings

build-all-wasm-projects-release:
just build-wasm-components-release
cargo build -p pulumi_wasm_runner --release
cargo component build -p pulumi_wasm_example_simple --release
cargo component build -p pulumi_wasm_example_docker --release
cargo component build -p pulumi_wasm_example_dependencies --release
cargo component build -p pulumi_wasm_example_multiple_providers --release
cargo build -p pulumi_wasm_example_simple --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_docker --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_dependencies --release --target={{TARGET_NAME}}
cargo build -p pulumi_wasm_example_multiple_providers --release --target={{TARGET_NAME}}

build-wasm-components-release:
cargo component build -p pulumi_wasm --timings --release
cargo build -p pulumi_wasm --timings --release --target={{TARGET_NAME}}
just build-wasm-providers-release

# DO NOT EDIT - BUILD-WASM-COMPONENTS - START
build-wasm-providers:
cargo component build \
-p pulumi_wasm_docker_provider \
-p pulumi_wasm_random_provider \
-p pulumi_wasm_cloudflare_provider \
--timings
cargo build --target={{TARGET_NAME}} -p pulumi_wasm_docker_provider
cargo build --target={{TARGET_NAME}} -p pulumi_wasm_random_provider
cargo build --target={{TARGET_NAME}} -p pulumi_wasm_cloudflare_provider

build-wasm-providers-release:
cargo component build \
Expand Down
12 changes: 1 addition & 11 deletions providers/pulumi_wasm_provider_cloudflare/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,5 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
wit-bindgen-rt.workspace = true
wit-bindgen.workspace = true
pulumi_wasm_common.workspace = true

[package.metadata.component]
package = "pulumi:cloudflare"

[package.metadata.component.target]
path = "wit"
world = "cloudflare-pulumi"

[package.metadata.component.target.dependencies]
"component:pulumi-wasm" = { path = "wit/deps/pulumi-wasm.wit" }
Loading

0 comments on commit 7baa75f

Please sign in to comment.