fix(sync-plugin): skip wasm32-wasip2 fixture build when target is not installed#544
Open
fix(sync-plugin): skip wasm32-wasip2 fixture build when target is not installed#544
Conversation
…builds Fixes #543 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…builds CARGO_CFG_TEST is not set by Cargo for build scripts, so instead gate the fixture build on whether the wasm32-wasip2 target is installed (checked via rustc sysroot). Fixture-dependent tests use option_env! and return early when the fixture was not built, so they compile and pass on machines without the wasm32-wasip2 target. Fixes #543 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
adamspofford-dfinity
approved these changes
May 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
build.rs, gatesbuild_test_fixture()behind a check that thewasm32-wasip2target is actually installed (viarustc --print sysroot).CARGO_CFG_TESTwas not viable — Cargo does not set it for build scripts.runtime.rs, switchesenv!("TEST_PLUGIN_WASM")→option_env!with an early return, so fixture-dependent tests compile and skip gracefully when the fixture was not built.Fixes #543
Behavior
cargo buildcargo testwasm32-wasip2(e.g. Homebrew)wasm32-wasip2(dev / CI)Test plan
cargo build -p icp-sync-pluginsucceeds withoutwasm32-wasip2target installedcargo test -p icp-sync-plugin --libpasses (fixture tests skip when target absent, run when present)🤖 Generated with Claude Code