Skip to content

Suggest x build library for a custom toolchain that fails to load core  #113222

@jyn514

Description

@jyn514

Code

x build std --target x86_64-unknown-linux-gnu
cd ../example
cargo +stage1 build --target i686-unknown-linux-gnu

Current output

error[E0463]: can't find crate for `core`
  = help: consider downloading the target with `rustup target add i686-unknown-linux-gnu`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

Desired output

error[E0463]: can't find crate for `core`
  = help: consider adding the standard library to the sysroot with `x build library --target i686-unknown-linux-gnu`
  = help: consider building the standard library from source with `cargo build -Zbuild-std`

Rationale and extra context

rustup doesn't manage targets and components for custom toolchains. We can detect in rustc that this is a custom toolchain by checking env!("CFG_RELEASE_CHANNEL") == "dev" and changing the help output if so.

Other cases

No response

Anything else?

cc https://discord.com/channels/442252698964721669/1124482842051747860

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lintsA-resolveArea: Name/path resolution done by `rustc_resolve` specificallyE-mediumCall for participation: Medium difficulty. Experience needed to fix: Intermediate.T-bootstrapRelevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions