Skip to content

Align rust version with CI image's Rust version #3105

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[toolchain]
channel = "1.81.0"
components = ["rust-src", "rust-analyzer"]
Copy link
Contributor

Choose a reason for hiding this comment

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

why do we need rust-analyzer?

Copy link
Member Author

Choose a reason for hiding this comment

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

rust-analyzer is not downloaded for any other version by default.
If this settings is not enabled, rust-analyzer wont work locally, as editor will try to load rust-analyzer for currently enabled rust version (if configured to use it).

Those who need it locally will need to run this command once in this repository:

rustup component add rust-analyzer

So, if larger population of devs dont need rust-analyzer locally, I can remove it.

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, I think I have never used rustup component add rust-analyzer, so now I think more we should not push local settings/setups to the git

Copy link
Member Author

Choose a reason for hiding this comment

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

This is only applicable if you are using version other than stable.
Even for nightly it will be required locally.
I will remove both component from this config, as both will be only required on local.
Only that, every developer working on this repository will need to add this line to satisfy IDE.

Copy link
Member Author

Choose a reason for hiding this comment

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

hmm, I think I have never used rustup component add rust-analyzer, so now I think more we should not push local settings/setups to the git

After thinking a bit, setting channel is also required for local setting only. as github CI, takes care of the version for git build.
So, basically these settings will help user with consistent build experience. What happens on CI can be reproduced locally.

Copy link
Collaborator

@serban300 serban300 Apr 10, 2025

Choose a reason for hiding this comment

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

I would also remove rust-analyzer from here if it's not needed in the CI. And I think we need to add rustfmt and clippy.

Also, to ensure that the CI image uses the same version as the one provided in our rust-toolchain.toml override, I think it would be good to have a test that checks if they are the same. We can get the override with rustup show active-toolchain |& tail -n 1 | cut -d " " -f1 and the CI default with rustup default | cut -d " " -f1

Loading