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 A9469C433F5 for ; Tue, 9 Nov 2021 19:42:36 +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 03E3F61055 for ; Tue, 9 Nov 2021 19:42:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 03E3F61055 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com 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 28FD283571; Tue, 9 Nov 2021 20:42:34 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="gI9eo/+9"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 544B582C6D; Tue, 9 Nov 2021 20:42:32 +0100 (CET) Received: from mail-qk1-x731.google.com (mail-qk1-x731.google.com [IPv6:2607:f8b0:4864:20::731]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 892BF83925 for ; Tue, 9 Nov 2021 20:42:28 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qk1-x731.google.com with SMTP id bl12so175566qkb.13 for ; Tue, 09 Nov 2021 11:42:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=cMWC4z6CKIN2dYlEvEwqUe93tciGEsOdcUTPshK7eOU=; b=gI9eo/+9bSNgrv1d9wCoYBdA53m2vyTnsrM8HJIbeM41K+Z+3hW0PL8bvSunRlyZEO XXIkBi+oRA0KvXUVHVH3PL5Pbsn+H8qgilSuS+L/TL+LDtJRszVgh/fwfTYUZcmP2ZeS oMA8ibc8z6PdB/Yk0u5WaJIW15GpexUJ/T1HA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=cMWC4z6CKIN2dYlEvEwqUe93tciGEsOdcUTPshK7eOU=; b=XlwcTrLixWukrAECgAJk2Db9TywhNBBjZffNIR8EWN8UWI0Uy7IdkmkEqFnX2+7VhM m5XkNz3QOv8GZpVW6Q4O4NbFzDZ7FUrrVE9yN6NmiLOaN/tw8A2YQxMADDcLNEjie1Zj Mq2ncFGImBCpmiLNgUmY/LESCbxlYF9eBMpCAsJTH34OxViG9vNzbKmpGKvfi2tZ4/Pm 7ZjXXza3OBhDQVCSJxI61mu3m/9WfOmvfSEZgYef6OiuTtSDwr5YDlQ4+FiT8GT+H2PG MwSL2ELdAGigIorbBRj+uplk/Qo7IRVJd+BsVCUIZ5jZ6j+jJwllYI44GUzjA7Sn2RIt 2KpQ== X-Gm-Message-State: AOAM530tVcOZnBtv2fsN7KcV+kwX7gyv73Z/WVQgugRtJRsdAERn0UXb fbXn7cngNTi8dIXUg0UuGHC3Vw== X-Google-Smtp-Source: ABdhPJyWkvbKxt5EnsEp1lrqZnqA3cYJkk9Qqqiricu/TC91goaU+7C5HibO9SdWwp3kQAd7lar60g== X-Received: by 2002:a05:620a:1232:: with SMTP id v18mr8125203qkj.261.1636486947374; Tue, 09 Nov 2021 11:42:27 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-74ad-b320-81ce-4688.res6.spectrum.com. [2603:6081:7b01:cbda:74ad:b320:81ce:4688]) by smtp.gmail.com with ESMTPSA id r3sm5946037qtw.44.2021.11.09.11.42.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Nov 2021 11:42:26 -0800 (PST) Date: Tue, 9 Nov 2021 14:42:24 -0500 From: Tom Rini To: Heiko Thiery Cc: Wolfgang Denk , u-boot@lists.denx.de, Stefano Babic , Fabio Estevam , Michael Walle , Simon Glass Subject: Re: [RFC 0/2] Do not stop with an error when mkimage fails Message-ID: <20211109194224.GB24579@bill-the-cat> References: <20211104185231.2927-1-heiko.thiery@gmail.com> <729199.1636053161@gemini.denx.de> <963318.1636296486@gemini.denx.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="t3gi4nlwTrs/7W9N" Content-Disposition: inline In-Reply-To: X-Clacks-Overhead: GNU Terry Pratchett 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 --t3gi4nlwTrs/7W9N Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 09, 2021 at 08:21:07PM +0100, Heiko Thiery wrote: > Hi Wolfgang, >=20 > Am So., 7. Nov. 2021 um 15:48 Uhr schrieb Wolfgang Denk : > > > > 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 requir= es an > > > > > external binary (signed_hdmi_imx8m.bin). If this file cannot be f= ound > > > > > 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, o= utput_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.mkim= age > > > -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. >=20 > The only reason I want to introduce this is because I want to have my > imx8mq board built by CI. This board needs an external HDMI firmware > which is used by mkimage. But because this firmware is not available > in the CI build, it comes to the abort. With other boards it is also > so that in the CI external blobs are not available and these make > nevertheless without error a binman run. In this case only a warning > is output. >=20 > I know this is not a perfect solution but I don't know how to get my > board merged without doing this kind of workaround for the U-Boot CI. Unfortunately in these days of needing multiple inputs to create a functional image and also needing to have CI be able to be at all useful, what we do in many many many cases is yell loudly to the user that the resulting file here will NOT work and why. So yes, some "yell it won't work but not return non-zero exit status" is the norm. I would be very much open however to some way to handle this differently. Some environment variable our tools check for and then yell-but-succeed? Some other idea? I'm just thinking out loud here. --=20 Tom --t3gi4nlwTrs/7W9N Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmGKzyAACgkQFHw5/5Y0 tywlYQv/QEJZZS0FipsCVrsd696IV7oxZxcSCQNG6elpprQ0jgBfdALLQeyRSZW8 5ybl+OjAh0XGa3lEX9K6SNMB2uwmTQ3RCTEIx2l0HMdyevnDLf79Mcfa0W2cEi1q nzmml9XFn6sxkTySYEQKBzEajKTMQoetQsEnV9LHrDPDA681mmBke26u3ADcOsz6 v08XPdu/WBVjkvG74S0qHaZG/t44m7hZK1DvmkS1nYb4dOnspwnvvFHYRavUFRMP hB5yhkDf8r0KXFYq7jNWdYLZ7jeVyDCI1nKeS23mYHgZm0takmoMN09dbpFcJrL/ F6OD2LXRjPwg+WO9qQjZHF2Jcy+19Avk+9yeenw8TvsZVMMrZ989prdpVW8XoRom yLjGQW4+2phpHp4Ip7T4rncjrP57Rm8zC1AlGv+DCi8qemMkPhTIUtWSFKqYZayz u10ga+MqO4qf2760roq49pVkuIs452PETuuh/7LY7PZV/VsziWnOoeeqRVVvcjqu BXgEupcV =F4eH -----END PGP SIGNATURE----- --t3gi4nlwTrs/7W9N--