Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX for invalid RUSTFLAGS is poor #2756

Closed
huonw opened this issue May 31, 2016 · 3 comments
Closed

UX for invalid RUSTFLAGS is poor #2756

huonw opened this issue May 31, 2016 · 3 comments
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-rustflags Area: rustflags S-propose-close Status: A team member has nominated this for closing, pending further input from the team

Comments

@huonw
Copy link
Member

huonw commented May 31, 2016

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).

@huonw huonw added the A-diagnostics Area: Error and warning messages generated by Cargo itself. label May 31, 2016
bors added a commit that referenced this issue Aug 9, 2016
Gracefully handle errors in a lockfile

Closes #2715

Question: why internal errors are hidden by default? I think if the unexpected has happened you most likely want to know some details. See also #2756.
@dwijnand
Copy link
Member

The invocation of rustc that failed is now shown even without --verbose. Adding --verbose to cargo now no longers adds any information. I can't figure out how to get the actual rustc output anymore.

Do we think the situation is sufficiently improved to close this out, or what should we do?

@ehuss ehuss added the A-rustflags Area: rustflags label Apr 6, 2020
@epage
Copy link
Contributor

epage commented Sep 28, 2023

If we've improved the output. I'm not sure what more there is for us to do. Like with #2559, being too smart can be its own problem. RUSTFLAGS should likely be viewed as an advanced workflow anyways with us finding ways to adapt that workflow to users more generally (#12739).

I'm going to propose to the cargo team that we close this.

@epage epage added the S-propose-close Status: A team member has nominated this for closing, pending further input from the team label Sep 28, 2023
@weihanglo
Copy link
Member

RUSTFLAGS=wrong cargo +1.74.1 build
error: failed to run `rustc` to learn about target-specific information

Caused by:
  process didn't exit successfully: `/home/user/.rustup/toolchains/1.74.1-x86_64-unknown-linux-gnu/bin/rustc - --crate-name ___ --print=file-names wrong --crate-type bin --crate-type rlib --crate-type dylib --crate-type cdylib --crate-type staticlib --crate-type proc-macro --print=sysroot --print=split-debuginfo --print=crate-name --print=cfg` (exit status: 1)
  --- stderr
  error: multiple input filenames provided (first two filenames are `-` and `wrong`)

Confirmed that as of 1.74.1, the error message is like above, so should be sufficient good to tell it's something wrong in RUSTFLAGS.

Agree on closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Error and warning messages generated by Cargo itself. A-rustflags Area: rustflags S-propose-close Status: A team member has nominated this for closing, pending further input from the team
Projects
None yet
Development

No branches or pull requests

5 participants