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

Deduplicate diagnostics #130

Closed
jhpratt opened this issue Sep 5, 2021 · 1 comment
Closed

Deduplicate diagnostics #130

jhpratt opened this issue Sep 5, 2021 · 1 comment
Labels
C-enhancement Category: A new feature or an improvement for an existing one

Comments

@jhpratt
Copy link
Contributor

jhpratt commented Sep 5, 2021

Similar to rust-lang/cargo#9675. I think this is possible by doing something like

  • Use --message-format=json on all commands
  • Store the diagnostic in a set
  • Emit the diagnostic if and only if the diagnostic was not previously in the set

This is a ten-second thought, so I've probably missed something. I also don't know how easy it is to emit a diagnostic once you're using --message-format=json, which I imagine is the caveat here.

@taiki-e taiki-e added the C-enhancement Category: A new feature or an improvement for an existing one label Oct 8, 2021
@taiki-e
Copy link
Owner

taiki-e commented Jan 18, 2022

I would prefer not to do this for the following reasons:

  • While cargo deduplicates warnings under the same build conditions, in cargo-hack, the implementation needs to deduplicate warnings under different build conditions (feature flags, rustc versions, etc.). If the build conditions are different, even if the warnings look the same, the necessary fixes may be completely different.
  • In cargo-hack, the implementation also needs to clarify which warnings duplicate which build's warnings.
  • The amount of builds processed by cargo-hack can be huge. Especially for large projects where warnings are not denied by CI, memory consumption may become a problem if all diagnostics are saved.

Anyway, thanks for the suggestion.

@taiki-e taiki-e closed this as completed Jan 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-enhancement Category: A new feature or an improvement for an existing one
Projects
None yet
Development

No branches or pull requests

2 participants