ClangTidy: Avoid mixing stdout with stderror when dealing with a large number of files.

Summary:
At Mozilla we are using this tool in order to perform review-time static-analysis, since some patches contain a large number of files we've discovered this issue, where `stderr` gets mixed with `stdout` thus obfuscating our possibility to parse the output.
The patch that we are currently use can be found [here](https://searchfox.org/mozilla-central/source/build/build-clang/clang-tidy-8.patch).

This is just an upstream of the original patch.

Reviewers: JonasToth

Reviewed By: JonasToth

Subscribers: cfe-commits

Tags: #clang, #clang-tools-extra

Differential Revision: https://reviews.llvm.org/D60453

llvm-svn: 357994
This commit is contained in:
Andi-Bogdan Postelnicu 2019-04-09 11:17:02 +00:00
parent 91542e14c7
commit 965c5812f4
1 changed files with 1 additions and 0 deletions

View File

@ -172,6 +172,7 @@ def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
with lock: with lock:
sys.stdout.write(' '.join(invocation) + '\n' + output.decode('utf-8') + '\n') sys.stdout.write(' '.join(invocation) + '\n' + output.decode('utf-8') + '\n')
if len(err) > 0: if len(err) > 0:
sys.stdout.flush()
sys.stderr.write(err.decode('utf-8') + '\n') sys.stderr.write(err.decode('utf-8') + '\n')
queue.task_done() queue.task_done()