Skip to content

Add a rust-toolchain.toml for the rule-preprocessor - #288

Merged
nunoplopes merged 1 commit into
Cpp2Rust:masterfrom
FranciscoTGouveia:rust-toolchain-toml
Jul 25, 2026
Merged

Add a rust-toolchain.toml for the rule-preprocessor#288
nunoplopes merged 1 commit into
Cpp2Rust:masterfrom
FranciscoTGouveia:rust-toolchain-toml

Conversation

@FranciscoTGouveia

Copy link
Copy Markdown
Contributor

As this crate requires the rustc-dev component, which is not bundled by default, we need to add it explicitly.
Now, a user can just do cargo build on this crate.

Copilot AI review requested due to automatic review settings July 24, 2026 15:14

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a crate-local Rust toolchain override for rule-preprocessor so that developers can build it with cargo without first manually installing extra Rust components. This fits the codebase because rule-preprocessor uses rustc_private / rustc_* internals and therefore requires a nightly toolchain plus the rustc-dev component.

Changes:

  • Add rule-preprocessor/rust-toolchain.toml pinning a nightly toolchain.
  • Ensure rustc-dev is installed automatically via rustup when building from rule-preprocessor/.

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

Copilot AI review requested due to automatic review settings July 24, 2026 16:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@FranciscoTGouveia

Copy link
Copy Markdown
Contributor Author

In my machine, ninja format works just fine; although it seems weird for this to be a spurious failure...
Any ideas @lucic71?

@lucic71

lucic71 commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

In my machine, ninja format works just fine; although it seems weird for this to be a spurious failure...

Any ideas @lucic71?

See #287, it's fixed there

@FranciscoTGouveia

Copy link
Copy Markdown
Contributor Author

In my machine, ninja format works just fine; although it seems weird for this to be a spurious failure...
Any ideas @lucic71?

See #287, it's fixed there

Great, thanks!
I'll wait for #\287 to be merged then.

Comment thread rule-preprocessor/rust-toolchain.toml Outdated
@nunoplopes

Copy link
Copy Markdown
Contributor

What's the benefit of this PR?
It's yet another place to go out of sync.

After installing the desired nightly toolchain we set the pinned nightly
version, with the `rustc-dev` component as a directory override for the
rule-preprocessor crate.
Now, a user can just do `cargo build` on this crate.
Copilot AI review requested due to automatic review settings July 25, 2026 14:55
@FranciscoTGouveia

Copy link
Copy Markdown
Contributor Author

What's the benefit of this PR?

Currently, if we try to compile the rule-preprocessor as a standalone (i.e., without ninja build), it fails, as it does not know which toolchain to use; it needs nightly + the rustc-dev component.

It's yet another place to go out of sync.

I decided to solve this and directly implement the patch on CMakeLists.txt.
This way we never get out of sync, and we can compile the crate as a standalone, assuming we've run ninja build at least once first.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.

Comment thread CMakeLists.txt
@nunoplopes
nunoplopes merged commit 0faa092 into Cpp2Rust:master Jul 25, 2026
7 of 9 checks passed
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.

4 participants