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 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 smtp.lore.kernel.org (Postfix) with ESMTPS id EC267C433EF for ; Sat, 12 Mar 2022 05:42:36 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 1A0CC83AFF; Sat, 12 Mar 2022 06:42:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="AyXTQjDB"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44BBC83B06; Sat, 12 Mar 2022 06:42:33 +0100 (CET) Received: from mail-qv1-xf30.google.com (mail-qv1-xf30.google.com [IPv6:2607:f8b0:4864:20::f30]) (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 BE81683AF5 for ; Sat, 12 Mar 2022 06:42:29 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qv1-xf30.google.com with SMTP id j5so8573947qvs.13 for ; Fri, 11 Mar 2022 21:42:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=AF/xvBitBfzDWU4KOotDzdG5yjLljH7IvzagBhM0QGM=; b=AyXTQjDBFA4+A8EYFugF4gOmCqnwNrTH9AlAibCiF6RTCSBuw2PsYiRH1ejYrRZ/LB 5FYBEgjs4B+Hy1+FGAiUFLM0WaswgSx4s6HpI9beXYedss/3+S8Ra2YWKTswJ8Qkb6Wm Uy7RV9Kt7Wv6ZB72qUa8LtLUYyHDlb8vHPyRtld6LcLz/NhSD0Ec0gHXN0dIAQ+N0zQL 4YqhPmY3rDLWQCdEtMp6jAne7i4iFauu29nETWec8WF5W894GKIK4chi7xqGgwZr+jny qvNn5USi9BPEFTvrWtui9Knuy2ThN++pxPEVOEOPj5zs2AR2txRfEYLM8ER4QewXDtNa OVxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=AF/xvBitBfzDWU4KOotDzdG5yjLljH7IvzagBhM0QGM=; b=BJdpO1GQ612tTA5kTpBG7C2NxtVZ0wi6booHLmKa/SNGPMsliWU5CgfI7L0vkD8iMb FPX2/ePmUhC1ZXH9EyGnhVoeLaooLK00blcawaGsG4pTGYEKERvI2N1wh/0MxFQbBgyo ygE7/SMhI7k5Q14C+QeYLEJ3LYH3R3rb0GNBF9+SH4IvFbP31Y19Ibo2ZLUqJChj7LF8 4BbvjVD6vYYZq3CjECgYFE3xuKjMNRZdkbMoEE9NSNh/bu67XumrHS2WH4F6AHjUSvSO qKECDw5l5/eq/uggE7Au3bWhlX7gxL875epBmPjdxm5UrBkluicK0BIbHmvZxl3ccapx PU1A== X-Gm-Message-State: AOAM530hGogCFGRoTFZqDK6GRm0V/E3tw9XfUnpS44sfrMlK86+o/6GR JDGSZ8tf9m0xsWDRzPkv/34= X-Google-Smtp-Source: ABdhPJw+k97ON55VjXCbX29qIRWU+uaVySrp7orJWULCR+Wuqz5z7QAgpux1VRtvLB4SOOn7I20PXA== X-Received: by 2002:a05:6214:248b:b0:435:d123:d05e with SMTP id gi11-20020a056214248b00b00435d123d05emr9882345qvb.36.1647063748451; Fri, 11 Mar 2022 21:42:28 -0800 (PST) Received: from [192.168.1.201] (pool-108-18-137-133.washdc.fios.verizon.net. [108.18.137.133]) by smtp.googlemail.com with ESMTPSA id 145-20020a370897000000b0067b30c65415sm5036272qki.75.2022.03.11.21.42.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 11 Mar 2022 21:42:27 -0800 (PST) Subject: Re: [PATCH] env: Avoid using a leftover text-environment file To: Simon Glass , U-Boot Mailing List Cc: Joe Hershberger , =?UTF-8?Q?Marek_Beh=c3=ban?= References: <20220312053723.517229-1-sjg@chromium.org> From: Sean Anderson Message-ID: Date: Sat, 12 Mar 2022 00:42:27 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: <20220312053723.517229-1-sjg@chromium.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 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.5 at phobos.denx.de X-Virus-Status: Clean On 3/12/22 12:37 AM, Simon Glass wrote: > If include/generated/environment.h exists (perhaps leftover from a build > of another board) it is used, even if the board currently being built does > not have a text environment. > > This causes a build error. Fix it by emptying the file if it should not be > there. > > Fixes: https://source.denx.de/u-boot/u-boot/-/issues/9 > Signed-off-by: Simon Glass > Reported-by: Sean Anderson > --- > > Makefile | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index 9ef34ca4b7f..2351d6dacd2 100644 > --- a/Makefile > +++ b/Makefile > @@ -1834,7 +1834,9 @@ ENV_FILE := $(if $(ENV_SOURCE_FILE),$(ENV_FILE_CFG),$(wildcard $(ENV_FILE_BOARD) > > # Run the environment text file through the preprocessor, but only if it is > # non-empty, to save time and possible build errors if something is wonky with > -# the board > +# the board. > +# If there is no ENV_FILE, produce an empty output file, to prevent a previous > +# build's file being used in the case of in-tree builds. > quiet_cmd_gen_envp = ENVP $@ > cmd_gen_envp = \ > if [ -s "$(ENV_FILE)" ]; then \ > @@ -1845,6 +1847,7 @@ quiet_cmd_gen_envp = ENVP $@ > -I$(srctree)/arch/$(ARCH)/include \ > $< -o $@; \ > else \ > + rm $@; \ > touch $@ ; \ > fi > include/generated/env.in: include/generated/env.txt FORCE > Thanks! Tested-by: Sean Anderson