From fcd0e6697038e5959df733e389124f6ccfa4a6d5 Mon Sep 17 00:00:00 2001 From: bitflash-maintainer Date: Wed, 2 Sep 2026 05:24:26 +0000 Subject: build: let appimagetool's exit status decide, and check the artefact The appimage recipe piped the tool through grep ... || true, so a failed run still ended with an unconditional "Built:" echo and make reported success with no AppImage on disk. Run appimagetool bare so its status propagates, then require the artefact to exist, be non-empty, and be newer than src/bitflash before announcing it. Closes #29 --- Makefile | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index 0eec4c2..602c154 100644 --- a/Makefile +++ b/Makefile @@ -200,8 +200,17 @@ d + '/usr/share/icons/hicolor/256x256/apps/bitflash.png')" [ -z "$$path" ] && path=$$(find /usr/lib /lib -name "$$lib" 2>/dev/null | head -1); \ [ -n "$$path" ] && cp -L "$$path" $(APPDIR)/usr/lib/ && echo " bundled $$lib" || echo " missing $$lib"; \ done +# appimagetool's output used to be piped through grep ... || true, which +# discarded its exit status: the target succeeded and announced "Built:" +# even when no AppImage existed. Run the tool bare so its status decides, +# then require the artefact to exist, be non-empty, and be newer than the +# binary it was packaged from before saying so. @ARCH=x86_64 $(APPIMAGETOOL) --no-appstream $(APPDIR) \ - $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage 2>&1 | grep -E "^Built|^Error" || true + $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage + @test -s $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage || \ + { echo "ERROR: Bitflash-$(VERSION)-x86_64.AppImage missing or empty"; exit 1; } + @test $(ROOT)/Bitflash-$(VERSION)-x86_64.AppImage -nt src/bitflash || \ + { echo "ERROR: Bitflash-$(VERSION)-x86_64.AppImage is not newer than src/bitflash"; exit 1; } @echo "Built: Bitflash-$(VERSION)-x86_64.AppImage" # ---- Windows (MSYS2 UCRT64) ----------------------------------------------- -- cgit v1.2.3