Skip to content

fix check rustup on default toolchain #1682

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

Closed
wants to merge 1 commit into from

Conversation

fraidev
Copy link

@fraidev fraidev commented May 21, 2025

Seems that any cross command is trying to add a rustup toolchain even if is already installed.

I checked that was just checking the rustup --quiet toolchain list command and comparing each one, but this check will not work for the active one with (active, default).

Example:

▷ rustup --quiet toolchain list
stable-aarch64-apple-darwin (active, default)
stable-x86_64-unknown-linux-gnu
nightly-aarch64-apple-darwin
nightly-2024-10-31-aarch64-apple-darwin
1.72.0-aarch64-apple-darwin
1.74.0-aarch64-apple-darwin
1.75.0-aarch64-apple-darwin
1.78.0-aarch64-apple-darwin
1.79.0-aarch64-apple-darwin
1.80.0-aarch64-apple-darwin
1.81.0-aarch64-apple-darwin
1.82.0-aarch64-apple-darwin
1.83.0-aarch64-apple-darwin
1.84.0-aarch64-apple-darwin
1.85.0-aarch64-apple-darwin
1.86.0-aarch64-apple-darwin

I needed this fix because setuptools-rust calls cargo/cross metadata and convert it to json, but I was always getting it before the json expected:

stable-x86_64-unknown-linux-gnu unchanged - rustc 1.87.0 (17067e9ac 2025-05-09)

@fraidev fraidev marked this pull request as ready for review May 21, 2025 06:29
@fraidev fraidev requested a review from a team as a code owner May 21, 2025 06:29
@reneleonhardt
Copy link
Contributor

reneleonhardt commented May 21, 2025

@fraidev doesn't #1681 solve your problem?

rustup toolchain list --quiet

@fraidev
Copy link
Author

fraidev commented May 22, 2025

@fraidev doesn't #1681 solve your problem?

rustup toolchain list --quiet

Oh, great! Yeah, that should also fix it.

I don't know if my solution is needed then, maybe just to make it safest.

@reneleonhardt
Copy link
Contributor

You could just try main first if you still see any problems for your use case 🙂

@reneleonhardt
Copy link
Contributor

@fraidev please make sure to use a current rustup release >= 1.28.0.

I had to rewrite my fix to support legacy rustup versions 🤕 #1683

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