Skip to content

Commit

Permalink
fix: stop print build log as error when build with warning-as-error
Browse files Browse the repository at this point in the history
  • Loading branch information
hfudev committed Sep 10, 2024
1 parent 158c3b3 commit df48b99
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions idf_build_apps/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,14 +607,7 @@ def _post_build(self) -> None:
self._logger.warning('%s', line)
has_unignored_warning = True

# correct build status for originally successful builds
if self.build_status == BuildStatus.SUCCESS:
if self.check_warnings and has_unignored_warning:
self.build_status = BuildStatus.FAILED
self.build_comment = 'build succeeded with warnings'
elif has_unignored_warning:
self.build_comment = 'build succeeded with warnings'

# for failed builds, print last few lines to help debug
if self.build_status == BuildStatus.FAILED:
# print last few lines to help debug
self._logger.error(
Expand All @@ -624,6 +617,13 @@ def _post_build(self) -> None:
)
for line in lines[-self.LOG_DEBUG_LINES :]:
self._logger.error('%s', line)
# correct build status for originally successful builds
elif self.build_status == BuildStatus.SUCCESS:
if self.check_warnings and has_unignored_warning:
self.build_status = BuildStatus.FAILED
self.build_comment = 'build succeeded with warnings'
elif has_unignored_warning:
self.build_comment = 'build succeeded with warnings'

def _finalize(self) -> None:
"""
Expand Down

0 comments on commit df48b99

Please sign in to comment.