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

Root bug for outstanding display/output issues/requests #746

Closed
fischman opened this issue Apr 25, 2014 · 14 comments
Closed

Root bug for outstanding display/output issues/requests #746

fischman opened this issue Apr 25, 2014 · 14 comments

Comments

@fischman
Copy link

As of now these are the open ninja issues that have to do with status display or ninja output. Listing them in hopes of a cohesive plan forming.

curses-based rule progress indicator #717
Support color in NINJA_STATUS #713
print "still waiting" for long running commands if we serialize on them #678
Address FIXME: Add --no-strip-ansi-escapes option #672
Throttle rate of output messages #663
Use ANSI escapes to output to Cygwin-based terminals #659
Proposed/still running #629
Add NINJA_SMART_TERMINAL environment variable, with on, off, and hide_newline options #581
Use SetConsoleTextAttribute on Windows to simulate color #486
Add a -q "quiet" option. #480
Automatically use pager for failed output #413
"smart" output (e.g. overprinting) doesn't work under cygwin #374
Slow down on big tool output #326
Feature request -- print elapsed time #267
Show progress when waiting #111

@nico
Copy link
Collaborator

nico commented Apr 25, 2014

Awesome, thanks :-)

@nicolasdespres
Copy link
Contributor

To complete this list I think Ninja should provide enough control on its
output so that an external program, such as GUI for instance, could easily
turn Ninja's textual output into a more structured graphical display.
Imagine something as simple as a window split vertically in two parts. On
the left side a growing list of all commands run and being run. On the
right side, a descriptive header and the output of the command selected on
the left side. To do something like that we could either make up another
output format (like the XML mode of the Google Test Framework) or just
extend a bit the user control on the output.

To achieve that, I have thought about the following extension so far:

  • A command line option to disable output buffering (for live update). In
    this case each output line should be prefixed with some kind of command
    identifier so that it could be sorted afterward to get it in order.
  • Make NINJA_STATUS control the whole line, not only the prefix.
  • Add %c for the command, %d for the description placeholder to
    NINJA_STATUS.
  • Have two different environment variables (like NINJA_STATUS) to control
    the display of a "build edge started" event and a "build edge stopped"
    event.
  • Add %E for the exit code of a command.

On Fri, Apr 25, 2014 at 11:07 PM, Nico Weber [email protected]
wrote:

Awesome, thanks :-)


Reply to this email directly or view it on GitHub
#746 (comment).

Nicolas Desprès

@nico
Copy link
Collaborator

nico commented Aug 6, 2014

@nico
Copy link
Collaborator

nico commented Feb 26, 2015

#916 asks for what #672 is implementing.

@nicolasdespres
Copy link
Contributor

Ninja output into dumb terminal is not machine parsable #1010

@nicolasdespres
Copy link
Contributor

Print successful command along with their output. #658

@nicolasdespres
Copy link
Contributor

Support table status a la Buck build system: #1020

colincross added a commit to colincross/ninja that referenced this issue Sep 23, 2015
Split the "smart terminal" configuration into three separate settings:
color, elide, and reprint.  Allow setting these options individually or
in bulk through a new -O option.

To have build output into a dumb terminal still include ANSI color
codes, for example if you wanted to pass continuous build output through
ansi2html, use:
   ninja -O color

To force smart terminal output, use:
   ninja -O smart

To force smart terminal output, but still print full status
descriptions:
   ninja -O smart -O noelide

Addresses some of the issues in ninja-build#746 while allowing for adding more
output options in the future.
colincross added a commit to colincross/ninja that referenced this issue Sep 23, 2015
Split the "smart terminal" configuration into three separate settings:
color, elide, and reprint.  Allow setting these options individually or
in bulk through a new -O option.

To have build output into a dumb terminal still include ANSI color
codes, for example if you wanted to pass continuous build output through
ansi2html, use:
   ninja -O color

To force smart terminal output, use:
   ninja -O smart

To force smart terminal output, but still print full status
descriptions:
   ninja -O smart -O noelide

Addresses some of the issues in ninja-build#746 while allowing for adding more
output options in the future.
colincross added a commit to colincross/ninja that referenced this issue Sep 23, 2015
Split the "smart terminal" configuration into three separate settings:
color, elide, and reprint.  Allow setting these options individually or
in bulk through a new -O option.

To have build output into a dumb terminal still include ANSI color
codes, for example if you wanted to pass continuous build output through
ansi2html, use:
   ninja -O color

To force smart terminal output, use:
   ninja -O smart

To force smart terminal output, but still print full status
descriptions:
   ninja -O smart -O noelide

Addresses some of the issues in ninja-build#746 while allowing for adding more
output options in the future.
@colincross
Copy link
Contributor

Print output file on failure #1033

@evmar
Copy link
Collaborator

evmar commented Nov 11, 2015

Make width of failure printouts configurable. #606

@nicolasdespres
Copy link
Contributor

Print commands when they start: #1158

mgiuffrida added a commit to mgiuffrida/ninja that referenced this issue Jan 27, 2017
Adds the general-purpose -o flag to address ninja-build#746, with options for
verbosity (ninja-build#480) and control sequence stripping (ninja-build#581, ninja-build#672, ninja-build#916). Also
provides the ability to enable both verbose and raw output as a
workaround for ninja-build#1214 without changing the existing verbose behavior.

-o verbose  show all command lines while building
-o quiet    hide command lines and outputs while building
-o raw      never strip control sequences from output
-o strip    always strip control sequences from output
-o color    strip most control sequences from output, but retain color codes

This patch does not affect Ninja's defaults of normal verbosity and
smart terminal detection for escape sequence stripping.

"-o color" is particularly useful for utilities like `head` and
`less -R` that interpret color codes from stdin and pass this colored
output to stdout. Any valid ANSI color code, of the form:

    `'ESC' '[' [ colors ] 'm'`

where `colors` is a semicolon-delimited list of optional integers:

   `[ n ] [ ';' colors ]`

is retained in its entirety when using "-o color" (any other CSI escape
sequences besides ANSI color codes are still stripped for non-smart
terminals).
mgiuffrida added a commit to mgiuffrida/ninja that referenced this issue Jan 27, 2017
Adds the general-purpose -o flag to address ninja-build#746, with options for
verbosity (ninja-build#480) and control sequence stripping (ninja-build#581, ninja-build#672, ninja-build#916). Also
provides the ability to enable both verbose and raw output as a
workaround for ninja-build#1214 without changing the existing verbose behavior.

-o verbose  show all command lines while building
-o quiet    hide command lines and outputs while building
-o raw      never strip control sequences from output
-o strip    always strip control sequences from output
-o color    strip most control sequences from output, but retain color codes

This patch does not affect Ninja's defaults of normal verbosity and
smart terminal detection for escape sequence stripping.

"-o color" is particularly useful for utilities like `head` and
`less -R` that interpret color codes from stdin and pass this colored
output to stdout. Any valid ANSI color code, of the form:

    `'ESC' '[' [ colors ] 'm'`

where `colors` is a semicolon-delimited list of optional integers:

   `[ n ] [ ';' colors ]`

is retained in its entirety when using "-o color" (any other CSI escape
sequences besides ANSI color codes are still stripped for non-smart
terminals).
mgiuffrida added a commit to mgiuffrida/ninja that referenced this issue Jan 27, 2017
Adds the general-purpose -o flag to address ninja-build#746, with options for
verbosity (ninja-build#480) and control sequence stripping (ninja-build#581, ninja-build#672, ninja-build#916). Also
provides the ability to enable both verbose and raw output as a
workaround for ninja-build#1214 without changing the existing verbose behavior.

-o verbose  show all command lines while building
-o quiet    hide command lines and outputs while building
-o raw      never strip control sequences from output
-o strip    always strip control sequences from output
-o color    strip most control sequences from output, but retain color codes

This patch does not affect Ninja's defaults of normal verbosity and
smart terminal detection for escape sequence stripping.

"-o color" is particularly useful for utilities like `head` and
`less -R` that interpret color codes from stdin and pass this colored
output to stdout. Any valid ANSI color code, of the form:

    `'ESC' '[' [ colors ] 'm'`

where `colors` is a semicolon-delimited list of optional integers:

   `[ n ] [ ';' colors ]`

is retained in its entirety when using "-o color" (any other CSI escape
sequences besides ANSI color codes are still stripped for non-smart
terminals).
timniederhausen pushed a commit to timniederhausen/ninja that referenced this issue Sep 19, 2017
Adds the general-purpose -o flag to address ninja-build#746, with options for
verbosity (ninja-build#480) and control sequence stripping (ninja-build#581, ninja-build#672, ninja-build#916). Also
provides the ability to enable both verbose and raw output as a
workaround for ninja-build#1214 without changing the existing verbose behavior.

-o verbose  show all command lines while building
-o quiet    hide command lines and outputs while building
-o raw      never strip control sequences from output
-o strip    always strip control sequences from output
-o color    strip most control sequences from output, but retain color codes

This patch does not affect Ninja's defaults of normal verbosity and
smart terminal detection for escape sequence stripping.

"-o color" is particularly useful for utilities like `head` and
`less -R` that interpret color codes from stdin and pass this colored
output to stdout. Any valid ANSI color code, of the form:

    `'ESC' '[' [ colors ] 'm'`

where `colors` is a semicolon-delimited list of optional integers:

   `[ n ] [ ';' colors ]`

is retained in its entirety when using "-o color" (any other CSI escape
sequences besides ANSI color codes are still stripped for non-smart
terminals).
@jhasse
Copy link
Collaborator

jhasse commented Oct 6, 2017

I think a nice way to fix all these is by adding support for external frontends. Check out the PR by colincross: #1210

The PR implements the point @nicolasdespres said:

To complete this list I think Ninja should provide enough control on its
output so that an external program, such as GUI for instance, could easily
turn Ninja's textual output into a more structured graphical display.

I've extended Colin's Python command line frontend which you can use with the PR which already fixes some of the other points (e.g. color) raised here. https://bixense.com/ja/

@nicolasdespres
Copy link
Contributor

I would like to renew the proposition I have made above in this thread on June, 5th 2014 to use only a limited set of environment variables to configure Ninja's output. I think this is enough and have a small impact on Ninja's codebase while giving all the power to external scripts to do what they need to build nice frontend. That would preserve Ninja's philosophy to do one thing well and remain fast by delegating the work.

@fischman
Copy link
Author

I've been out of the ninja game for years so unsubscribing from this. Feel free to close if no longer useful, or @ me if you want me to see a followup.

@jhasse
Copy link
Collaborator

jhasse commented Nov 14, 2018

I've created a label and added all the bugs and PRs from here that are still opened: https://github.com/ninja-build/ninja/issues?q=label%3Afrontend

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

No branches or pull requests

6 participants