Skip to content

bevy lint fails badly on systems that have cranelift set up with a differing toolchain version #428

@janhohenheim

Description

@janhohenheim

I installed cranelift with rustup component add rustc-codegen-cranelift-preview --toolchain nightly

When I have the following in my ~/.cargo/config.toml:

[unstable]
codegen-backend = true

[profile.dev]
codegen-backend = "cranelift"

# compile deps with llvm still for runtime perf
[profile.dev.package."*"]
codegen-backend = "llvm"

I get the following on bevy lint:

error: failed to find a `codegen-backends` folder in the sysroot candidates:
       * /home/hhh/.rustup/toolchains/nightly-2025-04-03-x86_64-unknown-linux-gnu
       * /home/hhh/.rustup/toolchains/nightly-2025-04-03-x86_64-unknown-linux-gnu

error: could not compile `avian_derive` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...
error: could not compile `avian_derive` (lib) due to 1 previous error
Check failed: exit status: 101.
Error: command `/home/hhh/.cargo/bin/bevy_lint ` exited with status code exit status: 101

Solution

use rustup component add rustc-codegen-cranelift-preview --toolchain nightly-2025-04-03

Maybe this should be documented somewhere?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-LinterRelated to the linter and custom lintsC-DocsAn improvement in documentationC-UsabilityAn improvement that makes the API more pleasant

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions