# By default minimize build progress log

**URL:** <https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741>\
**Category:** tools and infrastructure\
**Created:** [October 22, 2023, 7:35pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741 "2023-10-22T19:35:02Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![hydroper1](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/hydroper1/32/12099_2.png) [@hydroper1](https://internals.rust-lang.org/u/hydroper1)\
**Post date:** [October 22, 2023, 7:35pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/1 "2023-10-22T19:35:02Z")

</div>

I'm starting a SDK which has a few dependencies that rely on other several dependencies, whether small or large dependencies, and I've been imagining that future users of my SDK will get annoyed to see the build progress logging the name of every dependency under the hood.

The dependency names are only logged by Cargo the first the project is built; however this occurs for every project.

It doesn't harm the SDK API, but it harms the eyes when building. For example, to get started, you'll typically run this in the command line:

```sh
> agera new photoshop
> cd photoshop
> cargo run

```

And then you'll see the name of every minor crate being compiled, usually common dependencies such as `lazy_regex`, `once_cell`, `futures`, `tokio`, `maplit` and hundreds more.

Small suggestions in case we were to hide these names during crate compilation:

#### Progress

Use a progress bar or icon based on `crates_compiled_count / crate_total`. Diagnostics such as compilation errors are still reported after progress is done.

#### Split progress

Reproduce something similiar to:

```plaintext
Downloading dependencies...
Compiling dependencies... (50%)
✓ Done compiling dependencies.

Compiling `actual_crate`...
✓ Done compiling `actual_crate`.

```

Therefore you will see only the name of the crate being compiled and not the dependencies, reducing the look of "dependency hell" (in my opinion).

When building in verbose mode, every individual dependency will log its name in the build.

---

<div class="post-metadata">

**Author:** ![bjorn3](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bjorn3/32/2736_2.png) [@bjorn3](https://internals.rust-lang.org/u/bjorn3)\
**Post date:** [October 22, 2023, 7:59pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/2 "2023-10-22T19:59:59Z")

</div>

You can use the `-q` argument to suppress all messages about which crates are being compiled. Seems that it also suppresses the progress bar though.

---

<div class="post-metadata">

**Author:** ![epage](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/epage/32/3171_2.png) [@epage](https://internals.rust-lang.org/u/epage)\
**Post date:** [October 23, 2023, 12:34pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/3 "2023-10-23T12:34:24Z")

</div>

I would be very much in favor of shrinking the output. I especially think of it with "cargo script" where a lot of cargo's output gets mxied with the users application.

In my ideal world, all output should be erased that isn't errors, warnings, or a summary line for the command being run.

[Console output should better reflect the build process · Issue #8889 · rust-lang/cargo · GitHub](https://github.com/rust-lang/cargo/issues/8889) is the closest issue for tracking this. The biggest concern is how well how well the fancier terminal control codes are supported across terminals. This isn't a question of "works in top 5 terminals" but the long tail and how to best gracefully degrade for that long tail.

---

<div class="post-metadata">

**Author:** ![Nemo157](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/nemo157/32/11585_2.png) [@Nemo157](https://internals.rust-lang.org/u/Nemo157)\
**Post date:** [October 23, 2023, 12:40pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/4 "2023-10-23T12:40:19Z")

</div>

Somewhat relatedly I just happened to be playing around with [an old tool](https://github.com/Nemo157/cargo-build-tree/) that renders the `build-graph` during the build, which is not something I think works well with typical rust projects with \>500 dependencies, but is sort of interesting to play with.

[![asciicast](https://asciinema.org/a/TYmsaTUzsLYiMb07FHvcelEEn.svg)](https://asciinema.org/a/TYmsaTUzsLYiMb07FHvcelEEn)

---

<div class="post-metadata">

**Author:** ![zackw](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/zackw/32/2071_2.png) [@zackw](https://internals.rust-lang.org/u/zackw)\
**Post date:** [October 23, 2023, 6:10pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/5 "2023-10-23T18:10:13Z")

</div>

If you are trying to debug a CI build using only the logs, full details of _every operation_ are frequently essential, so you want the exact opposite of this: you want the verbosity cranked up as far as it will go. (To a point. Only once in my career have I had to inject a wrapper script into the build environment to force `gcc -v` mode on. But it did happen once.)

Okay, sure, there's already a knob for that, right? But here's the catch: suppose your boss dumps a bug on you and it involves a broken CI build that ran with the _default_ verbosity and that verbosity is _not_ at least as high as "every single command is logged exactly as executed". Now you are, as they say, up shit creek without a paddle. I've had to deal with many such bugs in my time and my expectation is that each one will take me _multiple days_ worth of failed manual CI invocations just to get the verbosity high enough that I can _start_ debugging the actual problem. (N.B. I've mostly worked on very large systems, ones where a CI cycle typically takes an hour or more, and the build involves multiple nested layers of build drivers. If that number seems ridiculous, that's probably why.)

Is this a problem we should have in the first place? Absolutely not. [Sourcehut](https://sr.ht/)'s CI system obliterates it by [letting you ssh into a failed build VM](https://man.sr.ht/builds.sr.ht/build-ssh.md). But that's the _only_ CI system I have ever seen with that feature, and there are a lot of _other_ features it doesn't have, so it's not reasonable to expect everyone switch to Sourcehut right away.

Therefore: The default verbosity should be "every single command is logged exactly as executed". I consider it a _bug_ that "cargo build" doesn't already do that. This does pose a small cognitive speedbump for new contributors, but one that can be easily mitigated by documenting that you should type "cargo build --quiet" most of the time (but never, ever, ever in CI).

---

<div class="post-metadata">

**Author:** ![epage](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/epage/32/3171_2.png) [@epage](https://internals.rust-lang.org/u/epage)\
**Post date:** [October 23, 2023, 6:39pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/6 "2023-10-23T18:39:12Z")

</div>

imo we should be focused on the interactive case because having to pass a flag for every invocation of the interactive case is onerous while setting a flag in CI once means its set for all future runs.

> t. This does pose a small cognitive speedbump for new contributors, but one that can be easily mitigated by documenting that you should type "cargo build --quiet" most of the time (but never, ever, ever in CI).

That is not a small cognitive bump but being actively hostile to users. That is in addition that `--quiet` is too quiet in most cases. I tried to experiment with "Cargo script" implying `--quiet` and I had to immediately turn it off because I could never tell if it was taking a long time to compile or my program was hung.

---

<div class="post-metadata">

**Author:** ![bjorn3](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bjorn3/32/2736_2.png) [@bjorn3](https://internals.rust-lang.org/u/bjorn3)\
**Post date:** [October 23, 2023, 10:31pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/7 "2023-10-23T22:31:53Z")

</div>

> [@zackw](#):
>
> [Sourcehut](https://sr.ht/)'s CI system obliterates it by [letting you ssh into a failed build VM](https://man.sr.ht/builds.sr.ht/build-ssh.md). But that's the _only_ CI system I have ever seen with that feature

Cirrus ci has an option to rerun a build on debug mode where you can access a terminal while the build is running and after a build failed it will keep the VM up for another hour I believe to run commands. It is not automatic for every failed build like sourcehut, but still really useful.

---

<div class="post-metadata">

**Author:** ![bjorn3](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/bjorn3/32/2736_2.png) [@bjorn3](https://internals.rust-lang.org/u/bjorn3)\
**Post date:** [October 23, 2023, 10:32pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/8 "2023-10-23T22:32:32Z")

</div>

> [@epage](#):
>
> imo we should be focused on the interactive case because having to pass a flag for every invocation of the interactive case is onerous while setting a flag in CI once means its set for all future runs.

It would be possible to set a global config for this once as user, right?

---

<div class="post-metadata">

**Author:** ![epage](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/epage/32/3171_2.png) [@epage](https://internals.rust-lang.org/u/epage)\
**Post date:** [October 24, 2023, 12:11am UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/9 "2023-10-24T00:11:26Z")

</div>

> [@bjorn3](#):
>
> It would be possible to set a global config for this once as user, right?

If this could be set in the config, yes. That would still be a terrible out of box experience if the first thing we tell a user after installing rust is to change a setting in cargo.

---

<div class="post-metadata">

**Author:** ![jrose](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/jrose/32/9591_2.png) [@jrose](https://internals.rust-lang.org/u/jrose)\
**Post date:** [October 24, 2023, 5:15am UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/10 "2023-10-24T05:15:35Z")

</div>

I want to second the view that the default mode should be the interactive one. Anything that’s typed in a script can be typed _a little bit longer_ in a script, but anything someone types by hand should do something reasonable with the shortest invocation. (There are sometimes tricks one can play with tty-detection, but I would never want to _rely_ on that.)

---

<div class="post-metadata">

**Author:** ![the8472](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@the8472](https://internals.rust-lang.org/u/the8472)\
**Post date:** [October 24, 2023, 10:49am UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/11 "2023-10-24T10:49:45Z")

</div>

> [@hydroper1](#):
>
> It doesn't harm the SDK API, but it harms the eyes when building.

How are you eyes _harmed_? It seems more like an aesthetic preference than a harm. If anything I occasionally need more output (`-v`) to diagnose build issues.

> [@hydroper1](#):
>
> reducing the look of "dependency hell" (in my opinion).

I don't understand the argument. If dependencies are a real problem then hiding them from a build don't solve the problem, it merely ignores it.

---

<div class="post-metadata">

**Author:** ![hydroper1](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/hydroper1/32/12099_2.png) [@hydroper1](https://internals.rust-lang.org/u/hydroper1)\
**Post date:** [October 24, 2023, 1:48pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/12 "2023-10-24T13:48:14Z")

</div>

I didn't say dependencies are a problem; I wanted to mean that running `cargo build` and getting something like this everytime for the first time in the terminal:

```plaintext
Downloading spaghetti-loader...
Downloading alface-num-....
Downloading beterraba-lazy-trash...
Downloading cell-vortex-ko...
Downloading dead-maze-xf...
Downloading blah-bindgen...
Downloading spaghetti-loader...
Downloading alface-num-....
Downloading beterraba-lazy-trash...
Downloading cell-vortex-ko...
Downloading dead-maze-xf...
Downloading blah-bindgen...
Downloading spaghetti-loader...
Downloading alface-num-....
Downloading beterraba-lazy-trash...
Downloading cell-vortex-ko...
Downloading dead-maze-xf...
Downloading blah-bindgen...
Downloading spaghetti-loader...
Downloading alface-num-....
Downloading beterraba-lazy-trash...
Downloading cell-vortex-ko...
Downloading dead-maze-xf...
Downloading blah-bindgen...
Downloading spaghetti-loader...
Downloading alface-num-....
Downloading beterraba-lazy-trash...
Downloading cell-vortex-ko...
Downloading dead-maze-xf...
Downloading blah-bindgen...
Downloading spaghetti-loader...
Downloading alface-num-....
Downloading beterraba-lazy-trash...
Downloading cell-vortex-ko...
Downloading dead-maze-xf...
Downloading blah-bindgen...
Compiling spaghetti-loader...
Compiling alface-num-....
Compiling beterraba-lazy-trash...
Compiling cell-vortex-ko...
Compiling dead-maze-xf...
Compiling blah-bindgen...
Compiling spaghetti-loader...
Compiling alface-num-....
Compiling beterraba-lazy-trash...
Compiling cell-vortex-ko...
Compiling dead-maze-xf...
Compiling blah-bindgen...
Compiling spaghetti-loader...
Compiling alface-num-....
Compiling beterraba-lazy-trash...
Compiling cell-vortex-ko...
Compiling dead-maze-xf...
Compiling blah-bindgen...
Compiling spaghetti-loader...
Compiling alface-num-....
Compiling beterraba-lazy-trash...
Compiling cell-vortex-ko...
Compiling dead-maze-xf...
Compiling blah-bindgen...
Compiling spaghetti-loader...
Compiling alface-num-....
Compiling beterraba-lazy-trash...
Compiling cell-vortex-ko...
Compiling dead-maze-xf...
Compiling blah-bindgen...
Compiling spaghetti-loader...
Compiling alface-num-....
Compiling beterraba-lazy-trash...
Compiling cell-vortex-ko...
Compiling dead-maze-xf...
Compiling blah-bindgen...

```

Is not pleasing.

It's true that it's more an aesthetic preference, but it does also avoid cluttering the user terminal, which is what most developers want.

---

<div class="post-metadata">

**Author:** ![the8472](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@the8472](https://internals.rust-lang.org/u/the8472)\
**Post date:** [October 24, 2023, 2:58pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/13 "2023-10-24T14:58:36Z")

</div>

> [@hydroper1](#):
>
> and getting something like this everytime for the first time in the terminal

So.... only sometimes. Unless you're constantly busting your build cache, in case there is an underlying problem that might be worth fixing.

---

<div class="post-metadata">

**Author:** ![hydroper1](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/hydroper1/32/12099_2.png) [@hydroper1](https://internals.rust-lang.org/u/hydroper1)\
**Post date:** [October 24, 2023, 3:28pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/14 "2023-10-24T15:28:10Z")

</div>

You get started with a new project, and you'll see this useless trash log.

---

<div class="post-metadata">

**Author:** ![Nemo157](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/nemo157/32/11585_2.png) [@Nemo157](https://internals.rust-lang.org/u/Nemo157)\
**Post date:** [October 24, 2023, 3:47pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/15 "2023-10-24T15:47:10Z")

</div>

> [@the8472](#):
>
> It seems more like an aesthetic preference than a harm.

It's more than aesthetic, information overload makes important information less obvious.

---

<div class="post-metadata">

**Author:** ![zackw](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/zackw/32/2071_2.png) [@zackw](https://internals.rust-lang.org/u/zackw)\
**Post date:** [October 24, 2023, 3:56pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/16 "2023-10-24T15:56:23Z")

</div>

> [@epage](#):
>
> setting a flag in CI once means its set for all future runs.  
> ...  
> not a small cognitive bump but being actively hostile to users  
> ...  
> That would still be a terrible out of box experience if the first thing we tell a user after installing rust is to change a setting in cargo

> [@jrose](#):
>
> I want to second the view that the default mode should be the interactive one.

I _want_ to agree with this position but, given my experiences, I can't. I just cannot trust anyone to explicitly select verbose modes for CI builds. I don't think I've _ever_ seen CI builds changed away from the default log verbosity in real life.

Therefore, I have to insist that the default mode needs to be verbose, that it is not just a cosmetic problem but a _bug_ that cargo's default mode does not print every single sub-command invocation exactly as executed, _despite_ the negative consequences for interactive use.

> [@epage](#):
>
> `--quiet` is too quiet in most cases

That seems like a separate issue -- we should either adjust `--quiet` or add a new level of detail that's tuned for interactive builds.

---

<div class="post-metadata">

**Author:** ![the8472](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@the8472](https://internals.rust-lang.org/u/the8472)\
**Post date:** [October 24, 2023, 4:24pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/17 "2023-10-24T16:24:40Z")

</div>

When getting started with a new project it can be useful to know what you're pulling in. Granted, it would be safer to run `cargo tree` before actually compiling anything, but I think it's good to know whether your database tool accidentally tries to build native ffmpeg or other funny things.

And calling things "trash" is... quite subjective and disparaging. I don't consider this a convincing argument.

---

<div class="post-metadata">

**Author:** ![hydroper1](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/hydroper1/32/12099_2.png) [@hydroper1](https://internals.rust-lang.org/u/hydroper1)\
**Post date:** [October 24, 2023, 4:38pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/18 "2023-10-24T16:38:09Z")

</div>

However there are beginners who have no interest on seeing what's under the hood, so if one really wants, they use `-v`.

---

<div class="post-metadata">

**Author:** ![the8472](https://avatars.discourse-cdn.com/v4/letter/t/0ea827/32.png) [@the8472](https://internals.rust-lang.org/u/the8472)\
**Post date:** [October 24, 2023, 4:56pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/19 "2023-10-24T16:56:06Z")

</div>

"must be removed/changed" does not follow from "someone momentarily happens to have no interest in some particular aspect".

There's plenty of information out there that's posted in case someone needs it but can be otherwise ignored.

---

<div class="post-metadata">

**Author:** ![robinm](https://sea2.discourse-cdn.com/flex002/user_avatar/internals.rust-lang.org/robinm/32/6255_2.png) [@robinm](https://internals.rust-lang.org/u/robinm)\
**Post date:** [October 24, 2023, 6:53pm UTC](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741/20 "2023-10-24T18:53:39Z")

</div>

Wouldn't a minimal output in interactive mode and verbose mode in non-interactive mode solve the issue? (obviously with a way to force it with command line arguments and/or settings in cargo.toml)

[Next page](https://internals.rust-lang.org/t/by-default-minimize-build-progress-log/19741.md?page=2)
