Skip to content

feat(wasm-ci): make rustup target install configurable via wasm-target-install input#169

Closed
BimaPangestu28 wants to merge 1 commit into
mainfrom
feat/wasm-target-install-input
Closed

feat(wasm-ci): make rustup target install configurable via wasm-target-install input#169
BimaPangestu28 wants to merge 1 commit into
mainfrom
feat/wasm-target-install-input

Conversation

@BimaPangestu28
Copy link
Copy Markdown
Member

Summary

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 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 reusable wasm-component-ci.yml, defaulting to wasm32-wasip2 so every existing caller keeps working unchanged.

Why now

greentic-biz/greentic-bundle-extensions#26 is taking up the cards2pack-core empty-routing fix from greenticai/greentic-bundle#95. After bumping cards2pack-core and bundle-standard-core to 1.2.0-dev.25512130996, the dep tree pulls in:

bundle-standard-core 1.2.x → zip ^8 → typed-path ^0.12

typed-path 0.12.x uses feature(wasip2) stdlib APIs that aren't stable on wasm32-wasip2 under Rust stable:

error[E0658]: use of unstable library feature `wasip2`
  --> typed-path-0.12.3/src/lib.rs:3:57

The same crate compiles cleanly on wasm32-wasip1, and cargo-component already produces a Component Model artifact on wasip1 that wasmtime loads via the runtime's Component Model wrapper. reference-extensions/bundle-standard/build.sh has always emitted to wasm32-wasip1 — the CI/build mismatch only surfaced after this dep upgrade. PR #26 needs to set wasm-target-install: wasm32-wasip1 to align CI with the production build path.

What changed

  • .github/workflows/pr-ci.yml:
    • New input wasm-target-install (default wasm32-wasip2)
    • Replace hardcoded targets: wasm32-wasip2 (wasm job rustup install) with targets: ${{ inputs.wasm-target-install }}
  • .github/workflows/wasm-component-ci.yml:
    • Mirror the new input + thread it down to the pr-ci.yml call

Backward compatibility

Default value is wasm32-wasip2, so every existing caller — and every other reusable-workflow consumer in the org — gets identical behavior. Only callers that explicitly opt in via wasm-target-install: ... change their target install.

Test plan

  • YAML syntax check (python3 -c "import yaml; yaml.safe_load(...)")
  • After merge: rerun greentic-biz/greentic-bundle-extensions#26 CI — wasm job should pass with the wasip1 input override
  • Sanity sweep across other reusable-workflow consumers in the org — each should continue to install wasip2 unchanged (default preserved)

…t-install input

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).
@BimaPangestu28
Copy link
Copy Markdown
Member Author

Superseded by greenticai/greentic-bundle#96, which pins zip = "=7.1.0" to remove the transitive typed-path 0.12.x dependency at the source.

After #96 merges and stamps a new dev-publish version, greentic-biz/greentic-bundle-extensions#26 will re-pin to that version and drop its wasm32-wasip1 override — wasm32-wasip2 (the org-wide default) builds cleanly on stable Rust once the typed-path dep is gone.

No infrastructure change needed in this repo. Closing without merging.

@BimaPangestu28 BimaPangestu28 deleted the feat/wasm-target-install-input branch May 8, 2026 02:40
BimaPangestu28 added a commit to greenticai/greentic-bundle that referenced this pull request May 8, 2026
…ly requirement

zip 7.2.0+ added a transitive `typed-path ^0.12` dependency. typed-path
0.12.x uses `feature(wasip2)` stdlib APIs that fail on stable Rust under
the wasm32-wasip2 target. This blocked greentic-biz/greentic-bundle-extensions
PR #26 from taking up the cards2pack-core empty-routing fix from PR #95.

zip 7.1.0 is the most recent zip release before typed-path was introduced.
bundle-standard-core only uses minimal zip API (ZipWriter::new, FileOptions,
start_file, write_all, finish, ZipArchive::new) which is unchanged across
7.x. ZERO code change required, all 24 unit tests + 11 golden snapshot
tests pass, full WASM build via cargo-component succeeds for both
wasm32-wasip1 and wasm32-wasip2.

After this lands, downstream consumers (bundle-standard.wasm) can re-pin
to the next dev-publish stamp and inherit the fix transparently. The
org-wide wasip2 default in centralized CI workflows stays — no migration
churn, no fork maintenance.

Supersedes greenticai/.github#169 (which proposed adding a
wasm-target-install input as a workaround); that PR was closed in
favor of this upstream pin fix.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant