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

cargo aggregate failure due to mismatched criteria description is difficult to diagnose #593

Open
anforowicz opened this issue Feb 22, 2024 · 1 comment

Comments

@anforowicz
Copy link
Contributor

anforowicz commented Feb 22, 2024

Repro:

$ cat sources.list
# Chromium OS:
https://chromium.googlesource.com/chromiumos/third_party/rust_crates/+/refs/heads/main/cargo-vet/audits.toml?format=TEXT

# Chromium:
https://chromium.googlesource.com/chromium/src/+/main/third_party/rust/chromium_crates_io/supply-chain/audits.toml?format=TEXT

# Fuchsia:
https://fuchsia.googlesource.com/fuchsia/+/refs/heads/main/third_party/rust_crates/supply-chain/audits.toml?format=TEXT

# google3:
https://raw.githubusercontent.com/google/rust-crate-audits/main/manual-sources/google3-audits.toml

$ cargo vet aggregate --output-file audits.toml sources.list --verbose=info
ERROR   × there were errors aggregating source audit files

(The repro works because Chromium uses incompatible descriptions. I'll work on fixing this on Chromium side - at that point the repro steps above will not work anymore.)

Expected behavior: Details about AggregateCriteriaDescriptionMismatchError are displayed. (This class has a very nice auto-derived Display implementation that would be sufficient if only it was used/displayed.)

Actual behavior: Only general, non-actionable/diagnosable info about AggregateErrors is displayed.

@anforowicz
Copy link
Contributor Author

I am not sure what changes can be made in cargo vet to emit better diagnostics.

  • One naive approach would be to loop through the aggregated errors in fn do_aggregate_audits and call info!("{err}") for each of them.
  • OTOH, maybe the miele crate should somehow be used to handle displaying the aggregated errors?

Also - I think that I agree with the decision to not display the (quite verbose) details from AggregateCriteriaDescriptionMismatchError by default. OTOH, it would be nice if the short, default display had a some kind of summary of the problems that hints that description mismatches were the root problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant