Repository navigation
Print each clang-tidy command and its output under a lock - #49
Merged
Merged
Conversation
This fixes NUL bytes and lost lines in the output of run_O2CodeChecker.py. - All threads wrote to sys.stdout concurrently, which corrupts it with Python 3.9/3.10. - With a fake clang-tidy, 20000 files at -j 64 gave ~200k NUL bytes and ~2000 lost lines with Python 3.10. - Each thread now captures the clang-tidy output and prints it with the command line under a lock. alisw/alidist#6360 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
run_O2CodeChecker.py wrote to sys.stdout from all threads at once, which corrupts the output with Python 3.9/3.10: NUL bytes and lost lines. In o2checkcode this made grep treat error-log.txt as binary, so the check passed without reading its log (alisw/alidist#6360). Each thread now captures the clang-tidy output and prints it together with the command line under a lock, so each diagnostic also follows its own command.
With a fake clang-tidy over 20000 files at -j 64, Python 3.10 gave ~200k NUL bytes and ~2000 lost lines before, and none after.
Assisted by Claude Code.