diff mbox series

[08/31] configure: ensure dependency for cross-compile setup

Message ID 20230925144854.1872513-9-alex.bennee@linaro.org
State New
Headers show
Series September maintainer omnibus (tests, gdbstub, plugins) | expand

Commit Message

Alex Bennée Sept. 25, 2023, 2:48 p.m. UTC
If we update configure we should make sure we regenerate all the
compiler details. We should also ensure those details are upto date
before building the TCG tests.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 configure | 2 ++
 1 file changed, 2 insertions(+)

Comments

Paolo Bonzini Sept. 25, 2023, 4:14 p.m. UTC | #1
On 9/25/23 16:48, Alex Bennée wrote:
> If we update configure we should make sure we regenerate all the
> compiler details. We should also ensure those details are upto date
> before building the TCG tests.
> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>   configure | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/configure b/configure
> index e83872571d..a95e0f5767 100755
> --- a/configure
> +++ b/configure
> @@ -1788,6 +1788,8 @@ for target in $target_list; do
>             echo "HOST_GDB_SUPPORTS_ARCH=y" >> "$config_target_mak"
>         fi
>   
> +      echo "$config_target_mak: configure" >> Makefile.prereqs

This in practice is not adding anything; if "configure" changes then 
Makefile's dependency on config-host.mak will trigger a configure rerun 
anyway.

If you want to add it, you should also add it for other config-*.mak 
files.  However, I'd remove this line and just change

-# 1. ensure config-host.mak is up-to-date
+# 1. ensure config-host.mak is up-to-date.  All other config-*.mak
+# files for subdirectories will be updated as well.

in the Makefile.

Paolo
Alex Bennée Sept. 25, 2023, 4:42 p.m. UTC | #2
Paolo Bonzini <pbonzini@redhat.com> writes:

> On 9/25/23 16:48, Alex Bennée wrote:
>> If we update configure we should make sure we regenerate all the
>> compiler details. We should also ensure those details are upto date
>> before building the TCG tests.
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>   configure | 2 ++
>>   1 file changed, 2 insertions(+)
>> diff --git a/configure b/configure
>> index e83872571d..a95e0f5767 100755
>> --- a/configure
>> +++ b/configure
>> @@ -1788,6 +1788,8 @@ for target in $target_list; do
>>             echo "HOST_GDB_SUPPORTS_ARCH=y" >> "$config_target_mak"
>>         fi
>>   +      echo "$config_target_mak: configure" >> Makefile.prereqs
>
> This in practice is not adding anything; if "configure" changes then
> Makefile's dependency on config-host.mak will trigger a configure
> rerun anyway.
>
> If you want to add it, you should also add it for other config-*.mak
> files.  However, I'd remove this line and just change
>
> -# 1. ensure config-host.mak is up-to-date
> +# 1. ensure config-host.mak is up-to-date.  All other config-*.mak
> +# files for subdirectories will be updated as well.

Peter ran into a mismatch between config-host.mak and
tests/tcg/foo/config-target.mak in his build system so it didn't get
picked up at one point.

>
> in the Makefile.
>
> Paolo
Paolo Bonzini Sept. 25, 2023, 5:06 p.m. UTC | #3
Il lun 25 set 2023, 18:45 Alex Bennée <alex.bennee@linaro.org> ha scritto:

> Paolo Bonzini <pbonzini@redhat.com> writes:
> > On 9/25/23 16:48, Alex Bennée wrote:
> >>             echo "HOST_GDB_SUPPORTS_ARCH=y" >> "$config_target_mak"
> >>         fi
> >>   +      echo "$config_target_mak: configure" >> Makefile.prereqs
> >
> > This in practice is not adding anything; if "configure" changes then
> > Makefile's dependency on config-host.mak will trigger a configure
> > rerun anyway.
> >
> > If you want to add it, you should also add it for other config-*.mak
> > files.  However, I'd remove this line and just change
> >
> > -# 1. ensure config-host.mak is up-to-date
> > +# 1. ensure config-host.mak is up-to-date.  All other config-*.mak
> > +# files for subdirectories will be updated as well.
>
> Peter ran into a mismatch between config-host.mak and
> tests/tcg/foo/config-target.mak in his build system so it didn't get
> picked up at one point.
>

But what is the rule that the new dependency is going to trigger? As far as
I can see there is no rule to regenerate the $config_target_mak files, and
also no rule to regenerate configure; the only effect of a change to
configure will be rerunning the script, but that's triggered by the
existing config-host.mak rule.

Paolo


> >
> > in the Makefile.
> >
> > Paolo
>
>
> --
> Alex Bennée
> Virtualisation Tech Lead @ Linaro
>
>
Peter Maydell Sept. 25, 2023, 5:09 p.m. UTC | #4
On Mon, 25 Sept 2023 at 17:45, Alex Bennée <alex.bennee@linaro.org> wrote:
>
>
> Paolo Bonzini <pbonzini@redhat.com> writes:
>
> > On 9/25/23 16:48, Alex Bennée wrote:
> >> If we update configure we should make sure we regenerate all the
> >> compiler details. We should also ensure those details are upto date
> >> before building the TCG tests.
> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> >> ---
> >>   configure | 2 ++
> >>   1 file changed, 2 insertions(+)
> >> diff --git a/configure b/configure
> >> index e83872571d..a95e0f5767 100755
> >> --- a/configure
> >> +++ b/configure
> >> @@ -1788,6 +1788,8 @@ for target in $target_list; do
> >>             echo "HOST_GDB_SUPPORTS_ARCH=y" >> "$config_target_mak"
> >>         fi
> >>   +      echo "$config_target_mak: configure" >> Makefile.prereqs
> >
> > This in practice is not adding anything; if "configure" changes then
> > Makefile's dependency on config-host.mak will trigger a configure
> > rerun anyway.
> >
> > If you want to add it, you should also add it for other config-*.mak
> > files.  However, I'd remove this line and just change
> >
> > -# 1. ensure config-host.mak is up-to-date
> > +# 1. ensure config-host.mak is up-to-date.  All other config-*.mak
> > +# files for subdirectories will be updated as well.
>
> Peter ran into a mismatch between config-host.mak and
> tests/tcg/foo/config-target.mak in his build system so it didn't get
> picked up at one point.

I did, but looking at the timestamps on the two files, the
problem wasn't that one file got updated and not the other:

$ grep CONFIG_PLUGIN build/x86/config-host.h
#undef CONFIG_PLUGIN
$ grep CONFIG_PLUGIN build/x86/tests/tcg/config-host.mak
CONFIG_PLUGIN=y
e104462:jammy:qemu$ ls -l build/x86/config-host.mak
build/x86/tests/tcg/config-host.mak
-rw-r--r-- 1 petmay01 petmay01 549 Sep 22 16:38 build/x86/config-host.mak
-rw-r--r-- 1 petmay01 petmay01 159 Sep 22 16:38
build/x86/tests/tcg/config-host.mak

(both newer than 'configure' itself by about 10 days.)

-- PMM
diff mbox series

Patch

diff --git a/configure b/configure
index e83872571d..a95e0f5767 100755
--- a/configure
+++ b/configure
@@ -1788,6 +1788,8 @@  for target in $target_list; do
           echo "HOST_GDB_SUPPORTS_ARCH=y" >> "$config_target_mak"
       fi
 
+      echo "$config_target_mak: configure" >> Makefile.prereqs
+      echo "build-tcg-tests-$target: $config_target_mak" >> Makefile.prereqs
       echo "run-tcg-tests-$target: $qemu\$(EXESUF)" >> Makefile.prereqs
       tcg_tests_targets="$tcg_tests_targets $target"
   fi