Skip to content

github actions: Use Cargo.toml and rust-toolchain.toml#85

Merged
mulkieran merged 2 commits into
stratis-storage:masterfrom
mulkieran:issue_project_819
May 18, 2026
Merged

github actions: Use Cargo.toml and rust-toolchain.toml#85
mulkieran merged 2 commits into
stratis-storage:masterfrom
mulkieran:issue_project_819

Conversation

@mulkieran
Copy link
Copy Markdown
Member

@mulkieran mulkieran commented May 16, 2026

@mulkieran mulkieran self-assigned this May 16, 2026
@mulkieran mulkieran moved this to In Progress in 2026May May 16, 2026
@packit-as-a-service
Copy link
Copy Markdown

Congratulations! One of the builds has completed. 🍾

You can install the built RPMs by following these steps:

  • sudo dnf install -y 'dnf*-command(copr)'
  • dnf copr enable packit/stratis-storage-loopdev-3-85-copr_pull
  • And now you can install the packages.

Please note that the RPMs should be used only in a testing environment.

@mulkieran mulkieran added this to the 0.5.4 milestone May 16, 2026
@mulkieran mulkieran changed the title Issue project 819 github actions: Use Cargo.toml and rust-toolchain.toml May 18, 2026
Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran force-pushed the issue_project_819 branch 4 times, most recently from aab8557 to 67f4426 Compare May 18, 2026 15:58
@mulkieran
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

Walkthrough

This PR updates Rust toolchain setup across CI/nightly workflows by introducing a centralized rust-toolchain.toml file specifying version 1.95.0 and replacing legacy toolchain actions with actions-rust-lang/setup-rust-toolchain@v1 in linting, dependency, and nightly build jobs.

Changes

Rust Toolchain Standardization Across CI/Nightly Workflows

Layer / File(s) Summary
Development toolchain version specification
rust-toolchain.toml
Introduces rust-toolchain.toml with [toolchain] section specifying Rust channel = "1.95.0" as the development toolchain.
CI workflow toolchain setup
\.github/workflows/ci\.yml
Replaces actions-rs/toolchain@v1 and dtolnay/rust-toolchain@master with actions-rust-lang/setup-rust-toolchain@v1 in the lints job (minimal profile) and dependencies job (cargo component only).
Nightly workflow toolchain setup
\.github/workflows/nightly\.yml
Replaces dtolnay/rust-toolchain@master with actions-rust-lang/setup-rust-toolchain@v1 (cargo component) in checks-with-ci-repo job and removes the rust-toolchain input pin from cargo-semver-checks-action configuration.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • stratis-storage/loopdev-3#68: Both PRs modify GitHub Actions workflow Rust toolchain setup/versioning in the same CI/nightly jobs.
  • stratis-storage/loopdev-3#73: Both PRs modify the same GitHub workflow Rust toolchain setup in .github/workflows/ci.yml and .github/workflows/nightly.yml.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly describes the main change: GitHub Actions workflows are being updated to use configuration from Cargo.toml and rust-toolchain.toml instead of hardcoded values.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@mulkieran mulkieran moved this from In Progress to In Review in 2026May May 18, 2026
@mulkieran
Copy link
Copy Markdown
Member Author

@coderabbitai review

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 18, 2026

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/nightly.yml (1)

53-55: ⚠️ Potential issue | 🟠 Major

Set rust-toolchain input explicitly or to manual.

The cargo-semver-checks-action@v2 does not respect rust-toolchain.toml when the rust-toolchain input is not provided. Instead, it installs and uses the latest stable Rust toolchain by default. Either specify the desired toolchain explicitly via the rust-toolchain input, or set it to manual if a Rust setup step precedes this action.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/nightly.yml around lines 53 - 55, The workflow uses
obi1kenobi/cargo-semver-checks-action@v2 without specifying the rust-toolchain
input; update the action invocation to add a rust-toolchain input (either an
explicit toolchain like "1.70.0" or "stable" or set rust-toolchain: manual if
you run a prior Rust setup step) so the action uses the intended toolchain
instead of installing latest stable by default.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ci.yml:
- Around line 86-88: In the actions-rust-lang/setup-rust-toolchain@v1 step, add
the rust-src-dir input set to loopdev-3 under the with: block so the action
looks for rust-toolchain.toml in the checked-out subdirectory and enables
correct caching; specifically update the setup-rust-toolchain step (uses:
actions-rust-lang/setup-rust-toolchain@v1) to include rust-src-dir: loopdev-3
alongside components: cargo with proper YAML indentation.

---

Outside diff comments:
In @.github/workflows/nightly.yml:
- Around line 53-55: The workflow uses obi1kenobi/cargo-semver-checks-action@v2
without specifying the rust-toolchain input; update the action invocation to add
a rust-toolchain input (either an explicit toolchain like "1.70.0" or "stable"
or set rust-toolchain: manual if you run a prior Rust setup step) so the action
uses the intended toolchain instead of installing latest stable by default.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 6b36b7c3-ca03-43fc-9dde-ae25cf521632

📥 Commits

Reviewing files that changed from the base of the PR and between e123e34 and 67f4426.

📒 Files selected for processing (3)
  • .github/workflows/ci.yml
  • .github/workflows/nightly.yml
  • rust-toolchain.toml

Comment thread .github/workflows/ci.yml Outdated
Comment on lines 86 to 88
- uses: actions-rust-lang/setup-rust-toolchain@v1
with:
components: cargo
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Check if actions-rust-lang/setup-rust-toolchain@v1 documents container support and rust-toolchain.toml detection

# Search for documentation about container usage and rust-toolchain.toml behavior
gh api repos/actions-rust-lang/setup-rust-toolchain/readme --jq '.content' | base64 -d | grep -i -A5 -B5 "container\|rust-toolchain"

Repository: stratis-storage/loopdev-3

Length of output: 1737


🏁 Script executed:

# Find rust-toolchain.toml location in the repo
find . -name "rust-toolchain.toml" -o -name "rust-toolchain"

Repository: stratis-storage/loopdev-3

Length of output: 91


🏁 Script executed:

# Check the full context around the job to understand working-directory usage
sed -n '67,100p' .github/workflows/ci.yml

Repository: stratis-storage/loopdev-3

Length of output: 1569


🌐 Web query:

actions-rust-lang/setup-rust-toolchain working directory container Fedora support

💡 Result:

The actions-rust-lang/setup-rust-toolchain GitHub Action is designed primarily for GitHub-hosted runners but is compatible with self-hosted runners and containerized environments, provided the necessary dependencies (such as curl, tar, and a shell) are available in the container [1][2]. Regarding your specific requirements: 1. Working Directory Support: The action supports projects where the Rust source code and rust-toolchain.toml file are located in a subdirectory rather than the repository root [3]. You can use the rust-src-dir input to specify the path to the directory containing your Rust source code [1][2]. This input also sets a default value for cache-workspaces, enabling proper caching for that directory [2][3]. 2. Container and Fedora Support: The action does not have specific restrictions against Fedora or other Linux distributions, provided the environment meets the basic requirements for running GitHub Actions and rustup [1][2]. When running jobs in a container (e.g., a Fedora-based Docker image), ensure that the container has the required system dependencies installed to support the action's execution [4]. If you encounter issues with environment variables (like PATH) not persisting, you may need to ensure that the container's shell configuration (e.g.,.bashrc) correctly sources the cargo environment or that the action's environment modifications are respected by your container's entrypoint [5]. In summary, you can use the action in a Fedora container by specifying the rust-src-dir if your project is in a subdirectory, and ensuring the container image includes the standard utilities required by GitHub Actions [1][2][3].

Citations:


Add rust-src-dir input to setup-rust-toolchain action.

The action looks for rust-toolchain.toml in the repository root, but the code is checked out to the loopdev-3 subdirectory (line 72). Without specifying rust-src-dir: loopdev-3, the action won't locate the toolchain file. This input also ensures proper caching for the subdirectory project.

Suggested fix
      - uses: actions-rust-lang/setup-rust-toolchain@v1
        with:
          components: cargo
          rust-src-dir: loopdev-3
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ci.yml around lines 86 - 88, In the
actions-rust-lang/setup-rust-toolchain@v1 step, add the rust-src-dir input set
to loopdev-3 under the with: block so the action looks for rust-toolchain.toml
in the checked-out subdirectory and enables correct caching; specifically update
the setup-rust-toolchain step (uses: actions-rust-lang/setup-rust-toolchain@v1)
to include rust-src-dir: loopdev-3 alongside components: cargo with proper YAML
indentation.

Use the values specified in these files to set toolchain versions in CI.

Do not do modifications to cross-compilation job. It is not clear what
changes will make it work; it is outside the scope of this change.

Signed-off-by: mulhern <amulhern@redhat.com>
@mulkieran mulkieran force-pushed the issue_project_819 branch from 67f4426 to bd1b12f Compare May 18, 2026 16:48
@mulkieran mulkieran merged commit 5775795 into stratis-storage:master May 18, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this from In Review to Done in 2026May May 18, 2026
@mulkieran mulkieran deleted the issue_project_819 branch May 18, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant