All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] env: Avoid using a leftover text-environment file
@ 2022-03-12  5:37 Simon Glass
  2022-03-12  5:42 ` Sean Anderson
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Glass @ 2022-03-12  5:37 UTC (permalink / raw)
  To: U-Boot Mailing List
  Cc: Simon Glass, Sean Anderson, Joe Hershberger, Marek Behún

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 <sjg@chromium.org>
Reported-by: Sean Anderson <seanga2@gmail.com>
---

 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
-- 
2.35.1.723.g4982287a31-goog


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] env: Avoid using a leftover text-environment file
  2022-03-12  5:37 [PATCH] env: Avoid using a leftover text-environment file Simon Glass
@ 2022-03-12  5:42 ` Sean Anderson
  2022-04-01  0:14 ` Sean Anderson
  2022-04-01  1:19 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Sean Anderson @ 2022-03-12  5:42 UTC (permalink / raw)
  To: Simon Glass, U-Boot Mailing List; +Cc: Joe Hershberger, Marek Behún

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 <sjg@chromium.org>
> Reported-by: Sean Anderson <seanga2@gmail.com>
> ---
> 
>   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 <seanga2@gmail.com>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] env: Avoid using a leftover text-environment file
  2022-03-12  5:37 [PATCH] env: Avoid using a leftover text-environment file Simon Glass
  2022-03-12  5:42 ` Sean Anderson
@ 2022-04-01  0:14 ` Sean Anderson
  2022-04-01  1:19 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Sean Anderson @ 2022-04-01  0:14 UTC (permalink / raw)
  To: Simon Glass, U-Boot Mailing List, Tom Rini
  Cc: Joe Hershberger, Marek Behún

Hi Tom,

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 <sjg@chromium.org>
> Reported-by: Sean Anderson <seanga2@gmail.com>
> ---
> 
>   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
> 

Can you pick this up for the release? I find myself needing to dig it up and apply
it every time I build sandbox then go back to another board.

--Sean

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] env: Avoid using a leftover text-environment file
  2022-03-12  5:37 [PATCH] env: Avoid using a leftover text-environment file Simon Glass
  2022-03-12  5:42 ` Sean Anderson
  2022-04-01  0:14 ` Sean Anderson
@ 2022-04-01  1:19 ` Tom Rini
  2 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2022-04-01  1:19 UTC (permalink / raw)
  To: Simon Glass
  Cc: U-Boot Mailing List, Sean Anderson, Joe Hershberger, Marek Behún

[-- Attachment #1: Type: text/plain, Size: 600 bytes --]

On Fri, Mar 11, 2022 at 10:37:23PM -0700, 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 <sjg@chromium.org>
> Reported-by: Sean Anderson <seanga2@gmail.com>
> Tested-by: Sean Anderson <seanga2@gmail.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-04-01  1:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-12  5:37 [PATCH] env: Avoid using a leftover text-environment file Simon Glass
2022-03-12  5:42 ` Sean Anderson
2022-04-01  0:14 ` Sean Anderson
2022-04-01  1:19 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.