sc-meta install wasm32 --toolchain CLI#2361
Merged
andrei-marinica merged 4 commits intorc/v0.66from Apr 30, 2026
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds support for selecting a Rust toolchain when running sc-meta install wasm32, while refactoring wasm target installation utilities from the former build_target area into install_wasm_target.
Changes:
- Add
--toolchainoption tosc-meta install wasm32and plumb it into the install flow. - Introduce
RustcVersion::{from_opt_toolchain, from_toolchain}and update config parsing to use the new API. - Add
install_all_wasm32_targets()helper and update contract build/install code to usetools::install_wasm_target.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| framework/meta/src/cmd/install.rs | Uses toolchain-aware RustcVersion and delegates wasm target installation to meta-lib. |
| framework/meta/src/cli/cli_args_standalone.rs | Adds --toolchain option to install wasm32 CLI args. |
| framework/meta-lib/src/tools/rustc_version.rs | Adds APIs to construct RustcVersion from a rustup toolchain name. |
| framework/meta-lib/src/tools/install_wasm_target.rs | Adds install_all_wasm32_targets() wrapper. |
| framework/meta-lib/src/tools.rs | Exposes install_wasm_target module and continues to re-export RustcVersion. |
| framework/meta-lib/src/contract/sc_config/wasm_build.rs | Switches wasm target install/check calls to install_wasm_target. |
| framework/meta-lib/src/contract/sc_config/contract_variant_settings.rs | Switches default wasm target selection to install_wasm_target. |
| framework/meta-lib/src/contract/sc_config/contract_variant_builder.rs | Switches rustc version parsing to from_opt_toolchain(...). |
Comments suppressed due to low confidence (1)
framework/meta-lib/src/tools/install_wasm_target.rs:89
install_all_wasm32_targetsdecides whether to installwasm32v1-noneusingis_wasm32v1_available(), which checks the compile-time rustc version viarustc_version::version_meta(). When a specificrustc_version/toolchain is passed in (e.g. viasc-meta install wasm32 --toolchain ...), this can incorrectly attempt to installwasm32v1-nonefor toolchains < 1.85. Consider making the availability check depend on the providedrustc_version(e.g. comparerustc_version.version_meta.semveragainstFIRST_RUSTC_VERSION_WITH_WASM32V1_TARGET) and only fall back toversion_meta()when no toolchain is specified.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Contract comparison - from da2bec5 to 7fe376c
|
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.
Pull request overview
Adds support for selecting a Rust toolchain when running
sc-meta install wasm32, while refactoring wasm target installation utilities from the formerbuild_targetarea intoinstall_wasm_target.Changes:
--toolchainoption tosc-meta install wasm32and plumb it into the install flow.RustcVersion::{from_opt_toolchain, from_toolchain}and update config parsing to use the new API.install_all_wasm32_targets()helper and update contract build/install code to usetools::install_wasm_target.