Skip to content

Commit 981daea

Browse files
fix error print
1 parent 2ef40ca commit 981daea

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

ci/ci_utils.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -107,30 +107,30 @@ def _parse_and_print_log_from_process(self, process: subprocess.Popen) -> None:
107107
'cmake fatal error',
108108
]
109109
warning_keywords = [
110-
'warning:',
111-
'cmake warning',
112-
'cmake deprecation warning',
110+
'warning:', 'cmake warning', 'cmake deprecation warning', 'permission denied'
113111
]
114112

115-
# Stop printing if there are too many identical lines in a row.
113+
# Count successive identical lines.
116114
num_identical = 0
117115
last_line = None
116+
117+
# Parse output line by line.
118118
if process.stdout is not None:
119119
for line in process.stdout:
120120
num_identical = num_identical + 1 if line == last_line else 0
121121
last_line = line
122122

123+
# Only print if there are not too many identical lines in a row.
123124
if num_identical < MAX_CONSECUTIVE_IDENTICAL_LOG_LINES:
124125
print(line, end='') # Print live output
126+
if any(keyword in line.lower() for keyword in error_keywords):
127+
print(f'::error ::{line.strip()}')
128+
if any(keyword in line.lower() for keyword in warning_keywords):
129+
print(f'::warning ::{line.strip()}')
125130
elif num_identical == MAX_CONSECUTIVE_IDENTICAL_LOG_LINES:
126131
print(
127132
'::warning :: Truncating output due to too many identical lines in a row.')
128133

129-
if any(keyword in line.lower() for keyword in error_keywords):
130-
print(f'::error ::{line.strip()}')
131-
if any(keyword in line.lower() for keyword in warning_keywords):
132-
print(f'::warning ::{line.strip()}')
133-
134134
def build(self) -> None:
135135
"""Build a docker image from a Dockerfile. First builds the parent image if it exists."""
136136

0 commit comments

Comments
 (0)