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 compiler messages. #9104

Closed
ehuss opened this issue Jan 25, 2021 · 2 comments · Fixed by #9675
Closed

Deduplicate compiler messages. #9104

ehuss opened this issue Jan 25, 2021 · 2 comments · Fixed by #9675
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

Comments

@ehuss
Copy link
Contributor

ehuss commented Jan 25, 2021

Describe the problem you are trying to solve

In some cases, Cargo builds the same code in parallel. For example, cargo test will build the library as a test, and concurrently as an rlib to link for doctests or integration tests. This can cause confusion when compiler messages appear twice.

Describe the solution you'd like

Cargo should track which messages have been generated, and remove duplicates.

Notes

There are some challenges with how this will be implemented. For example, rustc emits some summary messages that can be difficult to deduplicate correctly, particularly the warning count warning: 1 warning emitted. The implementation will need to carefully consider these edge cases.

This may also need to consider displaying a summary of deduplicated (hidden) messages, although I am less certain about that.

@ehuss ehuss added A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` A-console-output Area: Terminal output, colors, progress bar, etc. labels Jan 25, 2021
@rsalmei
Copy link

rsalmei commented Jan 26, 2021

Couldn't the set of errors and warnings be captured internally, from all the concurrent builds, and just output one of them?
I presume they would be strictly subsets of one another, so maybe just output the longest one.

@ehuss
Copy link
Contributor Author

ehuss commented Jan 26, 2021

The intent is that there would be a set of hashes of previous messages, and if the set contains a hash of a message, to skip displaying it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. A-diagnostics Area: Error and warning messages generated by Cargo itself. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants