Collect warnings for path dependencies into one message printed at the end
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by tracing Cargo's handling of rustc diagnostics produced with --error-format=json and --json=diagnostic-rendered-ansi, focusing on path dependencies and how compiler output is presented. The work is done when warnings from those dependencies are collected and a single summary such as "warning: 43 warnings emitted for all path dependencies" is printed at the end.
Written by the indexing model from the issue text.
Description
Describe the problem you are trying to solve
In workspaces, especially very large workspaces, warnings are scattered around the output:
warning: publicly re-exporting an item from a different crate
--> compiler/rustc_trait_selection/src/traits/mod.rs:73:1
|
73 | pub use rustc_infer::traits::*;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: facade crates are discouraged; import from the original crate instead
warning: 42 warnings emitted
Checking rustc_lint v0.0.0 (/home/joshua/rustc2/compiler/rustc_lint)
Checking rustc_typeck v0.0.0 (/home/joshua/rustc2/compiler/rustc_typeck)
Checking rustc_traits v0.0.0 (/home/joshua/rustc2/compiler/rustc_traits)
Checking rustc_ty v0.0.0 (/home/joshua/rustc2/compiler/rustc_ty)
Checking rustc_mir_build v0.0.0 (/home/joshua/rustc2/compiler/rustc_mir_build)
Checking rustc_mir v0.0.0 (/home/joshua/rustc2/compiler/rustc_mir)
Checking rustc_passes v0.0.0 (/home/joshua/rustc2/compiler/rustc_passes)
warning: unused import: `rustc_hir as hir`
--> compiler/rustc_mir_build/src/build/expr/into.rs:9:5
|
9 | use rustc_hir as hir;
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
This makes it hard to see all the warnings; if there are enough crates being built they may disappear off the screen entirely and you might not see them at all.
Describe the solution you'd like
Cargo should print a sum of all the warnings at once: warning: 43 warnings emitted for all path dependencies. Since it uses --error-format=json --json=diagnostic-rendered-ansi this should be ~fairly easy to calculate from the rustc diagnostics, but don't quote me on that ;)
Ideally this wouldn't print warnings per-crate, just per-compile. However I'd rather have too much output than too little.
Notes
@joshtriplett suggested something like this in https://github.com/rust-lang/rust/pull/77492#issuecomment-703176656, so I have a strong motivation to work on it myself if someone can write up mentoring instructions :)
- Dominant language
- Rust
- Stars
- 15.5k
- Forks
- 3k
- Avg merge
- 23h 30m
- Merged PRs (30d)
- 51
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from rust-lang/cargo
-
C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
-
A-completions C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
C-bug S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
Command-fix
Difficulty 1/5 Under an hour Newbie friendliness 82/100
-
cargo remove prints "Removing X" for dependencies that never get removed when the command fails OpenC-bug Command-remove S-triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
kwakseongjae/auto-hwp#319 ·
-
area:cli bug filter-quality good first issue priority:medium
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
-
Difficulty 1/5 Under an hour Newbie friendliness 72/100
bevyengine/bevy#25861 ·
-
comp-datalake
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ClickHouse/ClickHouse#121222 ·
-
enhancement remote
Difficulty 2/5 1-3 hours Newbie friendliness 68/100