Skip to content

Deduplicate compiler messages. #9104

Closed

Description

@ehuss

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.

Activity

  1. added
    A-diagnosticsArea: Error and warning messages generated by Cargo itself.
    C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`
    A-console-outputArea: Terminal output, colors, progress bar, etc.
    on Jan 25, 2021
  2. rsalmei commented on Jan 26, 2021

    @rsalmei

    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.

  3. ehuss commented on Jan 26, 2021

    @ehuss
    ContributorAuthor

    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.

  4. added a commit that references this issue on Jul 16, 2021
    54bc19e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-console-outputArea: Terminal output, colors, progress bar, etc.A-diagnosticsArea: Error and warning messages generated by Cargo itself.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions