Hi Tom, On Tue, 6 Dec 2022 at 15:03, Tom Rini <tr...@konsulko.com> wrote: > > When the user builds with BINMAN_ALLOW_MISSING=1 they're explicitly > setting the flag to allow for additional binaries to be missing and so > have acknowledged the output might not work. In this case we want to > default to not passing a non-zero exit code. > > Cc: Simon Glass <s...@chromium.org> > Reported-by: Peter Robinson <pbrobin...@gmail.com> > Signed-off-by: Tom Rini <tr...@konsulko.com> > --- > This passes CI as-is: > https://source.denx.de/u-boot/u-boot/-/pipelines/14340 > --- > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index de5746399a63..03de1da1bfd0 100644 > --- a/Makefile > +++ b/Makefile > @@ -1334,7 +1334,7 @@ cmd_binman = $(srctree)/tools/binman/binman $(if > $(BINMAN_DEBUG),-D) \ > --toolpath $(objtree)/tools \ > $(if $(BINMAN_VERBOSE),-v$(BINMAN_VERBOSE)) \ > build -u -d u-boot.dtb -O . -m \ > - $(if $(BINMAN_ALLOW_MISSING),--allow-missing > --fake-ext-blobs) \ > + $(if $(BINMAN_ALLOW_MISSING),--allow-missing > --ignore-missing) \ > -I . -I $(srctree) -I $(srctree)/board/$(BOARDDIR) \ > -I arch/$(ARCH)/dts -a of-list=$(CONFIG_OF_LIST) \ > $(foreach f,$(BINMAN_INDIRS),-I $(f)) \ > -- > 2.25.1 >
I believe we need the --fake-ext-blobs flag as well, since otherwise boards which use tools (like mkimage) on things that don't exist will not work. Yes I know this passes on CI, but it will cause breakages when people use mkimage or other things which have missing inputs. It will be quite confusing too! As to the logic, I thought you had wanted the build to fail if there are missing blobs, regardless of whether they were allowed or not. There is currently code in buildman to detect this failure and either report it or ignore it: if (result.return_code == 2 and ('Some images are invalid' in result.stderr)): # This is handled later by the check for output in # stderr result.return_code = 0 Since buildman sets BINMAN_ALLOW_MISSING=1 if -M is given, we will not be able to detect missing binaries at all when built from buildman. I think a suitable fix would be to update the code above to detect the 'Some images are invalid' regardless of the return code. Regards, Simon