From 02b0dc477439ea3339a9ef991677e622a6c3d9af Mon Sep 17 00:00:00 2001 From: bimapangestu28 Date: Fri, 8 May 2026 08:13:34 +0700 Subject: [PATCH] feat(wasm-ci): make rustup target install configurable via wasm-target-install input MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The wasm job's rustup target install was hardcoded to wasm32-wasip2, but the surrounding cargo args (wasm-check-args, wasm-build-args, wasm-validate-glob) are all input-controllable. Callers that override the target on those args still picked up the wasip2 toolchain — the build then failed with E0463 ("can't find crate for `core`") because the cargo --target requested a target the toolchain didn't install. This adds a `wasm-target-install` input on both `pr-ci.yml` and the parent `wasm-component-ci.yml`, with default `wasm32-wasip2` to keep every existing caller working unchanged. Callers that build for wasip1 (e.g., greentic-bundle-extensions, where bundle-standard-core 1.2.x pulls zip ^8 → typed-path ^0.12 which has unstable wasip2 stdlib usage) can now set: wasm-target-install: wasm32-wasip1 wasm-check-args: --target wasm32-wasip1 wasm-build-args: --target wasm32-wasip1 --release wasm-validate-glob: target/wasm32-wasip1/release/*.wasm without forking the workflow. Triggered by greentic-biz/greentic-bundle-extensions#26 (uptake of greenticai/greentic-bundle PR #95 cards2pack-core routing fix). --- .github/workflows/pr-ci.yml | 6 +++++- .github/workflows/wasm-component-ci.yml | 5 +++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pr-ci.yml b/.github/workflows/pr-ci.yml index edf80cf..d188620 100644 --- a/.github/workflows/pr-ci.yml +++ b/.github/workflows/pr-ci.yml @@ -70,6 +70,10 @@ on: description: "Glob pattern for .wasm files to validate" type: string default: "target/wasm32-wasip2/release/*.wasm" + wasm-target-install: + description: "Rust target to install for the wasm job (e.g., wasm32-wasip1, wasm32-wasip2). Must match the target referenced in wasm-check-args / wasm-build-args / wasm-validate-glob." + type: string + default: "wasm32-wasip2" # ── dependency-review inputs (DEPRECATED no-ops) ──────────────── # Dependency review moved out of this reusable to avoid the graph-time # permission cap issue (see header). These inputs are retained as @@ -257,7 +261,7 @@ jobs: - uses: dtolnay/rust-toolchain@stable with: toolchain: ${{ inputs.rust-version }} - targets: wasm32-wasip2 + targets: ${{ inputs.wasm-target-install }} - uses: Swatinem/rust-cache@v2 - if: inputs.setup-script != '' run: ${{ inputs.setup-script }} diff --git a/.github/workflows/wasm-component-ci.yml b/.github/workflows/wasm-component-ci.yml index bce2e90..4a8bbc0 100644 --- a/.github/workflows/wasm-component-ci.yml +++ b/.github/workflows/wasm-component-ci.yml @@ -51,6 +51,10 @@ on: description: "Glob pattern for .wasm files to validate" type: string default: "target/wasm32-wasip2/release/*.wasm" + wasm-target-install: + description: "Rust target to install for the wasm job (e.g., wasm32-wasip1, wasm32-wasip2). Must match the target referenced in wasm-check-args / wasm-build-args / wasm-validate-glob." + type: string + default: "wasm32-wasip2" toolchain-variant: description: "Canonical toolchain variant (host or wasm) for drift check" type: string @@ -80,3 +84,4 @@ jobs: wasm-build-args: ${{ inputs.wasm-build-args }} validate-component: ${{ inputs.validate-component }} wasm-validate-glob: ${{ inputs.wasm-validate-glob }} + wasm-target-install: ${{ inputs.wasm-target-install }}