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

Default cargo output should prioritize warnings over "Compiling foo" line spam #14596

Closed
bonsairobo opened this issue Sep 25, 2024 · 1 comment
Labels
A-console-output Area: Terminal output, colors, progress bar, etc. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.

Comments

@bonsairobo
Copy link

Problem

It's very easy to miss some warnings because they are printed before a deluge of "Compiling foo" lines that quickly fill the terminal buffer.

This is not a problem when using the -q flag, but this is not the default. -q also doesn't provide a progress bar.

Proposed Solution

The default cargo output should exclude spam, while ensuring that warnings and progress are visible.

If users still want the spam, they should use -v.

Notes

No response

@bonsairobo bonsairobo added C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage. labels Sep 25, 2024
@epage epage added the A-console-output Area: Terminal output, colors, progress bar, etc. label Sep 25, 2024
@epage
Copy link
Contributor

epage commented Sep 25, 2024

As an example of what you are referring to, on a small scale

$ cargo check
    Checking utf8parse v0.2.2
    Checking is_terminal_polyfill v1.70.0
    Checking anstyle-query v1.1.0
    Checking colorchoice v1.0.1
    Checking anstyle v1.0.8
warning: type `foo` should have an upper camel case name
   --> clap_lex/src/lib.rs:127:8
    |
127 | struct foo;
    |        ^^^ help: convert the identifier to upper camel case (notice the capitalization): `Foo`
    |
    = note: `#[warn(non_camel_case_types)]` on by default

warning: struct `foo` is never constructed
   --> clap_lex/src/lib.rs:127:8
    |
127 | struct foo;
    |        ^^^
    |
    = note: `#[warn(dead_code)]` on by default

    Checking strsim v0.11.1
warning: `clap_lex` (lib) generated 2 warnings
    Checking anstyle-parse v0.2.4
    Checking anstream v0.6.14
    Checking clap_builder v4.5.18 (/home/epage/src/personal/clap/clap_builder)
    Checking clap v4.5.18 (/home/epage/src/personal/clap)
    Finished `dev` profile [unoptimized + debuginfo] target(s) in 1.05s

We currently printing events as they happen, rather than buffering them.

#8749 has the same root problem but only focuses the solution discussion on a subset of the problem (handling of summaries). In #8889, we are discussing a more generalized improvement to our compilation output. #8743 is about having quiet output while seeing progress indicators. I'd recommend we consolidate the conversation to those issues and am closing in favor of them.

@epage epage closed this as not planned Won't fix, can't repro, duplicate, stale Sep 25, 2024
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. C-feature-request Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted` S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants