-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Comments
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 |
(We really should make interactive mode update with which command is still On Sun, Aug 30, 2015 at 11:34 AM, Nico Weber [email protected]
|
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. |
@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.) |
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.
The text was updated successfully, but these errors were encountered: