[SERVER-67682] Enable -fdiagnostics-color by default with ninja for all build types Created: 29/Jun/22  Updated: 29/Oct/23  Resolved: 29/Sep/22

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 6.2.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Alex Neben Assignee: Juan Gu
Resolution: Fixed Votes: 0
Labels: dp-qol
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Dev Platform 2022-07-25
Participants:

 Comments   
Comment by Githook User [ 28/Sep/22 ]

Author:

{'name': 'Juan Gu', 'email': 'juan.gu@mongodb.com', 'username': 'juangugit'}

Message: SERVER-67682 Enable -fdiagnostics-color by default with ninja for all build types
Branch: master
https://github.com/mongodb/mongo/commit/5cbe7f207d1abe694708bf729e4808a4a5413e60

Comment by Alex Neben [ 02/Sep/22 ]

daniel.moody@mongodb.com I am hoping you can show juan.gu@mongodb.com where to look to fix this

Comment by Mathias Stearn [ 12/Jul/22 ]

I think some context was lost when this ticket was created from an email thread. This should only be done for ninja-enabled builds. I've updated the title to reflect this.

 

Note that ninja intercepts the output of commands that it runs (except in the magic "console" pool) so that it can prevent interleaved output from commands that it runs in parallel. Because of this, the commands are not able to use the normal isatty() call to decide to enable color and need to be told to enable color explicitly. In addition, ninja does its own isatty() call to detect if it is outputing to a console and will strip out color codes when forwarding output from subcommands to a non-terminal. This will address the issue of people piping the output of ninja locally, and I think it will also address evergreen because it doesn't look like a terminal to ninja. (Of course it would be better if evergreen did look like a tty and then correctly presented colored output in its log viewer like jenkins does, but that is a separate issue). Anywhere that you want to avoid color output (and ninja's use of \r rather than \n to overwrite its current command line) you can just add |cat to the end of your command line.

Comment by Iryna Zhuravlova [ 11/Jul/22 ]

It doesn't really work well with the Evergreen Log viewer. This should be done for local environments, unless the output is being piped into another view

Generated at Thu Feb 08 06:08:46 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.