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

Stop implicitly manipulating NO_COLOR/NOCOLOR #1188

Closed
wants to merge 1 commit into from

Conversation

mgorny
Copy link
Member

@mgorny mgorny commented Nov 26, 2023

Stop implicitly forcing NO_COLOR and NOCOLOR in ebuild environment. This is undesired for several reasons:

  1. It makes it impossible to control color for emerge output independently of command output, e.g. when one goes to a pty while the other goes to logs.

  2. It makes it impossible to get color output in logs when running emerge --jobs ....

  3. Forcing NO_COLOR=1 turns out to cause random test failures, and while fixing them is commendable, it is a pain for arch testing and it is currently blocking stabilization requests.

With the new approach, the color output in programs is consistent between using --jobs or --quiet-build, and not. Therefore, both cases generate uniform logs. In order to obtain logs free of color codes, one can either filter them via ansifilter(1) (as the manpages already recommend) or explicitly set NO_COLOR.

Furthermore, one can combine color-free build output (for clean logs) with colorful emerge output by using:

NO_COLOR=true emerge --color y ...

Bug: https://bugs.gentoo.org/918515

Copy link
Contributor

@floppym floppym left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me.

@zmedico
Copy link
Member

zmedico commented Nov 28, 2023

We could also do the same in bin/egencache and lib/portage/_emirrordist/main.py while we're here.

Copy link
Member

@thesamesam thesamesam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please document this in NEWS under "Breaking changes" and handle Zac's comment, then ok, thanks.

I think the total of the effects here are enough for us to do this even if it might surprise some people.

@mgorny
Copy link
Member Author

mgorny commented Nov 29, 2023

We could also do the same in bin/egencache and lib/portage/_emirrordist/main.py while we're here.

I wasn't sure whether I ought to touch it since it doesn't really affect ebuilds and I don't know if egencache doesn't internally use any tools that would spew color.

Stop implicitly forcing `NO_COLOR` and `NOCOLOR` in ebuild environment.
This is undesired for several reasons:

1. It makes it impossible to control color for emerge output
   independently of command output, e.g. when one goes to a pty while
   the other goes to logs.

2. It makes it impossible to get color output in logs when running
   `emerge --jobs ...`.

3. Forcing `NO_COLOR=1` turns out to cause random test failures,
   and while fixing them is commendable, it is a pain for arch testing
   and it is currently blocking stabilization requests.

With the new approach, the color output in programs is consistent
between using ``--jobs`` or ``--quiet-build``, and not.  Therefore,
both cases generate uniform logs.  In order to obtain logs free of color
codes, one can either filter them via `ansifilter(1)` (as the manpages
already recommend) or explicitly set `NO_COLOR`.

Furthermore, one can combine color-free build output (for clean logs)
with colorful emerge output by using:

    NO_COLOR=true emerge --color y ...

Bug: https://bugs.gentoo.org/918515
Signed-off-by: Michał Górny <mgorny@gentoo.org>
@thesamesam
Copy link
Member

ok, wfm, ship it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants