From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1CCC4C433F5 for ; Sun, 7 Nov 2021 14:48:20 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2ADB76135E for ; Sun, 7 Nov 2021 14:48:19 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 2ADB76135E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5FA8E837E0; Sun, 7 Nov 2021 15:48:17 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1636296497; bh=Vctj4Fm2rxbJ+0OJJtClhmMu/De32Pdwyk8U9JErgvQ=; h=To:cc:From:Subject:In-reply-to:References:Date:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=xtqcXLteg9qnX/d/2Xsl/8DlYuNNKaogkUhlR+kCvlern8IbOZoBQECTJ1EZP+uXD IRV4nGpxKy3wm/Su3K5O8jLHoCRa/OsA0yGNXm67C8GHJ0YGJgzG05HZeGCGD1HG/A MCubQWKQgxGZqCt9O7DNbh4y+jl5HN6wZBenXp5l/PsBuZ7JbhkNcbyZ2O8/3m3luc epSDo9+kFcM7ghZleS/1WqsOIFcONAcYHYTXaAeUk0OnD0TcpbcDF3qc4IFIP9lxU9 bcpa0mWXr7QDT8RaSTqpB3Z0fETDSKR835rIyWGLqS+k97Mw6IMl+9Nuezb0mmK23k 1iVVpHuhf6rBQ== Received: from janitor.denx.de (unknown [62.91.23.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: noc@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id C66AE837D8 for ; Sun, 7 Nov 2021 15:48:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1636296495; bh=Vctj4Fm2rxbJ+0OJJtClhmMu/De32Pdwyk8U9JErgvQ=; h=To:cc:From:Subject:In-reply-to:References:Date:From; b=Dc8mMq+sWLhPm0Fz315u75GU1U+xT97hi+WYL3cnhs4euHGKl0MMtghq6qgdzfk/o fH8vA/lbR5s4ooD+Sx/2jBCE3tZvYc86fudSXMpoiVxivXJxBU6W+HU/KSAnlt9tvQ s1vpdNKImJB8RAR8z48MvXesZW/CPqXZ7II5NNxzkBdxS81MIiXrhBPJyCaMSh/6MN TJmN+Q5T8HquQzcaOlvR/43KNeZ2T0CRde/C75FGOMQuJ9nzv6AyTPKSKYB4l+sYHi L83LLqYL+KNXml5M/RsiLL5KPHQJi5M9bBWFkL1OsAb5mE/uVbIQaCOHAoXpSqjgJO eqUF41vZCRt2w== Received: by janitor.denx.de (Postfix, from userid 108) id 812F6A012A; Sun, 7 Nov 2021 15:48:15 +0100 (CET) Received: from gemini.denx.de (gemini.denx.de [10.4.0.2]) by janitor.denx.de (Postfix) with ESMTPS id 90E66A009C; Sun, 7 Nov 2021 15:48:06 +0100 (CET) Received: from gemini.denx.de (localhost [IPv6:::1]) by gemini.denx.de (Postfix) with ESMTP id 2B7D31E0CB7; Sun, 7 Nov 2021 15:48:06 +0100 (CET) To: Heiko Thiery cc: u-boot@lists.denx.de, Stefano Babic , Fabio Estevam , Michael Walle , Simon Glass From: Wolfgang Denk Subject: Re: [RFC 0/2] Do not stop with an error when mkimage fails MIME-Version: 1.0 Content-type: text/plain; charset=UTF-8 Content-transfer-encoding: 8bit In-reply-to: References: <20211104185231.2927-1-heiko.thiery@gmail.com> <729199.1636053161@gemini.denx.de> Comments: In-reply-to Heiko Thiery message dated "Thu, 04 Nov 2021 20:31:34 +0100." Date: Sun, 07 Nov 2021 15:48:06 +0100 Message-ID: <963318.1636296486@gemini.denx.de> X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean Dear Heiko, In message 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