Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 865841

Summary: sys-apps/portage: --quiet-build is not so quiet if terminal is noninteractive
Product: Portage Development Reporter: John Helmert III <ajak>
Component: Core - Interface (emerge)Assignee: Portage team <dev-portage>
Status: CONFIRMED ---    
Severity: normal CC: gentoo
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://bugs.gentoo.org/show_bug.cgi?id=889224
Whiteboard:
Package list:
Runtime testing required: ---

Description John Helmert III archtester Gentoo Infrastructure gentoo-dev Security 2022-08-20 04:41:30 UTC
I've been using OCI containers (primarily podman) as an easy way to generate binpkgs. I've found that even --quiet=y does not effectively quiet the output, with consist and unnecessary load avg updates exactly 4 times between "installing" and "emerging" and 1 time between "emerging" and "installing":

>>> Emerging binary (1 of 32) acct-group/docker-0-r1::gentoo
>>> Jobs: 0 of 32 complete, 1 running               Load avg: 1.51, 1.42, 0.82
>>> Installing (1 of 32) acct-group/docker-0-r1::gentoo
>>> Jobs: 0 of 32 complete, 1 running               Load avg: 1.51, 1.42, 0.82
>>> Jobs: 0 of 32 complete                          Load avg: 1.51, 1.42, 0.82
>>> Jobs: 1 of 32 complete                          Load avg: 1.39, 1.40, 0.81
>>> Jobs: 1 of 32 complete, 1 running               Load avg: 1.39, 1.40, 0.81
>>> Emerging (2 of 32) dev-lang/go-bootstrap-1.16.6::gentoo
>>> Jobs: 1 of 32 complete, 1 running               Load avg: 1.39, 1.40, 0.81
>>> Installing (2 of 32) dev-lang/go-bootstrap-1.16.6::gentoo
>>> Jobs: 1 of 32 complete, 1 running               Load avg: 1.29, 1.37, 0.84
>>> Jobs: 1 of 32 complete                          Load avg: 1.29, 1.37, 0.84
>>> Jobs: 2 of 32 complete                          Load avg: 1.24, 1.36, 0.84
>>> Jobs: 2 of 32 complete, 1 running               Load avg: 1.24, 1.36, 0.84
>>> Emerging (3 of 32) dev-lang/go-1.18.5::gentoo

And this pattern repeats for the entirety of the emerge run. A similar pattern can be seen in gentoo-binhost-autobuilds: https://archives.gentoo.org/gentoo-binhost-autobuilds/message/032aaa5e0d03949c316c62131d934862

The exact code responsible for the load average output is here: https://github.com/gentoo/portage/blob/master/lib/_emerge/JobStatusDisplay.py#L245

When the terminal is interactive, the terminal displays this on the same line over and over. Perhaps it would be better to omit the load average updates altogether when the terminal is noninteractive? Or maybe this should be the behavior of --quiet=y?