Skip to content
This repository was archived by the owner on Apr 15, 2026. It is now read-only.
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

Closed

Description

@nazar-pc

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

Activity

  1. Firestar99 commented on Feb 10, 2026

    @Firestar99
    Member

    (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.

  2. nazar-pc commented on Feb 10, 2026

    @nazar-pc
    ContributorAuthor

    I certainly do not install nightly-2025-06-30 manually 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

  3. Firestar99 commented on Feb 10, 2026

    @Firestar99
    Member

    Very curious, # are my comments:

    --- 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.

  4. nazar-pc commented on Feb 10, 2026

    @nazar-pc
    ContributorAuthor

    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.

  5. Firestar99 commented on Feb 10, 2026

    @Firestar99
    Member

    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

  6. Firestar99 commented on Feb 10, 2026

    @Firestar99
    Member

    @nazar-pc please test cargo-gpu main, also includes the spirv-builder update

  7. nazar-pc commented on Feb 11, 2026

    @nazar-pc
    ContributorAuthor

    Worked great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions