* [PATCH] Makefile: Force regeneration of env.txt
@ 2023-09-05 18:09 Andrew Davis
2023-09-05 18:15 ` Andrew Davis
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Davis @ 2023-09-05 18:09 UTC (permalink / raw)
To: Simon Glass, Tom Rini, u-boot; +Cc: Andrew Davis
If the source .env file changes to one that is also older than
the generated env.txt file then it is not regenerated. This means
when switching board configs we do not regenerate the env. This
can be tested easily with:
$ make j721e_evm_a72_defconfig
$ make # this may fail to complete but that is okay for this test
$ make am64x_evm_a53_defconfig
$ make
$ vim include/generated/env.txt
Note this is still the J721e env not the AM64 config as expected.
There is probably a better way to detect if the dependency name changed,
but that may involve extra files and hashing contents, so let's just
force it for now.
Signed-off-by: Andrew Davis <afd@ti.com>
---
Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Makefile b/Makefile
index 9be24c4ec61..d195590d4b0 100644
--- a/Makefile
+++ b/Makefile
@@ -1830,7 +1830,7 @@ quiet_cmd_envc = ENVC $@
touch $@ ; \
fi
-include/generated/env.txt: $(wildcard $(ENV_FILE))
+include/generated/env.txt: $(wildcard $(ENV_FILE)) FORCE
$(call cmd,envc)
# Write out the resulting environment, converted to a C string
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] Makefile: Force regeneration of env.txt
2023-09-05 18:09 [PATCH] Makefile: Force regeneration of env.txt Andrew Davis
@ 2023-09-05 18:15 ` Andrew Davis
2023-09-10 22:36 ` Simon Glass
0 siblings, 1 reply; 4+ messages in thread
From: Andrew Davis @ 2023-09-05 18:15 UTC (permalink / raw)
To: Simon Glass, Tom Rini, u-boot
On 9/5/23 1:09 PM, Andrew Davis wrote:
> If the source .env file changes to one that is also older than
> the generated env.txt file then it is not regenerated. This means
> when switching board configs we do not regenerate the env. This
> can be tested easily with:
>
> $ make j721e_evm_a72_defconfig
> $ make # this may fail to complete but that is okay for this test
> $ make am64x_evm_a53_defconfig
> $ make
> $ vim include/generated/env.txt
>
> Note this is still the J721e env not the AM64 config as expected.
>
> There is probably a better way to detect if the dependency name changed,
> but that may involve extra files and hashing contents, so let's just
> force it for now.
>
> Signed-off-by: Andrew Davis <afd@ti.com>
> ---
This is basically a revert of:
36fc832927eb ("Makefile: Fix incorrect FORCE deps on env rules")
But without changing the `include/generated/env.in` rule. The more
I think about it, that should also be changed to forced as right
now any changes to include/config.h or other kconfig options are
not reflected in the env.in file after updates.
That rule should depend on the generated config file so that any
change in kconfig variables will cause it to regenerate, that
might be what we need for this target instead of FORCE.
Andrew
> Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/Makefile b/Makefile
> index 9be24c4ec61..d195590d4b0 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -1830,7 +1830,7 @@ quiet_cmd_envc = ENVC $@
> touch $@ ; \
> fi
>
> -include/generated/env.txt: $(wildcard $(ENV_FILE))
> +include/generated/env.txt: $(wildcard $(ENV_FILE)) FORCE
> $(call cmd,envc)
>
> # Write out the resulting environment, converted to a C string
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Makefile: Force regeneration of env.txt
2023-09-05 18:15 ` Andrew Davis
@ 2023-09-10 22:36 ` Simon Glass
2023-09-15 14:43 ` Andrew Davis
0 siblings, 1 reply; 4+ messages in thread
From: Simon Glass @ 2023-09-10 22:36 UTC (permalink / raw)
To: Andrew Davis; +Cc: Tom Rini, u-boot
Hi Andrew,
On Tue, 5 Sept 2023 at 12:15, Andrew Davis <afd@ti.com> wrote:
>
> On 9/5/23 1:09 PM, Andrew Davis wrote:
> > If the source .env file changes to one that is also older than
> > the generated env.txt file then it is not regenerated. This means
> > when switching board configs we do not regenerate the env. This
> > can be tested easily with:
> >
> > $ make j721e_evm_a72_defconfig
> > $ make # this may fail to complete but that is okay for this test
> > $ make am64x_evm_a53_defconfig
> > $ make
> > $ vim include/generated/env.txt
> >
> > Note this is still the J721e env not the AM64 config as expected.
> >
> > There is probably a better way to detect if the dependency name changed,
> > but that may involve extra files and hashing contents, so let's just
> > force it for now.
> >
> > Signed-off-by: Andrew Davis <afd@ti.com>
> > ---
>
> This is basically a revert of:
> 36fc832927eb ("Makefile: Fix incorrect FORCE deps on env rules")
>
> But without changing the `include/generated/env.in` rule. The more
> I think about it, that should also be changed to forced as right
> now any changes to include/config.h or other kconfig options are
> not reflected in the env.in file after updates.
>
> That rule should depend on the generated config file so that any
> change in kconfig variables will cause it to regenerate, that
> might be what we need for this target instead of FORCE.
>
> Andrew
>
> > Makefile | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/Makefile b/Makefile
> > index 9be24c4ec61..d195590d4b0 100644
> > --- a/Makefile
> > +++ b/Makefile
> > @@ -1830,7 +1830,7 @@ quiet_cmd_envc = ENVC $@
> > touch $@ ; \
> > fi
> >
> > -include/generated/env.txt: $(wildcard $(ENV_FILE))
> > +include/generated/env.txt: $(wildcard $(ENV_FILE)) FORCE
> > $(call cmd,envc)
I thought that FORCE was only for if_changed - see makefiles.rst.txt
Could it depend on autoconf.h instead?
> >
> > # Write out the resulting environment, converted to a C string
Regards,
Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] Makefile: Force regeneration of env.txt
2023-09-10 22:36 ` Simon Glass
@ 2023-09-15 14:43 ` Andrew Davis
0 siblings, 0 replies; 4+ messages in thread
From: Andrew Davis @ 2023-09-15 14:43 UTC (permalink / raw)
To: Simon Glass; +Cc: Tom Rini, u-boot
On 9/10/23 5:36 PM, Simon Glass wrote:
> Hi Andrew,
>
> On Tue, 5 Sept 2023 at 12:15, Andrew Davis <afd@ti.com> wrote:
>>
>> On 9/5/23 1:09 PM, Andrew Davis wrote:
>>> If the source .env file changes to one that is also older than
>>> the generated env.txt file then it is not regenerated. This means
>>> when switching board configs we do not regenerate the env. This
>>> can be tested easily with:
>>>
>>> $ make j721e_evm_a72_defconfig
>>> $ make # this may fail to complete but that is okay for this test
>>> $ make am64x_evm_a53_defconfig
>>> $ make
>>> $ vim include/generated/env.txt
>>>
>>> Note this is still the J721e env not the AM64 config as expected.
>>>
>>> There is probably a better way to detect if the dependency name changed,
>>> but that may involve extra files and hashing contents, so let's just
>>> force it for now.
>>>
>>> Signed-off-by: Andrew Davis <afd@ti.com>
>>> ---
>>
>> This is basically a revert of:
>> 36fc832927eb ("Makefile: Fix incorrect FORCE deps on env rules")
>>
>> But without changing the `include/generated/env.in` rule. The more
>> I think about it, that should also be changed to forced as right
>> now any changes to include/config.h or other kconfig options are
>> not reflected in the env.in file after updates.
>>
>> That rule should depend on the generated config file so that any
>> change in kconfig variables will cause it to regenerate, that
>> might be what we need for this target instead of FORCE.
>
>
>
>>
>> Andrew
>>
>>> Makefile | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/Makefile b/Makefile
>>> index 9be24c4ec61..d195590d4b0 100644
>>> --- a/Makefile
>>> +++ b/Makefile
>>> @@ -1830,7 +1830,7 @@ quiet_cmd_envc = ENVC $@
>>> touch $@ ; \
>>> fi
>>>
>>> -include/generated/env.txt: $(wildcard $(ENV_FILE))
>>> +include/generated/env.txt: $(wildcard $(ENV_FILE)) FORCE
>>> $(call cmd,envc)
>
> I thought that FORCE was only for if_changed - see makefiles.rst.txt
>
> Could it depend on autoconf.h instead?
>
That works, sending v2, thanks!
Andrew
>>>
>>> # Write out the resulting environment, converted to a C string
>
> Regards,
> Simon
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-09-15 14:43 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-05 18:09 [PATCH] Makefile: Force regeneration of env.txt Andrew Davis
2023-09-05 18:15 ` Andrew Davis
2023-09-10 22:36 ` Simon Glass
2023-09-15 14:43 ` Andrew Davis
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.