-
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
Print when commands start #1158
Comments
In interactive mode, it prints both when jobs start and when they end. See #1010 (and the mailing list thread linked from there) for discussions on this. What did you do previously when you say that a compile hung? I usually ssh in and diagnose locally in these cases, and then I can just run |
+1 -- I actually preferred old behavior, where I can always see which jobs have been started. It's too bad that there is no flag to preserve it. Interactive mode is a workaround, but it is much more noisy (if one just cares about the started jobs) |
Sorry @nico, only now I see your question. It is also helpful to see it start compiling "reallyhuge.cpp" files, and at that point I might break the compile and continue coding, rather than wait for that huge file to finish compiling. If I could change ninja to print out when it starts a job, I'd do something like this in gvim: |
Interactive mode is less nice because it prints the commands twice, whereas one generally wants to see them once. I feel that this change makes ninja less nice to use on the command terminal (i.e. direct interaction with user, much like the default output of 'make') to improve usability for external applications that parse the output (i.e. indirect interaction with user). I don't understand why it can't be nice to use for both cases? (e.g. with a command line flag that switches to the old behavior as suggested by @paulharris) |
Stupid question, but, what is this "interactive mode" ? |
This would also be solved with #1026 to print running jobs when interrupted by a signal |
@colincross: that would only address the situation where ninja is interrupted. It doesn't fix the issue that with this new behavior, ninja has become less nice to use on the command line when one wants to see jobs as they are started. |
It solves the original issue (hung compilers). For long running tools, the output of #1020 is much nicer, it tells you when the job started and clears it from the table when it finishes. |
Yes -- sadly that PR has been sitting there for over a year.. |
If I understand it correctly, the problem in that case is, that ninja might show a job which has already finished on the status line, so it isn't apparent which job has hang. In my frontend I've fixed that by updating the status line with a still running job whenever a job finishes: jhasse/ja@e01efe2#diff-987df73aeefc3bfb7b87e9dd2b76f354
You might want to check out my frontend https://bixense.com/ja/ :) It'll immediately return on the first failure and that huge file continues to compile in the background. |
Because I spent way too long trying to work around this: Run |
This is a usability bug that |
+1, this is perhaps by biggest gripe with |
That was a mistake GNU Make made a couple of decades ago and fixed sinse then. Such a mistake makes build debugging less straightforward and more time consuming. As well as providing no feedback for the user about what is currently executing. However, that's still ninja's design rationale, something deemed broken in GNU Make, see https://ninja-build.org/manual.html#_comparison_to_make:
That same page claims that, unlike GNU Make,
Which never corresponded to reality, GNU Make supported multiple outputs for at least two decades, see https://www.gnu.org/software/make/manual/make.html#Multiple-Targets
Target directories get created with order-only dependencies in GNU Make and being explicit about that detects errors earliest.
Built-in/suffix rules are disabled with From that same page again:
That is very nice. However, without breakdown of what took how much time, and without reproduction, that's, at best, a statistical study with sample size of one, also known as anecdote. I built a non-recursive build system in 2009 from scratch using GNU Make for a C++ project of similar size and it took 1.5 seconds for Fundamentally, My personal opinion is that |
GNU Make added support for output buffering in 4.0, and the default output buffer mode appears to act just like ninja. In general it's a tradeoff between seeing what's running and having reasonable output in parallel builds.
GNU Make didn't add the equivalent functionality (grouped targets in explicit rules) until version 4.3 a few years ago. |
You haven't read the link in full. Multiple-target pattern rules were first documented in 1988. One might argue that multiple outputs were supported only for pattern rules, like |
The default output buffering for GNU Make is Ninja should provide buffering options, like GNU Make does. Or just
Such a trade-off for a build system makes it harder to notice increased command execution times, diagnose errors and debug builds; for the benefit of not interleaving outputs of different commands. The latter is hardly a useful benefit. That's a wrong trade-off and, often, the number one reason for ditching Whereas GNU Make doesn't do any buffering by default, but can do |
The old ninja printed the command/task when it started.
Since 1.7 or so, it changed to print when they were finished, so that the build output is printed along with the task.
This is a good change,
however,
Sometimes the compiler gets stuck in an infinite loop, and the old ninja's behaviour was handy because I could tell which file it was getting stuck on.
Also, I could see which tasks it was processing, and I could mentally estimate how long the tasks would take.
Maybe it could have a 'status bar' style output, that shows what jobs are currently building?
eg aptitude / apt-get / parallel ftp / parallel network transfers tend to have such a status bar.
Otherwise, would be good to have a switch to print the tasks as they start, for situations where the compiler is causing problems.
The text was updated successfully, but these errors were encountered: