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

better control over subcommand output #101

Open
evmar opened this issue Jan 8, 2024 · 2 comments
Open

better control over subcommand output #101

evmar opened this issue Jan 8, 2024 · 2 comments
Labels
enhancement New feature or request ninja incompatibility Behaviors that are incompatible with Ninja

Comments

@evmar
Copy link
Owner

evmar commented Jan 8, 2024

In #68 @dae mentioned:

It would be great to have some sort of option like a build variable that could suppress the aggregated output in the success case, as while I love the extra insight during build, I'd miss the clean output if I had to decide on only one of the two.

The current n2 behavior is

  • the last line of task output is shown while it's running
  • all task output is displayed once a task completes

The use case here is there are commands that display a lot of progress output (e.g. a test runner), but that progress output is ultimately not useful to show specifically in the case where the task succeeds. Another example of such a command is if a task is itself executing another build system (e.g. Cargo) that only displays build progress -- if the task's build succeeds we don't need to display anything.

We could do something like "only print a full log if the task fails", but also it seems plausible there are cases where you do want to see the full output. For example the tail of the output of LLVM's check-lld task looks like

-- Testing: 2732 tests, 8 workers --
Testing:  0.. 10.. 20.. 30.. 40.. 50.. 60.. 70.. 80.. 90.. 

Testing Time: 9.99s
  Unsupported: 2352
  Passed     :  380

Where I imagine it's good to display the "testing time" line.

So perhaps this is something to make configurable on a per-task basis?

@evmar
Copy link
Owner Author

evmar commented Jan 8, 2024

Digging into the LLVM build, it appears check-lld is tagged into the console pool.

@evmar evmar added enhancement New feature or request ninja incompatibility Behaviors that are incompatible with Ninja labels Jan 8, 2024
@dae
Copy link
Contributor

dae commented Jan 8, 2024

I presume their primary motivation for using the console pool in this case is so they can see the 10..20.. part update in real time. The testing time seems a bit less useful, since n2 is already displaying a counter as the command runs.

That said, I do think it would make sense to make a "hide output on success" setting configurable on a per-command basis, as there are other times where it would be useful (e.g. one might want a build step that outputs things like warnings, or generated auth info, or instructions for the user)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ninja incompatibility Behaviors that are incompatible with Ninja
Projects
None yet
Development

No branches or pull requests

2 participants