Skip to content
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

Update Rust toolchain version? #837

Closed
smoelius opened this issue Sep 13, 2023 · 4 comments
Closed

Update Rust toolchain version? #837

smoelius opened this issue Sep 13, 2023 · 4 comments

Comments

@smoelius
Copy link
Collaborator

Copied from rust-lang/rust-clippy#11490:

I am using the clippy_utils crate for developing dylint programs. I need to add the clippy_utils that matches the toolchain I am using (currently 1.74.0-nightly) to my Cargo.toml as a lib dependency. I can’t add this dependency from the rust repository because the repository is too big, so I have to use a version from the rust-clippy repository.

Originally posted by @EFanZh in rust-lang/rust-clippy#11490 (comment)

@smoelius
Copy link
Collaborator Author

I need to add the clippy_utils that matches the toolchain I am using (currently 1.74.0-nightly)

Sorry, does that mean you're using the latest nightly?

We recommend pinning to a specific date, to avoid the kinds of problems you seem to be describing (example).

Is there a reason why that strategy wouldn't work for you? (Or have I misunderstood your problem?)

@EFanZh
Copy link
Contributor

EFanZh commented Sep 13, 2023

No, we do pin the Rust toolchain version, but the version we need have to be at least nightly-2023-09-10. Because there are some compiler features that our project requires, that have just been added to the compiler.

@smoelius
Copy link
Collaborator Author

smoelius commented Sep 13, 2023

OK. (Sorry for misunderstanding.)

I can see three possible courses of action.

  1. Wait until the next Rust-Clippy sync. Like Alexandoo said, they happen every two weeks, and here was the last one: Rustup rust-lang/rust-clippy#11469 So I would expect the next to be sometime mid next week.

  2. Fork Clippy, apply the updates yourself, and use that fork (at least until Clippy is updated).

  3. To my amazement(!), you can use the Rust repo as the source for clippy_utils, e.g.:

clippy_utils = { git = "https://github.com/rust-lang/rust", rev = "8ed4537d7" }

That commit came from rustc --version, e.g.:

$ rustc --version
rustc 1.74.0-nightly (8ed4537d7 2023-09-09)

Note that it takes a looong time for Cargo to download Rust as a dependency. But it's a onetime cost, and it's probably quicker than applying the updates yourself as in option 2.

EDIT: "looong time" = tens of minutes, in my case.

@EFanZh
Copy link
Contributor

EFanZh commented Sep 14, 2023

I think I’ll wait 7 days for the next sync. Thank you for your help!

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

No branches or pull requests

2 participants