-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Console output should better reflect the build process #8889
Copy link
Copy link
Open
Labels
A-console-outputArea: Terminal output, colors, progress bar, etc.Area: Terminal output, colors, progress bar, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-hardExperience: HardExperience: HardS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Metadata
Metadata
Assignees
Labels
A-console-outputArea: Terminal output, colors, progress bar, etc.Area: Terminal output, colors, progress bar, etc.C-feature-requestCategory: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`Category: proposal for a feature. Before PR, ping rust-lang/cargo if this is not `Feature accepted`E-hardExperience: HardExperience: HardS-needs-designStatus: Needs someone to work further on the design for the feature or fix. NOT YET accepted.Status: Needs someone to work further on the design for the feature or fix. NOT YET accepted.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Describe the problem you are trying to solve
The console output can be misleading about what's happening in the build. Having lots of sequential
Compiling <crate>lines makes it seem like compilation is serial, and if a slow-building crate X starts building just before a fast-building crate Y, you'll probably think that Y is the slow-building crate. (I was misled in this way about build times of different crates within rustc for a long time.)The progress bar helps with this, because it shows which crates are currently being built... but only if you have a sufficiently wide terminal. If you have 80 chars you don't see them at all. If you have 100 chars you might see one or two or three, but any crate with a long name greatly reduces the effectiveness.
Also, linking isn't shown. This means people often blame the compiler for slowness when it's the linker's fault.
Describe the solution you'd like
Instead of printing
Compiling <crate>when a crate starts building, printCompiled <crate> in X.YYs. That would avoid the problem where slowness to build is blamed on the wrong crate. This is a change of tense in the message, but Cargo already mixes present and past tenses, e.g. withDownloaded <crate>andDownloaded2 3 crates (78.7 KB) in 1.03smessages.Shrink the width of the progress bar, so the crates being built can be seen even on narrow terminals.
Show linking as a distinct step, including the time it took, e.g. `Linked in X.YYs".
Notes
My motivation here was comparing console output (which is moderately useful) to
-Ztimingsoutput (which is amazing), and trying to make the former a bit more like the latter.See also