-
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
Proposed/still running #629
Conversation
(as opposed to holding commands output until these finish)
Evan Martin » ninja #561 SUCCESS |
Bleh, left this comment on the wrong pull request (#608), it belongs here: ninja used to have code to print a "still going" line every 5 seconds, but that code was dead due to a bug, and so I removed it ( 555431a ). That implementation looks simpler, maybe it's good enough? On the other hand, updating the status line every N seconds regardless of progress might be nice for some NINJA_STATUS settings anyhow. |
555431a 555431a doesn't address I was trying to solve the following problems:
On Mon, Jul 29, 2013 at 8:21 AM, Nico Weber [email protected]:
Maxim |
I have the same problem, i.e. show me the job that is actually stalling the build, rather than “ninja is not dead”, so this pull request looks good to me — I made my own patch for this (7831cb8) before I became aware of @maximuska’s. His patch is definitely better, but I suggest removing the spinner when the output device is not a smart terminal, otherwise the receiver will be spammed with a lot of duplicate output. |
@sorbits: re "smart terminal", the code already does that you've proposed (or you mean something else?)
|
@maximuska Yes, that is what I meant, I didn’t see that But this means for the case where you don’t output to a tty, your patch has effectively no changed behavior, right? I think in the non-tty case, it should print the active job’s line once (if it is wasn’t the last job printed). |
@sorbits - right, almost. To be precise, after the change as it is now ninja re-checks each 50ms if it can run anything new, which may result in spawning new tasks if load-based jobs limit (-j xx) is in effect. Highly unlikely, though. Your proposal to fix non-tty mode as well is all-right, but frankly sepaking I am reluctant to invest in it before it gets more traction. |
I personally pipe all my ninja output to less. Since I really need this feature, I've simply removed the test for is_smart_terminal in BuildEdgeRunningSolo. |
I've took a look at that you have described so briefly, if I comment out the
But if I edit 'LinePrinter::LinePrinter()' to unconditionally set
On Sat, Sep 7, 2013 at 2:32 PM, Mathias Gaunard [email protected]:
Maxim |
@maximuska This is a great job. I just tried it and I like it very much. About the issue reported by @mgaunard I found this easy fix. It seems to work with my simple tests. I did not investigate more your code so maybe I have broken something else: diff --git a/src/build.cc b/src/build.cc
index 7a3cf7e..2c7c15d 100644
--- a/src/build.cc
+++ b/src/build.cc
@@ -183,11 +183,11 @@ void BuildStatus::RestartStillRunningDelay()
void BuildStatus::BuildEdgeRunningSolo(Edge* edge, const string& output)
{
- if (config_.verbosity == BuildConfig::QUIET || !printer_.is_smart_terminal())
+ if (config_.verbosity == BuildConfig::QUIET)
return;
if (output.size() > solo_bytes_printed_) {
- if (solo_bytes_printed_ == 0) {
+ if (solo_bytes_printed_ == 0 && printer_.is_smart_terminal()) {
// Print edge description before starting to print its output
PrintStatus(edge, "\n");
} $ cat ~/tmp/ninja/tst.ninja build o1: SLEEP s1
|
This PR seems to be dead (?), but it's a feature that I would very much like to see being integrated (and I think #111 requests the same thing). It's quite confusing when the status message is "Doing B" because B was the last thing that was started (and finished), but the task that's blocking further progress is actually a long-running A that was started before B. So in that case I'd like to somehow see that ninja is waiting for A to finish (automatically switching to live output as if |
I really like the approach in #1320 for that particular problem (which came in while I was on leave, and the author got impatient and deleted their clone so I can't easily merge it, but I'll recreate it myself when I have time). |
Let's continue any discussions in #111. |
#111 doesn't seem to be the same thing at all. |
You're right, I've missed immediate output part. But one commit is still about the same as #111, isn't it? |
This comment was marked as abuse.
This comment was marked as abuse.
I can do that if there is an intention to merge that.
…On Sun, Aug 4, 2019 at 10:46 AM Michael Jones ***@***.***> wrote:
@maximuska <https://github.com/maximuska> Would you be able to rebase
this pull request against the latest master branch code?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#629?email_source=notifications&email_token=AAAWV6S2YTVPPM72OZQZ653QC2CMXA5CNFSM4AG2NKU2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3P4MXI#issuecomment-517981789>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAWV6XEFIKHTSBFIHGHHS3QC2CMXANCNFSM4AG2NKUQ>
.
--
Maxim
|
While this is a nice feature (I'm talking about the second commit), I would prefer to have this implemented in an external frontend (see #1600). Ninja simply doesn't have enough manpower to maintain this long term, sorry. @jonesmz That goes with mostly all "frontend" PRs. Please don't ask them to rebase before #1600 is merged in some form or another, because that would result in merge conflicts again. |
Maybe I do not understand you as you refer to second commit, but closed the PR which title is about the “still running” issue. The problem being solved here is when you have Task 1, 2, and 3, where 1 is the slow one. But ninja is likely showing: This is problematic because the user may wonder why Task 3 is taking so long, and also not realize that there is an issue with Task 1 (this could e.g. be a test runner that has gone into an infinite loop). I don’t think ninja should start a “spinner” but I do think ninja should update the status text, so that if a solo task has been running for e.g. 1 second and the status currently shows another task as running, it should reprint the status line as I have run into this countless of times, where ninja was stalling, but the current output did not offer a way for me to figure out what was actually holding up the build. |
I was only referring to the second commit, because the still-running-problem has multiple ways to fix it, one of them was #1320, which we merged but had to revert due to a regression. As the problem seems to be more complicated than first thought, I think a possible solution should be discussed in #111 first (and again: Maybe just be implemented in an external frontend). |
OK, I added the patch I have been using to that PR. I thought I had previously submitted a PR for it, but it doesn’t appear so. Probably because it was sort of a duplicate, but I have had no problems with that patch for the last 6 years. |
Due to a somewhat popular demand..
There is currently no infrastructure to test this with gtest, but to avoid "great" being an enemy of "good" publishing this anyway. I did tested it manually using the following manifest: git show 22aa5f3:tst4.ninja, for what it worth (building different targets in separate and together)..
This pull request provides the following features: