Skip to content

using ~/.cargo/config.toml to enable cranelift results in a confusing error when bootstrapping rustc #135300

Open
@lolbinarycat

Description

@lolbinarycat

the offending config:

# .cargo/config.toml
unstable.codegen-backend = true
# commenting out the following line will allow rustc to bootstrap successfully
profile.dev.codegen-backend = "cranelift"

the errror:

error: failed to find a `codegen-backends` folder in the sysroot candidates:
       * /home/binarycat/src/rs/rust/build/x86_64-unknown-linux-gnu/stage0
       * /home/binarycat/src/rs/rust/build/x86_64-unknown-linux-gnu/stage0

reproduction steps:

  1. enable download-rustc
  2. remove all of build/
  3. ./x doc library/core (probably any build command works)

there's a lot of workarounds for this, but i was only able to diagnose it on a hunch, so at the very least the error message should be more clear.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-discussionCategory: Discussion or questions that doesn't represent real issues.D-confusingDiagnostics: Confusing error or lint that should be reworked.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions