Skip to content

UX for invalid RUSTFLAGS is poor #2756

@huonw

Description

@huonw

If RUSTFLAGS has a typo, then running cargo leads to error messages like:

$ RUSTFLAGS=wrong rustup run 1.9.0 cargo build
   Compiling blank v0.1.0 (file:///home/huon/projects/test-rust/blank)
error: multiple input filenames provided
error: Could not compile `blank`.

To learn more, run the command again with --verbose.
$ RUSTFLAGS=wrong rustup run beta cargo build
error: failed to run `rustc` to learn about target-specific information

To learn more, run the command again with --verbose.
$ RUSTFLAGS=wrong rustup run nightly cargo build
error: failed to run `rustc` to learn about target-specific information

To learn more, run the command again with --verbose.

Passing --verbose does give more info (i.e. one can see the invocation that failed and the actual rustc output, and hence hopefully connect the dots back to RUSTFLAGS). However, it seems like that info is always useful/shouldn't be hidden, since there's not much a user can do about "failed to run rustc to learn about target-specific information" (in beta and nightly).

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Error and warning messages generated by Cargo itself.A-rustflagsArea: rustflagsS-propose-closeStatus: A team member has nominated this for closing, pending further input from the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions