Skip to content

Commit a71f814

Browse files
authored
Fix output read from the include-what-you-use tool (#31920)
Reading one line and checking whether process is alive might lead to premature read termination in case when subprocess outputs lots of lines and terminates right away.
1 parent 4958746 commit a71f814

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

scripts/helpers/iwyu-check.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -172,8 +172,8 @@ def main(compile_commands_glob, scanning_destination, mapping_file_dir,
172172
logging.info("============== IWYU output start ================")
173173

174174
logger = logging.info
175-
while status.poll() is None:
176-
line = status.stdout.readline().rstrip()
175+
for line in status.stdout:
176+
line = line.rstrip()
177177

178178
if re.match(r"^warning:.*$", line):
179179
logger = logging.warning

scripts/helpers/platforms/iwyu.imp

+5
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,12 @@
3232
## lib/*
3333
{ include: [ '"lib/core/CHIPError.h"', private, '<lib/core/CHIPError.h>', public ] },
3434
{ include: [ '"lib/dnssd/ServiceNaming.h"', private, '<lib/dnssd/platform/Dnssd.h>', public ] },
35+
36+
## lib/support/logging/*
37+
{ include: [ '"lib/support/logging/BinaryLogging.h"', private, '<lib/support/logging/CHIPLogging.h>', public ] },
3538
{ include: [ '"lib/support/logging/CHIPLogging.h"', private, '<lib/support/logging/CHIPLogging.h>', public ] },
39+
{ include: [ '"lib/support/logging/Constants.h"', private, '<lib/support/logging/CHIPLogging.h>', public ] },
40+
{ include: [ '"lib/support/logging/TextOnlyLogging.h"', private, '<lib/support/logging/CHIPLogging.h>', public ] },
3641

3742
## platform/*
3843
{ include: [ '"platform/NetworkCommissioning.h"', private, '<platform/NetworkCommissioning.h>', public ] },

0 commit comments

Comments
 (0)