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 to avoid these problems.

Signed-off-by: Tony Ambardar <[email protected]>
  • Loading branch information
guidosarducci committed Nov 15, 2023
1 parent 23b3c70 commit 2f73e04
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 $@; \
false; \
}
endef

Expand Down

0 comments on commit 2f73e04

Please sign in to comment.