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

cargo-sweep should ignore custom toolchains #65

Closed
jyn514 opened this issue Jan 14, 2022 · 1 comment · Fixed by #67
Closed

cargo-sweep should ignore custom toolchains #65

jyn514 opened this issue Jan 14, 2022 · 1 comment · Fixed by #67

Comments

@jyn514
Copy link
Collaborator

jyn514 commented Jan 14, 2022

I installed a custom version of rust from source (with x.py) and then cleaned the target directory. Now cargo sweep -i doesn't work. Instead of giving a hard error, it should just skip custom toolchains and continue sweeping all others.

$ cargo sweep -i
[INFO] Using all installed toolchains: ["stable-x86_64-unknown-linux-gnu", "beta-x86_64-unknown-linux-gnu", "nightly-2021-07-17-x86_64-unknown-linux-gnu", "nightly-2021-07-19-x86_64-unknown-linux-gnu", "nightly-2021-07-23-x86_64-unknown-linux-gnu", "nightly-2021-12-30-x86_64-unknown-linux-gnu", "nightly-x86_64-unknown-linux-gnu", "1.42-x86_64-unknown-linux-gnu", "1.43-x86_64-unknown-linux-gnu", "1.44-x86_64-unknown-linux-gnu", "1.45-x86_64-unknown-linux-gnu", "1.47-x86_64-unknown-linux-gnu", "1.50-x86_64-unknown-linux-gnu", "1.51-x86_64-unknown-linux-gnu", "1.54-x86_64-unknown-linux-gnu", "1.57-x86_64-unknown-linux-gnu", "wasi", "1.46.0-x86_64-unknown-linux-gnu", "1.49.0-x86_64-unknown-linux-gnu", "1.53.0-x86_64-unknown-linux-gnu", "1.55.0-x86_64-unknown-linux-gnu"]
[ERROR] Failed to clean "/home/jnelson/redacted/target": 
$ cargo +wasi -vV
error: toolchain 'wasi' is not installed
$ rustup toolchain list -v | grep -v -
wasi	/home/jnelson/src/rust/out
@jyn514
Copy link
Collaborator Author

jyn514 commented Jan 14, 2022

I just checked and rustup prevents you from naming custom toolchains things that could be a version number:

$ rustup toolchain link 1.52.0 /home/jnelson/rust-lang/rust/out
error: invalid custom toolchain name: '1.52.0-x86_64-unknown-linux-gnu'
$ rustup toolchain link beta /home/jnelson/rust-lang/rust/out
error: invalid custom toolchain name: 'beta-x86_64-unknown-linux-gnu'
$ rustup toolchain link stable /home/jnelson/rust-lang/rust/out
error: invalid custom toolchain name: 'stable-x86_64-unknown-linux-gnu'
$ rustup toolchain link nightly /home/jnelson/rust-lang/rust/out
error: invalid custom toolchain name: 'nightly-x86_64-unknown-linux-gnu'

So it should be possible to tell if toolchains are custom by seeing if they match \d+\.\d+(:?\.\d+).* or stable/beta/nightly or not.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant