Skip to content

Commit

Permalink
image: don't mask imagesize failures
Browse files Browse the repository at this point in the history
On a failed image-size check, Build/check-size currently prints an error
message, removes the offending build file, and returns success to the build
system, which is problematic for a few reasons. Returning success lets the
overall build complete without flagging the error, unless a user happens
to search through logs. It also allows subsequent build steps to run, which
can fail in various ways due to the target file's removal, and result in
broken image files (e.g. only a header/footer present).

Update check-size to return failure as needed and avoid these problems.

Signed-off-by: Tony Ambardar <itugrok@yahoo.com>
  • Loading branch information
guidosarducci committed Nov 14, 2023
1 parent 95a6bd6 commit f4d9de3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions include/image-commands.mk
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ define Build/check-size
[ $$limitsize -ge $$imagesize ] || { \
$(call ERROR_MESSAGE, WARNING: Image file $@ is too big: $$imagesize > $$limitsize); \
rm -f $@; \
return 1; \
}
endef

Expand Down

0 comments on commit f4d9de3

Please sign in to comment.