Skip to content

Pin the Rust toolchain with a rust-toolchain.toml #13

Description

@priscaenoch

Problem

The repository has no rust-toolchain.toml, so builds use whatever Rust version is installed. This is unusually risky here because the README documents a hard toolchain constraint: these contracts pin soroban-sdk 21, whose VM rejects the WebAssembly reference-types and multivalue features, while Rust 1.82 and later emit those features into every wasm it builds — including the standard library — and -C target-feature=-reference-types does not reliably remove them. The project works around this with a wasm-opt lowering step in build-and-deploy.sh.

Without a pinned toolchain, contributors and CI can silently produce a wasm that fails deployment for reasons unrelated to their change, and the required wasm32-unknown-unknown target is not declared anywhere.

What needs to be done

  • Add a rust-toolchain.toml at the repository root pinning the channel and declaring targets = ["wasm32-unknown-unknown"] and the components used (rustfmt, clippy).
  • Verify the pinned toolchain builds both crates and that the wasm-opt lowering step still produces a deployable artifact.
  • Reference the pinned toolchain in the README build notes and in the CI workflow.

Files

  • new rust-toolchain.toml
  • README.md
  • .github/workflows/ci.yml

Acceptance deliverables

  • A fresh clone builds with the pinned toolchain and no manual rustup steps.
  • CI uses the same toolchain as local development.

Tests to pass

  • cargo build --release --target wasm32-unknown-unknown succeeds for both crates on the pinned toolchain.
  • The resulting wasm deploys successfully after the documented wasm-opt step.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignenhancementNew feature or request

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions