Skip to content

Enforce correct Rust versions#43

Open
xarantolus wants to merge 4 commits intomainfrom
fix/rust-version
Open

Enforce correct Rust versions#43
xarantolus wants to merge 4 commits intomainfrom
fix/rust-version

Conversation

@xarantolus
Copy link
Copy Markdown
Contributor

This PR creates a Rust toolchain file that is used as source of truth of Rust toolchains we need (in addition to the host one, and the nightly one downloaded by kani).

This ensures that everyone uses the same Rust version, as some branches already use 1.94 features, which gives very confusing build errors if you're on an older version.

Note that this will not work in CI for now due to some macros that intentionally fail compilation on 1.94 - the only thing we should care about is whether the container builds.

Fixes osiris#16 (gitlab)

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a pinned Rust toolchain definition and wires the devcontainer/CI container build to use it so developers and automation build with a consistent Rust version.

Changes:

  • Add rust-toolchain.toml pinning Rust 1.94.0 plus required components/targets.
  • Update CI container build to use repo-root build context (so the toolchain file can be copied into the image).
  • Update devcontainer Dockerfile to install Rust based on rust-toolchain.toml rather than a hardcoded RUST_VERSION.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
rust-toolchain.toml Introduces the pinned Rust channel and required components/targets.
.github/workflows/ci.yml Builds the devcontainer image from repo root context so the toolchain file is available during build.
.devcontainer/Dockerfile Copies the toolchain file into the image and installs Rust accordingly; minor whitespace fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -0,0 +1,4 @@
[toolchain]
channel = "1.94.0"
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

Pinning the toolchain to Rust 1.94.0 will make the workspace fail to compile because xtasks/crates/config/src/lib.rs contains #[rustversion::since(1.94)] compile_error!(...) (lines 154-155). Either lower the pinned toolchain below 1.94 for now, or remove/resolve that compile_error! gate before enforcing 1.94 via rust-toolchain.toml.

Suggested change
channel = "1.94.0"
channel = "1.93.0"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think we should merge this once the other branch that fixes this is merged

uses: docker/build-push-action@v2
with:
context: .devcontainer
context: .
Copy link

Copilot AI Mar 31, 2026

Choose a reason for hiding this comment

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

With context: ., the container build will now pick up rust-toolchain.toml and install Rust 1.94; the workflow then runs just config/just cov, which compile cargo xtask and will hit the unconditional compile_error! for Rust >= 1.94 in xtasks/crates/config/src/lib.rs (154-155). This change will make CI fail unless that gate is removed or the pinned toolchain stays < 1.94.

Suggested change
context: .
context: .devcontainer

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

With context: ., the container build will now pick up rust-toolchain.toml and install Rust 1.94

That is the point of the PR, yes....

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.

2 participants