-
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
Status table #1020
Status table #1020
Conversation
Cool, I like the output. :) Minor build issue on VS2015: I'm not sure about console_height/2 for the limit, but it also seems heavy to add another config parameter for that, so maybe it's fine. |
I did try console_height/4 (above), but I thought the stdout/stderr above was too small when getting compiler errors. |
16c42c3
to
cefb828
Compare
I replaced the edge variable with cur_edge. Thanks for spotting. (Is git-rebase the method to use on GitHub? Where can I see the differences between the versions? I'm used to Gerrit where I rebase all the time.) |
I like this output too. I am wondering how we could make it fit in a larger patch addressing most of the issues referenced by #746. |
It would be nice to have enough tools inside Ninja to be able to implement such output as an external filter command. |
This looks very interesting. How would this visualization behave when compiling on a machine with many cores that are becoming increasingly common? The latest Xeon Phi machines boot up with 256 virtualized cores, which means that it won't generally be possible to even fit that many lines on a screen. |
In src/line_printer.cc:88, |
6404d2d
to
e6a56d8
Compare
e6a56d8
to
e072e6c
Compare
8731fe4
to
c5fa24a
Compare
5635f25
to
6a65758
Compare
GetFullPathName previously failed silently on long path names resulting in uninitialized path result. Signed-off-by: Fredrik Medley <fredrik.medley@autoliv.com>
The goal with this commit is to get the smart terminal to work with msys2 bash, but keeping the rest as in the msvc version. This way, subprocesses are spawned the same way, not using 'sh -c', in both msys2 and msvc so the build.ninja files can be reused. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
The msys2 system sends the Ctrl+C signal through the posix layer. Therefore, create a dummy posix thread that is waiting for the signals and forwards them to the Win32 interruption handling function. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
The elapsed time resolution of milliseconds is probably only useful for debugging or profiling, in which case the .ninja_log can be used instead. Therefore, print the elapsed time in minutes and seconds instead. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Use the %l (sorry for not finding any other letter) to print the estimated time left in the status. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Instead of just printing status on one line, allow printing status in a full table. To not hide any upcoming output of error message etc., the status table must never cover the whole terminal. Also handle resizing the window in a good way. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Sort the table with the slowest command at the top. It is probably more interesting to follow up the slow commands than the fast ones. Another possibility is to replace finished rows with new commands, but then there will just be a mixture of slow and fast ones all over the place. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Enable the table with all running threads by default. It will still only be enabled for smart consoles. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
A timeout can be used to continuously update information for the user or potentially abort jobs that are running forever. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
In the smart console, the status line is continuously overwritten. When ninja is done, the console is left empty. Clarify that everything went well by writing '[STATUS] Finished' on the last line. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
The estimation does still not estimate time left by using the log file, the estimate is just presented on top of the table. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
The temporary lines just overwrite each other in a speed impossible to read. Assume the user wanted to see them, so print all commands in a normal manner. Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
Signed-off-by: Fredrik Medley <fredrik.medley@gmail.com>
A build log on a dumb terminal can be big, even for a fast build. Reduce the output on dumb terminal by printing less frequent if NINJA_STATUS_SLEEP is set.
Just a few comments, as I have been using these patches for about 10 months now, and like to share my interest in it. Most notably, I can see which files are taking most of the time to build, and how long that is. I've got some issue with it:
|
I suspect this PR is not using the alternate window effectively (though I've not looked or tested the code). A screenshot would help. |
Using the alternate window should fix that, but you might also lose the |
What's this "alternate window" thing? |
This SO question seems to explain things: https://stackoverflow.com/questions/11023929/using-the-alternate-screen-in-a-bash-script |
Ok thanks, indeed, that could be it. |
Tried it, but we lose the ninja output on termination, which is not nice. I feel like maybe it will be the best to not clear out on exit, but just to leave the last few lines. To get an idea, I killed ninja with |
Thank you all for the feedback. Sorry for the late reply. I saw a PR which always printed the longest running edge instead of just the latest started or latest finished. That behaviour is probably enough for my use case. Then I can see what commands are slow, even though the exact elapsed time is not there. (Looked around but could not find that PR again.) Anyway, I'm switching to Bazel since so I will not maintain this PR any more. Please feel free to take it over (copy it?) or just close it. |
This series of commits creates a new status output, inspired by https://buckbuild.com/static/buck-build-15fps.gif at https://buckbuild.com/. I've tried to make the console work well when resizing. It does not fill the whole console window, by purpose, so that the user can see the latest output above the currently running tasks.
Estimating the time left is of the simplest kind without using the
.ninja_log
.Use NINJA_STATUS_TABLE as well as NINJA_STATUS to configure the top status line in the table.
It has not been tested for user input during pool=console. I've been running an earlier draft for a while on a quite big project (50 MB ninja file) for a few months now, on Windows. Only basic tests has been performed on Linux, building Ninja itself.
See also https://groups.google.com/d/msg/ninja-build/lK5YVv5Y4T4/fjqQAjoJKrsJ