Skip to content

Fix Rust release workflow toolchain#314

Closed
vinitkumar wants to merge 1 commit into
masterfrom
fix/rust-release-toolchain
Closed

Fix Rust release workflow toolchain#314
vinitkumar wants to merge 1 commit into
masterfrom
fix/rust-release-toolchain

Conversation

@vinitkumar
Copy link
Copy Markdown
Owner

@vinitkumar vinitkumar commented Jun 5, 2026

Summary

  • install Rust 1.96.0 explicitly in the Rust wheel release workflow
  • install the same Rust toolchain in Rust CI
  • switch Rust CI unit tests to the fixed plain cargo test path
  • document that CI and release workflows use the pinned Rust toolchain

Why

The rust-v0.3.0 release workflow failed because GitHub-hosted runners defaulted to rustc 1.95.0, while json2xml_rs 0.3.0 correctly requires rustc 1.96. The release workflow needs to install the crate's pinned toolchain before maturin builds wheels.

Validation

  • cargo fmt --check
  • cargo test: 46 passed
  • lat check: passed

Summary by Sourcery

Pin the Rust toolchain version in CI and release workflows to ensure consistent builds and tests with the crate’s required compiler version.

Build:

  • Update Rust wheel and sdist build workflows to install a pinned Rust 1.96.0 toolchain before running maturin.

CI:

  • Configure Rust CI workflows to install a pinned Rust 1.96.0 toolchain and run unit tests with plain cargo test.

Documentation:

  • Document that CI and release workflows install the pinned Rust toolchain to avoid using older default compilers.

@sourcery-ai
Copy link
Copy Markdown
Contributor

sourcery-ai Bot commented Jun 5, 2026

Reviewer's Guide

Pins the Rust toolchain version (1.96.0) across Rust wheel build and CI workflows, ensures those workflows install that toolchain explicitly before builds/tests, aligns CI tests with the default cargo test invocation, and documents the behavior in the architecture docs.

Flow diagram for pinned Rust toolchain in CI and release workflows

flowchart TD
  subgraph Release_Workflow
    REnv[Set env RUST_VERSION=1.96.0]
    RInstall[Install Rust using setup-rust-toolchain with toolchain=RUST_VERSION]
    RMaturin[Run maturin-action Build wheels]

    REnv --> RInstall --> RMaturin
  end

  subgraph CI_Workflow
    CIEnv[Set env RUST_VERSION=1.96.0]
    CIInstallLint[Install Rust with toolchain=RUST_VERSION and components rustfmt, clippy]
    CILint[Run cargo fmt and cargo clippy]
    CIInstallTest[Install Rust with toolchain=RUST_VERSION]
    CITest[Run cargo test]

    CIEnv --> CIInstallLint --> CILint
    CIEnv --> CIInstallTest --> CITest
  end

  REnv -. shares RUST_VERSION .- CIEnv
Loading

File-Level Changes

Change Details Files
Pin Rust toolchain version for Rust wheel release workflow and install it explicitly before building wheels and sdist.
  • Add RUST_VERSION environment variable to the build-rust-wheels workflow
  • Insert setup-rust-toolchain steps that install the specified Rust version before each maturin wheel build job
  • Ensure the sdist job also installs the pinned Rust toolchain prior to running maturin
.github/workflows/build-rust-wheels.yml
Align Rust CI with pinned toolchain and standardize unit test command.
  • Add RUST_VERSION environment variable to the Rust CI workflow and pass it as the toolchain to setup-rust-toolchain steps
  • Update all Rust installation steps in CI to use the pinned toolchain
  • Change the unit test step to use plain cargo test instead of cargo test --no-default-features
.github/workflows/rust-ci.yml
Document the pinned Rust toolchain usage in CI and release workflows.
  • Extend architecture documentation to state that CI and release workflows install the pinned Rust toolchain before Rust builds and checks
lat.md/architecture.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • The Rust toolchain installation step is duplicated several times in build-rust-wheels.yml; consider extracting it into a reusable YAML anchor or composite action to keep the workflow DRY and easier to update when the toolchain changes.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The Rust toolchain installation step is duplicated several times in `build-rust-wheels.yml`; consider extracting it into a reusable YAML anchor or composite action to keep the workflow DRY and easier to update when the toolchain changes.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@vinitkumar vinitkumar closed this Jun 5, 2026
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