rust-lang / rust-lang/rust

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

Open
#135,300 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-discussion D-confusing T-bootstrap
Dominant language
Rust
Stars
119k
Forks
16.1k
PR merge metrics
PR metrics pending

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report names ~/.cargo/config.toml and the ./x doc library/core entry point; begin by reproducing with download-rustc after removing build/. Compare the failing configuration with the version where profile.dev.codegen-backend is commented out. Done means the bootstrap failure explains the configuration issue clearly instead of only reporting a missing codegen-backends folder.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
build-system, compilers
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.