You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Repository navigation
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
Install Clippy for a custom toolchain if missing #136
It already works for normal compilation, but after Rust-GPU/rust-gpu#505 I'd like to see a similar feature being implemented for clippy since right now it fails something like this:
error: 'cargo-clippy' is not installed for the toolchain 'nightly-2025-06-30-aarch64-apple-darwin'.
To install, run rustup component add --toolchain nightly-2025-06-30-aarch64-apple-darwin clippy
Error: BuildFailed
(Since cargo-gpu takes care of toolchain installation, I moved it over)
I double checked our code and it:
checks whether the toolchain is installed
if it is not:
installs the toolchain with the default profile, which includes clippy
installs extra components
We should probably check whether all components were installed of a set toolchain, and not just that you have the toolchain. And while I'm at it, we can merge the two install actions into one command, since rustup toolchain install accepts -c --components.
But apart from that, I don't see how you could end up in a situation where clippy is actually missing, except if you've ever manually ran rustup toolchain install nightly-2025-06-30-aarch64-apple-darwin --profile minimal explicitly with the minimal profile, since the default one includes clippy.
--- stderr
# this is the first command which *should* be `rustup toolchain add nightly-2025-06-30`
info: syncing channel updates for 'nightly-2025-06-30-x86_64-unknown-linux-gnu'
info: latest update on 2025-06-30, rust version 1.90.0-nightly (35f603652 2025-06-29)
info: downloading component 'cargo'
info: downloading component 'rust-std'
info: downloading component 'rustc'
info: installing component 'cargo'
info: installing component 'rust-std'
info: installing component 'rustc'
# this is the second command which *should* be `rustup components add --toolchain nightly-2025-06-30 rust-src rustc-dev llvm-tools`
info: downloading component 'rust-src'
info: installing component 'rust-src'
info: downloading component 'rustc-dev'
info: installing component 'rustc-dev'
info: downloading component 'llvm-tools'
info: installing component 'llvm-tools'
# and we start building `rustc_codegen_spirv`
Updating git repository `[https://github.com/Rust-GPU/rust-gpu//`](https://github.com/Rust-GPU/rust-gpu//%60)
Updating crates.io index
But notice how the first command only installed cargo,rust-std,rustc and is missing clippy? I can only reproduce this behavior if I additionally pass --profile minimal, and cargo-gpu source code is definitely not passing that. I wonder if there's some env var that changes the default profile from "default" to "minimal"? Neither rustup docs on profiles nor env vars don't mention anything, nor does github show any special env vars being passed.
I think GitHub Actions might be installing minimal by default, which forces everything downstream to be minimal as well.
Since not everyone might be using clippy with rust-gpu either, do you think installing clippy explicitly on demand makes sense? Otherwise I'd add a clippy component explicitly (no need for rustfmt or rust-docs to be installed for rust-gpu's toolchain). In that case I'd actually say --profile minimal would be preferred.
I'm currently working on a PR to refactor our toolchain installation, planning to use --profile minimal and explicitly add clippy to the component list (removing rust-docs and rustfmt). Give me an hour or so
Activity
Firestar99 commentedon Feb 10, 2026
(Since cargo-gpu takes care of toolchain installation, I moved it over)
I double checked our code and it:
We should probably check whether all components were installed of a set toolchain, and not just that you have the toolchain. And while I'm at it, we can merge the two install actions into one command, since
rustup toolchain installaccepts-c --components.But apart from that, I don't see how you could end up in a situation where clippy is actually missing, except if you've ever manually ran
rustup toolchain install nightly-2025-06-30-aarch64-apple-darwin --profile minimalexplicitly with the minimal profile, since the default one includes clippy.nazar-pc commentedon Feb 10, 2026
I certainly do not install
nightly-2025-06-30manually in CI and do not cache the corresponding directory either.Here is an example CI run where you can also see the exact workflow that was used: https://github.com/nazar-pc/abundance/actions/runs/21829789170/job/62984572278
Firestar99 commentedon Feb 10, 2026
Very curious,
#are my comments:But notice how the first command only installed
cargo,rust-std,rustcand is missingclippy? I can only reproduce this behavior if I additionally pass--profile minimal, and cargo-gpu source code is definitely not passing that. I wonder if there's some env var that changes the default profile from "default" to "minimal"? Neither rustup docs on profiles nor env vars don't mention anything, nor does github show any special env vars being passed.nazar-pc commentedon Feb 10, 2026
I think GitHub Actions might be installing
minimalby default, which forces everything downstream to beminimalas well.Since not everyone might be using clippy with rust-gpu either, do you think installing
clippyexplicitly on demand makes sense? Otherwise I'd add aclippycomponent explicitly (no need forrustfmtorrust-docsto be installed for rust-gpu's toolchain). In that case I'd actually say--profile minimalwould be preferred.Firestar99 commentedon Feb 10, 2026
I'm currently working on a PR to refactor our toolchain installation, planning to use
--profile minimaland explicitly addclippyto the component list (removingrust-docsandrustfmt). Give me an hour or soFirestar99 commentedon Feb 10, 2026
@nazar-pc please test cargo-gpu main, also includes the spirv-builder update
nazar-pc commentedon Feb 11, 2026
Worked great, thanks!