Skip to content

Commit b274eb1

Browse files
fpistmABOSTM
authored andcommitted
fix(arduino-cli): avoid wrong status display
Check the overflow has been found to not display succeeded* while it is not. Signed-off-by: Frederic Pillon <[email protected]>
1 parent fa3937f commit b274eb1

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

CI/build/arduino-cli.py

+12-8
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090

9191
# error or fatal error
9292
fork_pattern = re.compile(r"^Error during build: fork/exec")
93-
error_pattern = re.compile(r":\d+:\d*:?\s.*error:\s|^Error:")
93+
error_pattern = re.compile(r":\d+:\d*:?\s.*error:\s|^Error:|fatal error:")
9494
ld_pattern = re.compile("arm-none-eabi/bin/ld:")
9595
overflow_pattern = re.compile(
9696
r"(will not fit in |section .+ is not within )?region( .+ overflowed by [\d]+ bytes)?"
@@ -584,6 +584,7 @@ def check_status(status, build_conf, boardKo, nb_build_conf):
584584
# Check if failed due to a region overflowed
585585
logFile = build_conf[idx_log] / f"{sketch_name}.log"
586586
error_found = False
587+
overflow_found = False
587588
for i, line in enumerate(open(logFile)):
588589
if error_pattern.search(line):
589590
error_found = True
@@ -593,17 +594,20 @@ def check_status(status, build_conf, boardKo, nb_build_conf):
593594
# If one ld line is not for region overflowed --> failed
594595
if overflow_pattern.search(line) is None:
595596
error_found = True
597+
else:
598+
overflow_found = True
596599
if error_found:
597-
result = ffail
598-
boardKo.append(build_conf[idx_b_name])
599-
if args.ci:
600-
cat(logFile)
601-
nb_build_failed += 1
602600
break
603-
else:
604-
# else consider it succeeded
601+
# Succeeded if overflow is found and no other error found
602+
if overflow_found and not error_found:
605603
result = "\033[32msucceeded*\033[0m"
606604
nb_build_passed += 1
605+
else:
606+
result = ffail
607+
boardKo.append(build_conf[idx_b_name])
608+
if args.ci:
609+
cat(logFile)
610+
nb_build_failed += 1
607611
else:
608612
result = "\033[31merror\033[0m"
609613
boardKo.append(build_conf[idx_b_name])

0 commit comments

Comments
 (0)