Skip to content

Fail early when trying to build for an unavailable target #13423

Open
@rivnakm

Description

@rivnakm

Problem

If trying to build for a target, wasm32-unknown-unknown, for example, and the target is not installed with rustup, cargo will still attempt to build and throw lots of errors which don't have an obvious cause. These are rustc mostly being unable to find items from the standard library.

Proposed Solution

It would be helpful for cargo to check that the correct target toolchain is available and provide and appropriate error message.

Notes

I imagine this isn't an issue for no_std crates, but since that is resolved at the crate level beforehand it should be feasible for cargo to make that determination.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cross-compilingArea: using --target flag for other platformsA-rustupArea: rustup interactionC-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`S-blocked-externalStatus: ❌ blocked on something out of the direct control of the Cargo project, e.g., upstream fix

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions