public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Wolfgang Denk <wd@denx.de>
To: Heiko Thiery <heiko.thiery@gmail.com>
Cc: u-boot@lists.denx.de, Stefano Babic <sbabic@denx.de>,
	Fabio Estevam <festevam@gmail.com>,
	Michael Walle <michael@walle.cc>, Simon Glass <sjg@chromium.org>
Subject: Re: [RFC 0/2] Do not stop with an error when mkimage fails
Date: Sun, 07 Nov 2021 15:48:06 +0100	[thread overview]
Message-ID: <963318.1636296486@gemini.denx.de> (raw)
In-Reply-To: <CAEyMn7Zgn1ej3kGzg2kiCyqK5DQhkSdXNAUavZGs+3L_fb1Lvg@mail.gmail.com>

Dear Heiko,

In message <CAEyMn7Zgn1ej3kGzg2kiCyqK5DQhkSdXNAUavZGs+3L_fb1Lvg@mail.gmail.com> you wrote:
>
> > > While converting to binman for an imx8mq board, it has been found that
> > > building in the u-boot CI fails. This is because an imx8mq requires an
> > > external binary (signed_hdmi_imx8m.bin). If this file cannot be found
> > > mkimage fails. To work around the problem the exception is caught, an
> > > error message is printed and binman continues.
> >
> > But how can you continue, when mkimage fails and cannot generate the
> > needed image?

Let me rephrase:

	How can can you continue, when mkimage fails and cannot
	_succesfully_ generate the needed image?

> > In your patch 2/2 we have this:
> >
> > +            tools.Run('mkimage', '-d', input_fname, *self._args, output_fname)
> > +        except Exception as e:
> > +            tout.Error("mkimage failed: %s" % e)
> > +
> >          self.SetContents(tools.ReadFile(output_fname))
> >
> > mkimage is supposed to create an output file which name is in
> > output_fname; if mkimage fails and you continue, the next step is
> > tools.ReadFile(output_fname) trying to read that file.  How is this
> > possible?
>
> # ls -al mkimage*
> -rw-r--r-- 1 hthiery hthiery      0 Nov  4 20:28 mkimage-out.spl.mkimage
> -rw-r--r-- 1 hthiery hthiery 180392 Nov  4 20:28 mkimage.spl.mkimage
>
> The file (mkimage-out.spl.mkimage) with size 0 seems to be created.  I
> assume mkimage will create that.

So in this situation we know that mkimage failed, and it generated
an empty output file.

I guess the output file is _not_ empty when no errors occur?

which reasonable results can you expect when you ignore an error and
just continue with garbage data as if nothing happened?

Sorry, but this makes no sense to me.  If there is an error, it
should be reported and - if possible - handled.  If this is not
possible, then the correct thing is to abort.  Ignoring errors and
trying to continue is always the worst thing to do.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,      Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd@denx.de
"I go on working for the same reason a hen goes on laying eggs."
- H. L. Mencken

  reply	other threads:[~2021-11-07 14:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04 18:52 [RFC 0/2] Do not stop with an error when mkimage fails Heiko Thiery
2021-11-04 18:52 ` [RFC 1/2] patman: introduce RunException Heiko Thiery
2021-11-05  2:02   ` Simon Glass
2021-11-04 18:52 ` [RFC 2/2] binman: catch RunException for mkimage runtime failure Heiko Thiery
2021-11-05  2:02   ` Simon Glass
2021-11-05  7:49     ` Heiko Thiery
2021-11-05 16:12       ` Simon Glass
2021-11-04 19:12 ` [RFC 0/2] Do not stop with an error when mkimage fails Wolfgang Denk
2021-11-04 19:31   ` Heiko Thiery
2021-11-07 14:48     ` Wolfgang Denk [this message]
2021-11-09 19:21       ` Heiko Thiery
2021-11-09 19:42         ` Tom Rini
2021-11-10  0:18           ` Rasmus Villemoes
2021-11-10  0:26             ` Rasmus Villemoes
2021-11-10  1:37               ` Tom Rini
2021-11-10  8:28                 ` Michael Walle
2021-11-10 16:31                   ` Simon Glass
2021-11-11 12:29               ` Wolfgang Denk
2021-11-10  0:58           ` Simon Glass
2021-11-11 12:27           ` Wolfgang Denk
2021-11-11 15:04             ` Tom Rini
2021-11-11 12:24         ` Wolfgang Denk
2021-11-11 13:54           ` Heiko Thiery

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=963318.1636296486@gemini.denx.de \
    --to=wd@denx.de \
    --cc=festevam@gmail.com \
    --cc=heiko.thiery@gmail.com \
    --cc=michael@walle.cc \
    --cc=sbabic@denx.de \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox