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

Feature request: Show parallel action names #2249

Open
orenbenkiki opened this issue Jan 26, 2023 · 1 comment
Open

Feature request: Show parallel action names #2249

orenbenkiki opened this issue Jan 26, 2023 · 1 comment
Labels
Milestone

Comments

@orenbenkiki
Copy link

Currently, Ninja holds off on writing the executed parallel action names until it has the complete output of some action - only then it prints the action name and its output. This makes the output nice to read (no mixing of output of different parallel actions).

However, this means that when actions take "a while" to run, one has no idea what ninja is actually running.

It would be nice if Ninja would print (in a single line) the (hopefully short) parallel action names, w/o showing the output from any of them (yet). When an action completes, it would clear the line and replace it with the name of the completed action, followed by its output, and followed by another line showing the updated list of parallel actions.

Something along the lines of how Rust cargo build shows the targets currently being built in parallel.

E.g.:

Building: A | B | C | D<cursor here>

Assume B finished first, Clear the line (\r followed by sufficient number of spaces followed by \r should work) and print:

B
... output of B ...
Building: A | C | D | E | F<cursor here>

@orgads
Copy link
Contributor

orgads commented Feb 5, 2023

Dup of #111

I started working on this, and posted my prototype, but nobody replied, so I didn't proceed.

ecatmur added a commit to ecatmur/ninja that referenced this issue Aug 2, 2023
In the terminal, when an edge finishes update the status to display the first started (longest running) action.
Usually this will be immediately overwritten with the next started action but if there is a bottleneck in the build or
if it is reaching the end, this ensures that the console displays status of a build that is actually running and not
one that has completed.
This ensures that the user attributes any delay to the (or an) action that is actually causing the slowdown and not
unfairly to an action that has already finished just because it happened to be the last started.

To make this clear, also change the default NINJA_STATUS to include current actual parallelism level - this will
reduce from number of cores to 1 as the bottleneck or end of build approaches.

Implementation stores currently running nodes in a deque, with NULL for interior completed nodes. This should be
fairly efficient and allows future extension to e.g. display multiple parallel action names, as in ninja-build#2249 and @orgads
prototype for ninja-build#111.

Partially resolves ninja-build#111 (should be enough for most purposes).
@jhasse jhasse added this to the 2.0.0 milestone Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants