Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion cargo-miri/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,11 @@ fn cargo_extra_flags() -> Vec<String> {

pub fn get_cargo_metadata() -> Metadata {
// This will honor the `CARGO` env var the same way our `cargo()` does.
MetadataCommand::new().no_deps().other_options(cargo_extra_flags()).exec().unwrap()
MetadataCommand::new()
.no_deps()
.other_options(cargo_extra_flags())
.exec()
.unwrap_or_else(|err| show_error!("{}", err))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this error look like?

I am wondering if we should add something like "cargo metadata failed:\n{}" or so.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The error message currently looks like this:

fatal error: `cargo metadata` exited with an error: error: could not find `Cargo.toml` in `/home/ftg` or any parent directory

For a visual comparison, an image of the previous and current behavior is available below:

image

Apologies for not including this information when I initially opened the PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! And no worries. :)

That does sound a bit redundant, but the message seems to be entirely controlled by cargo_metadata, and it's definitely a big step up from before, so -- LGTM.

}

/// Pulls all the crates in this workspace from the cargo metadata.
Expand Down