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

Option for noise-is-failure #775

Open
mdempsky opened this issue Jun 12, 2014 · 8 comments
Open

Option for noise-is-failure #775

mdempsky opened this issue Jun 12, 2014 · 8 comments
Milestone

Comments

@mdempsky
Copy link
Contributor

It would be nice if Ninja had a command-line option to continue running if any commands produce output, but to treat the overall invocation as failure. Or even to treat all noisy targets as failed.

The motivation for this is crbug.com/376586.

@jhasse
Copy link
Collaborator

jhasse commented Oct 29, 2018

Why not use -Werror instead?

@mdempsky
Copy link
Contributor Author

Not every noisy build is caused by gcc/clang output. For example, crbug.com/370981 (linked from crbug.com/376586, above) was due to a noisy Python script.

@jhasse
Copy link
Collaborator

jhasse commented Nov 2, 2018

Ah I see. So you want the whole build to be silent, otherwise it's a failure, correct? Couldn't you just check if there was any output in CI after ninja has completed?

@mdempsky
Copy link
Contributor Author

mdempsky commented Nov 2, 2018

In normal operation, ninja itself is quite noisy (e.g., printing build targets and progress). Is there an easy way to distinguish this noise from child process noise?

@jhasse
Copy link
Collaborator

jhasse commented Nov 5, 2018

You can change the build status with the env variable NINJA_STATUS. This will only print output not produced by ninja for example:

env NINJA_STATUS="ninja: " ninja 2>&1 | grep -v "^ninja: "

@jhasse
Copy link
Collaborator

jhasse commented Nov 14, 2018

Having a quiet option (#480) might also be useful.

@nico
Copy link
Collaborator

nico commented Nov 15, 2018

The motivation here is that we want the chrome build to be silent, but still have "normal" build output (the command description) on all the bots. Currently, we manually file bugs if any command produces output, but that becomes tricky as we build on more and more platforms.

@jhasse
Copy link
Collaborator

jhasse commented Dec 20, 2018

You can do that with:

env NINJA_STATUS="ninja: " ninja 2>&1 | ack --passthru --invert "^ninja: "

ack's exit code will be 0 if any command produced output.

@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
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants