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

Ninja output into dumb terminal is not machine parsable #1010

Closed
colincross opened this issue Aug 28, 2015 · 6 comments
Closed

Ninja output into dumb terminal is not machine parsable #1010

colincross opened this issue Aug 28, 2015 · 6 comments

Comments

@colincross
Copy link
Contributor

When ninja writes to a smart terminal it writes the status line for each edge when the command starts and then again when the command finishes immediately followed by the command output. When writing to a dumb terminal it only writes the status line when the command starts, to avoid duplicate status lines in the output. When building in parallel the dumb output ends up looking like:
status for cmd 1
status for cmd 2
output for cmd 1
output for cmd 2

This prevents automated tooling from parsing out the output from and individual command, for example to associate error messages or warnings with the file that caused them.

PR #999 changes the status printing for dumb terminals to only print when the edge finishes, instead of when the edge starts. This is a little less useful for a human reading the output as it runs, as you can't see what command is currently running, but I expect all interactive uses of ninja to use a smart terminal. For dumb terminal outputs, which I expect is normally redirecting to a file, the output will always be
status for cmd 1
output for cmd 1
status for cmd 2
output for cmd 2

Parsers can use a token in NINJA_STATUS to recognize status lines, and assume everything after a status line is output from that command until the next status line is seen.

@nico
Copy link
Collaborator

nico commented Aug 30, 2015

It's an interesting idea. Not seeing what's currently running is a bit weird, but in interactive mode that happens frequently too. And it keeps things simple, which is nice.

I posted this to the mailing list for discussion here: https://groups.google.com/forum/#!topic/ninja-build/-wQL6d8d0gg

@evmar
Copy link
Collaborator

evmar commented Aug 31, 2015

(We really should make interactive mode update with which command is still
running if we're waiting for something...)

On Sun, Aug 30, 2015 at 11:34 AM, Nico Weber [email protected]
wrote:

It's an interesting idea. Not seeing what's currently running is a bit
weird, but in interactive mode that happens frequently too. And it keeps
things simple, which is nice.

I posted this to the mailing list for discussion here:
https://groups.google.com/forum/#!topic/ninja-build/-wQL6d8d0gg


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

@maximuska
Copy link
Contributor

@martine: I've proposed once the 'still running' patch which prints the
name of (one of the) long-rung running command in the interactive mode:
#629.

Using it myself actually.

@sgraham
Copy link
Contributor

sgraham commented Nov 12, 2015

I don't feel strongly, but I do sometimes watch sloooow bot output streaming as "pseudo" interactive, which will be running in dumb mode, so it's sort of nice to see what's running. But it's not a big deal if the other uses are important.

@nico
Copy link
Collaborator

nico commented Nov 12, 2015

@sgraham I do that all the time too. But you currently don't really know what's running either, right? Currently, all running commands have been printed somewhere above, but you don't know what's still active. (To be clear, I'm slightly nervous about this too, but I think in practice it might be ok. And if it isn't, then we can come up with something else then.)

@nico
Copy link
Collaborator

nico commented Nov 12, 2015

Since #999 is merged, this is fixed for now. If #999 turns out to be annoying, we can reopen this.

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

5 participants