[Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles

Paolo Bonzini posted 3 patches 4 years, 8 months ago
Test asan passed
Test docker-mingw@fedora passed
Test FreeBSD passed
Test docker-clang@ubuntu passed
Test checkpatch failed
Test s390x passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20190730123759.21723-1-pbonzini@redhat.com
Maintainers: Peter Maydell <peter.maydell@linaro.org>, Max Filippov <jcmvbkbc@gmail.com>, Eduardo Habkost <ehabkost@redhat.com>, Richard Henderson <rth@twiddle.net>, "Alex Bennée" <alex.bennee@linaro.org>, Paolo Bonzini <pbonzini@redhat.com>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
There is a newer version of this series
Makefile                                  |   1 +
Makefile.target                           |   3 -
configure                                 | 155 ++------------------
tests/Makefile.include                    |  25 ++--
tests/tcg/Makefile.include                |  88 ------------
tests/tcg/Makefile.prereqs                |  18 +++
tests/tcg/Makefile.probe                  |  31 ----
tests/tcg/Makefile.qemu                   |  95 +++++++++++++
tests/tcg/{Makefile => Makefile.target}   |  15 +-
tests/tcg/aarch64/Makefile.include        |   8 --
tests/tcg/aarch64/Makefile.softmmu-target |   4 +-
tests/tcg/aarch64/Makefile.target         |  12 +-
tests/tcg/alpha/Makefile.include          |   2 -
tests/tcg/alpha/Makefile.softmmu-target   |   4 +-
tests/tcg/arm/Makefile.include            |   8 --
tests/tcg/arm/Makefile.softmmu-target     |   6 +-
tests/tcg/configure.sh                    | 228 ++++++++++++++++++++++++++++++
tests/tcg/cris/Makefile.include           |   6 -
tests/tcg/hppa/Makefile.include           |   2 -
tests/tcg/i386/Makefile.include           |   9 --
tests/tcg/i386/Makefile.softmmu-target    |  12 +-
tests/tcg/i386/Makefile.target            |  13 +-
tests/tcg/m68k/Makefile.include           |   2 -
tests/tcg/minilib/Makefile.target         |   2 +-
tests/tcg/mips/Makefile.include           |  20 ---
tests/tcg/ppc/Makefile.include            |  10 --
tests/tcg/riscv/Makefile.include          |  10 --
tests/tcg/s390x/Makefile.include          |   2 -
tests/tcg/sh4/Makefile.include            |   4 -
tests/tcg/sparc64/Makefile.include        |   2 -
tests/tcg/x86_64/Makefile.softmmu-target  |  36 +++++
tests/tcg/x86_64/Makefile.target          |   7 +-
tests/tcg/xtensa/Makefile.include         |  11 --
tests/tcg/xtensa/Makefile.softmmu-target  |   4 +-
34 files changed, 435 insertions(+), 420 deletions(-)
delete mode 100644 tests/tcg/Makefile.include
create mode 100644 tests/tcg/Makefile.prereqs
delete mode 100644 tests/tcg/Makefile.probe
create mode 100644 tests/tcg/Makefile.qemu
rename tests/tcg/{Makefile => Makefile.target} (90%)
delete mode 100644 tests/tcg/aarch64/Makefile.include
delete mode 100644 tests/tcg/alpha/Makefile.include
delete mode 100644 tests/tcg/arm/Makefile.include
create mode 100644 tests/tcg/configure.sh
delete mode 100644 tests/tcg/cris/Makefile.include
delete mode 100644 tests/tcg/hppa/Makefile.include
delete mode 100644 tests/tcg/i386/Makefile.include
delete mode 100644 tests/tcg/m68k/Makefile.include
delete mode 100644 tests/tcg/mips/Makefile.include
delete mode 100644 tests/tcg/ppc/Makefile.include
delete mode 100644 tests/tcg/riscv/Makefile.include
delete mode 100644 tests/tcg/s390x/Makefile.include
delete mode 100644 tests/tcg/sh4/Makefile.include
delete mode 100644 tests/tcg/sparc64/Makefile.include
create mode 100644 tests/tcg/x86_64/Makefile.softmmu-target
delete mode 100644 tests/tcg/xtensa/Makefile.include
[Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Posted by Paolo Bonzini 4 years, 8 months ago
The tests/tcg rely a lot on per-target informations from
the QEMU makefiles, but most of the definitions in there
aren't really relevant to TCG tests.

This series is just a cleanup, but it could also be
a useful start in making it possible to compile tests/tcg
out of QEMU's tree, and/or making it a submodule, and/or
unifying the system emulation tests with kvm-unit-tests.

Paolo

Paolo Bonzini (3):
  tests/tcg: use EXTRA_CFLAGS everywhere
  tests/tcg: cleanup Makefile inclusions
  tests/tcg: move configuration to a sub-shell script

 Makefile                                  |   1 +
 Makefile.target                           |   3 -
 configure                                 | 155 ++------------------
 tests/Makefile.include                    |  25 ++--
 tests/tcg/Makefile.include                |  88 ------------
 tests/tcg/Makefile.prereqs                |  18 +++
 tests/tcg/Makefile.probe                  |  31 ----
 tests/tcg/Makefile.qemu                   |  95 +++++++++++++
 tests/tcg/{Makefile => Makefile.target}   |  15 +-
 tests/tcg/aarch64/Makefile.include        |   8 --
 tests/tcg/aarch64/Makefile.softmmu-target |   4 +-
 tests/tcg/aarch64/Makefile.target         |  12 +-
 tests/tcg/alpha/Makefile.include          |   2 -
 tests/tcg/alpha/Makefile.softmmu-target   |   4 +-
 tests/tcg/arm/Makefile.include            |   8 --
 tests/tcg/arm/Makefile.softmmu-target     |   6 +-
 tests/tcg/configure.sh                    | 228 ++++++++++++++++++++++++++++++
 tests/tcg/cris/Makefile.include           |   6 -
 tests/tcg/hppa/Makefile.include           |   2 -
 tests/tcg/i386/Makefile.include           |   9 --
 tests/tcg/i386/Makefile.softmmu-target    |  12 +-
 tests/tcg/i386/Makefile.target            |  13 +-
 tests/tcg/m68k/Makefile.include           |   2 -
 tests/tcg/minilib/Makefile.target         |   2 +-
 tests/tcg/mips/Makefile.include           |  20 ---
 tests/tcg/ppc/Makefile.include            |  10 --
 tests/tcg/riscv/Makefile.include          |  10 --
 tests/tcg/s390x/Makefile.include          |   2 -
 tests/tcg/sh4/Makefile.include            |   4 -
 tests/tcg/sparc64/Makefile.include        |   2 -
 tests/tcg/x86_64/Makefile.softmmu-target  |  36 +++++
 tests/tcg/x86_64/Makefile.target          |   7 +-
 tests/tcg/xtensa/Makefile.include         |  11 --
 tests/tcg/xtensa/Makefile.softmmu-target  |   4 +-
 34 files changed, 435 insertions(+), 420 deletions(-)
 delete mode 100644 tests/tcg/Makefile.include
 create mode 100644 tests/tcg/Makefile.prereqs
 delete mode 100644 tests/tcg/Makefile.probe
 create mode 100644 tests/tcg/Makefile.qemu
 rename tests/tcg/{Makefile => Makefile.target} (90%)
 delete mode 100644 tests/tcg/aarch64/Makefile.include
 delete mode 100644 tests/tcg/alpha/Makefile.include
 delete mode 100644 tests/tcg/arm/Makefile.include
 create mode 100644 tests/tcg/configure.sh
 delete mode 100644 tests/tcg/cris/Makefile.include
 delete mode 100644 tests/tcg/hppa/Makefile.include
 delete mode 100644 tests/tcg/i386/Makefile.include
 delete mode 100644 tests/tcg/m68k/Makefile.include
 delete mode 100644 tests/tcg/mips/Makefile.include
 delete mode 100644 tests/tcg/ppc/Makefile.include
 delete mode 100644 tests/tcg/riscv/Makefile.include
 delete mode 100644 tests/tcg/s390x/Makefile.include
 delete mode 100644 tests/tcg/sh4/Makefile.include
 delete mode 100644 tests/tcg/sparc64/Makefile.include
 create mode 100644 tests/tcg/x86_64/Makefile.softmmu-target
 delete mode 100644 tests/tcg/xtensa/Makefile.include

-- 
1.8.3.1


Re: [Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Posted by Alex Bennée 4 years, 8 months ago
Paolo Bonzini <pbonzini@redhat.com> writes:

> The tests/tcg rely a lot on per-target informations from
> the QEMU makefiles, but most of the definitions in there
> aren't really relevant to TCG tests.
>
> This series is just a cleanup, but it could also be
> a useful start in making it possible to compile tests/tcg
> out of QEMU's tree, and/or making it a submodule, and/or
> unifying the system emulation tests with kvm-unit-tests.

Hmm something is throwing off configure and making it use my login shell
instead of /bin/sh:

  libpmem support   no
  libudev           yes
  default devices   yes
  ~/lsrc/qemu.git/tests/tcg/configure.sh (line 63): 'case' builtin not inside of switch block
    case $arch in
    ^
  <W> fish: Error while reading file /home/alex/lsrc/qemu.git/tests/tcg/configure.sh

>
> Paolo
>
> Paolo Bonzini (3):
>   tests/tcg: use EXTRA_CFLAGS everywhere
>   tests/tcg: cleanup Makefile inclusions
>   tests/tcg: move configuration to a sub-shell script
>
>  Makefile                                  |   1 +
>  Makefile.target                           |   3 -
>  configure                                 | 155 ++------------------
>  tests/Makefile.include                    |  25 ++--
>  tests/tcg/Makefile.include                |  88 ------------
>  tests/tcg/Makefile.prereqs                |  18 +++
>  tests/tcg/Makefile.probe                  |  31 ----
>  tests/tcg/Makefile.qemu                   |  95 +++++++++++++
>  tests/tcg/{Makefile => Makefile.target}   |  15 +-
>  tests/tcg/aarch64/Makefile.include        |   8 --
>  tests/tcg/aarch64/Makefile.softmmu-target |   4 +-
>  tests/tcg/aarch64/Makefile.target         |  12 +-
>  tests/tcg/alpha/Makefile.include          |   2 -
>  tests/tcg/alpha/Makefile.softmmu-target   |   4 +-
>  tests/tcg/arm/Makefile.include            |   8 --
>  tests/tcg/arm/Makefile.softmmu-target     |   6 +-
>  tests/tcg/configure.sh                    | 228 ++++++++++++++++++++++++++++++
>  tests/tcg/cris/Makefile.include           |   6 -
>  tests/tcg/hppa/Makefile.include           |   2 -
>  tests/tcg/i386/Makefile.include           |   9 --
>  tests/tcg/i386/Makefile.softmmu-target    |  12 +-
>  tests/tcg/i386/Makefile.target            |  13 +-
>  tests/tcg/m68k/Makefile.include           |   2 -
>  tests/tcg/minilib/Makefile.target         |   2 +-
>  tests/tcg/mips/Makefile.include           |  20 ---
>  tests/tcg/ppc/Makefile.include            |  10 --
>  tests/tcg/riscv/Makefile.include          |  10 --
>  tests/tcg/s390x/Makefile.include          |   2 -
>  tests/tcg/sh4/Makefile.include            |   4 -
>  tests/tcg/sparc64/Makefile.include        |   2 -
>  tests/tcg/x86_64/Makefile.softmmu-target  |  36 +++++
>  tests/tcg/x86_64/Makefile.target          |   7 +-
>  tests/tcg/xtensa/Makefile.include         |  11 --
>  tests/tcg/xtensa/Makefile.softmmu-target  |   4 +-
>  34 files changed, 435 insertions(+), 420 deletions(-)
>  delete mode 100644 tests/tcg/Makefile.include
>  create mode 100644 tests/tcg/Makefile.prereqs
>  delete mode 100644 tests/tcg/Makefile.probe
>  create mode 100644 tests/tcg/Makefile.qemu
>  rename tests/tcg/{Makefile => Makefile.target} (90%)
>  delete mode 100644 tests/tcg/aarch64/Makefile.include
>  delete mode 100644 tests/tcg/alpha/Makefile.include
>  delete mode 100644 tests/tcg/arm/Makefile.include
>  create mode 100644 tests/tcg/configure.sh
>  delete mode 100644 tests/tcg/cris/Makefile.include
>  delete mode 100644 tests/tcg/hppa/Makefile.include
>  delete mode 100644 tests/tcg/i386/Makefile.include
>  delete mode 100644 tests/tcg/m68k/Makefile.include
>  delete mode 100644 tests/tcg/mips/Makefile.include
>  delete mode 100644 tests/tcg/ppc/Makefile.include
>  delete mode 100644 tests/tcg/riscv/Makefile.include
>  delete mode 100644 tests/tcg/s390x/Makefile.include
>  delete mode 100644 tests/tcg/sh4/Makefile.include
>  delete mode 100644 tests/tcg/sparc64/Makefile.include
>  create mode 100644 tests/tcg/x86_64/Makefile.softmmu-target
>  delete mode 100644 tests/tcg/xtensa/Makefile.include


--
Alex Bennée

Re: [Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Posted by Paolo Bonzini 4 years, 8 months ago
On 07/08/19 14:40, Alex Bennée wrote:
> 
> Paolo Bonzini <pbonzini@redhat.com> writes:
> 
>> The tests/tcg rely a lot on per-target informations from
>> the QEMU makefiles, but most of the definitions in there
>> aren't really relevant to TCG tests.
>>
>> This series is just a cleanup, but it could also be
>> a useful start in making it possible to compile tests/tcg
>> out of QEMU's tree, and/or making it a submodule, and/or
>> unifying the system emulation tests with kvm-unit-tests.
> 
> Hmm something is throwing off configure and making it use my login shell
> instead of /bin/sh:
> 
>   libpmem support   no
>   libudev           yes
>   default devices   yes
>   ~/lsrc/qemu.git/tests/tcg/configure.sh (line 63): 'case' builtin not inside of switch block
>     case $arch in
>     ^
>   <W> fish: Error while reading file /home/alex/lsrc/qemu.git/tests/tcg/configure.sh

It's the ${SHELL} you found in patch 3.  The disadvantage of relying on
#! is that some people have bash in /usr/bin/bash rather than /bin/bash.
 But we already assume /bin/bash elsewhere so I can drop it.

Paolo

>>
>> Paolo
>>
>> Paolo Bonzini (3):
>>   tests/tcg: use EXTRA_CFLAGS everywhere
>>   tests/tcg: cleanup Makefile inclusions
>>   tests/tcg: move configuration to a sub-shell script
>>
>>  Makefile                                  |   1 +
>>  Makefile.target                           |   3 -
>>  configure                                 | 155 ++------------------
>>  tests/Makefile.include                    |  25 ++--
>>  tests/tcg/Makefile.include                |  88 ------------
>>  tests/tcg/Makefile.prereqs                |  18 +++
>>  tests/tcg/Makefile.probe                  |  31 ----
>>  tests/tcg/Makefile.qemu                   |  95 +++++++++++++
>>  tests/tcg/{Makefile => Makefile.target}   |  15 +-
>>  tests/tcg/aarch64/Makefile.include        |   8 --
>>  tests/tcg/aarch64/Makefile.softmmu-target |   4 +-
>>  tests/tcg/aarch64/Makefile.target         |  12 +-
>>  tests/tcg/alpha/Makefile.include          |   2 -
>>  tests/tcg/alpha/Makefile.softmmu-target   |   4 +-
>>  tests/tcg/arm/Makefile.include            |   8 --
>>  tests/tcg/arm/Makefile.softmmu-target     |   6 +-
>>  tests/tcg/configure.sh                    | 228 ++++++++++++++++++++++++++++++
>>  tests/tcg/cris/Makefile.include           |   6 -
>>  tests/tcg/hppa/Makefile.include           |   2 -
>>  tests/tcg/i386/Makefile.include           |   9 --
>>  tests/tcg/i386/Makefile.softmmu-target    |  12 +-
>>  tests/tcg/i386/Makefile.target            |  13 +-
>>  tests/tcg/m68k/Makefile.include           |   2 -
>>  tests/tcg/minilib/Makefile.target         |   2 +-
>>  tests/tcg/mips/Makefile.include           |  20 ---
>>  tests/tcg/ppc/Makefile.include            |  10 --
>>  tests/tcg/riscv/Makefile.include          |  10 --
>>  tests/tcg/s390x/Makefile.include          |   2 -
>>  tests/tcg/sh4/Makefile.include            |   4 -
>>  tests/tcg/sparc64/Makefile.include        |   2 -
>>  tests/tcg/x86_64/Makefile.softmmu-target  |  36 +++++
>>  tests/tcg/x86_64/Makefile.target          |   7 +-
>>  tests/tcg/xtensa/Makefile.include         |  11 --
>>  tests/tcg/xtensa/Makefile.softmmu-target  |   4 +-
>>  34 files changed, 435 insertions(+), 420 deletions(-)
>>  delete mode 100644 tests/tcg/Makefile.include
>>  create mode 100644 tests/tcg/Makefile.prereqs
>>  delete mode 100644 tests/tcg/Makefile.probe
>>  create mode 100644 tests/tcg/Makefile.qemu
>>  rename tests/tcg/{Makefile => Makefile.target} (90%)
>>  delete mode 100644 tests/tcg/aarch64/Makefile.include
>>  delete mode 100644 tests/tcg/alpha/Makefile.include
>>  delete mode 100644 tests/tcg/arm/Makefile.include
>>  create mode 100644 tests/tcg/configure.sh
>>  delete mode 100644 tests/tcg/cris/Makefile.include
>>  delete mode 100644 tests/tcg/hppa/Makefile.include
>>  delete mode 100644 tests/tcg/i386/Makefile.include
>>  delete mode 100644 tests/tcg/m68k/Makefile.include
>>  delete mode 100644 tests/tcg/mips/Makefile.include
>>  delete mode 100644 tests/tcg/ppc/Makefile.include
>>  delete mode 100644 tests/tcg/riscv/Makefile.include
>>  delete mode 100644 tests/tcg/s390x/Makefile.include
>>  delete mode 100644 tests/tcg/sh4/Makefile.include
>>  delete mode 100644 tests/tcg/sparc64/Makefile.include
>>  create mode 100644 tests/tcg/x86_64/Makefile.softmmu-target
>>  delete mode 100644 tests/tcg/xtensa/Makefile.include
> 
> 
> --
> Alex Bennée
> 


Re: [Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Posted by Eric Blake 4 years, 8 months ago
On 8/7/19 8:06 AM, Paolo Bonzini wrote:
> On 07/08/19 14:40, Alex Bennée wrote:
>>
>> Paolo Bonzini <pbonzini@redhat.com> writes:
>>
>>> The tests/tcg rely a lot on per-target informations from
>>> the QEMU makefiles, but most of the definitions in there
>>> aren't really relevant to TCG tests.
>>>
>>> This series is just a cleanup, but it could also be
>>> a useful start in making it possible to compile tests/tcg
>>> out of QEMU's tree, and/or making it a submodule, and/or
>>> unifying the system emulation tests with kvm-unit-tests.
>>
>> Hmm something is throwing off configure and making it use my login shell
>> instead of /bin/sh:
>>
>>   libpmem support   no
>>   libudev           yes
>>   default devices   yes
>>   ~/lsrc/qemu.git/tests/tcg/configure.sh (line 63): 'case' builtin not inside of switch block
>>     case $arch in
>>     ^
>>   <W> fish: Error while reading file /home/alex/lsrc/qemu.git/tests/tcg/configure.sh
> 
> It's the ${SHELL} you found in patch 3.  The disadvantage of relying on
> #! is that some people have bash in /usr/bin/bash rather than /bin/bash.
>  But we already assume /bin/bash elsewhere so I can drop it.

Rather, we use '#!/usr/bin/env bash' to find bash anywhere.

-- 
Eric Blake, Principal Software Engineer
Red Hat, Inc.           +1-919-301-3226
Virtualization:  qemu.org | libvirt.org

Re: [Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Posted by Paolo Bonzini 4 years, 8 months ago
On 07/08/19 15:33, Eric Blake wrote:
> On 8/7/19 8:06 AM, Paolo Bonzini wrote:
>> On 07/08/19 14:40, Alex Bennée wrote:
>>>
>>> Paolo Bonzini <pbonzini@redhat.com> writes:
>>>
>>>> The tests/tcg rely a lot on per-target informations from
>>>> the QEMU makefiles, but most of the definitions in there
>>>> aren't really relevant to TCG tests.
>>>>
>>>> This series is just a cleanup, but it could also be
>>>> a useful start in making it possible to compile tests/tcg
>>>> out of QEMU's tree, and/or making it a submodule, and/or
>>>> unifying the system emulation tests with kvm-unit-tests.
>>>
>>> Hmm something is throwing off configure and making it use my login shell
>>> instead of /bin/sh:
>>>
>>>   libpmem support   no
>>>   libudev           yes
>>>   default devices   yes
>>>   ~/lsrc/qemu.git/tests/tcg/configure.sh (line 63): 'case' builtin not inside of switch block
>>>     case $arch in
>>>     ^
>>>   <W> fish: Error while reading file /home/alex/lsrc/qemu.git/tests/tcg/configure.sh
>>
>> It's the ${SHELL} you found in patch 3.  The disadvantage of relying on
>> #! is that some people have bash in /usr/bin/bash rather than /bin/bash.
>>  But we already assume /bin/bash elsewhere so I can drop it.
> 
> Rather, we use '#!/usr/bin/env bash' to find bash anywhere.

Nevermind - this script is pure Bourne shell.  The only fix needed should be

diff --git a/configure b/configure
index eeeda8760a..f216f3f9d9 100755
--- a/configure
+++ b/configure
@@ -6468,12 +6468,6 @@ if ! $python -c 'import sys; sys.exit(sys.version_info < (3,0))'; then
   echo "warning: Python 3 will be required for building future versions of QEMU" >&2
 fi
 
-(for i in $cross_cc_vars; do
-  export $i
-done
-export target_list source_path
-${SHELL-/bin/sh} $source_path/tests/tcg/configure.sh)
-
 config_host_mak="config-host.mak"
 
 echo "# Automatically generated by configure - do not modify" >config-all-disas.mak
@@ -7844,6 +7838,12 @@ for f in $LINKS ; do
     fi
 done
 
+(for i in $cross_cc_vars; do
+  export $i
+done
+export target_list source_path
+$source_path/tests/tcg/configure.sh)
+
 # temporary config to build submodules
 for rom in seabios vgabios ; do
     config_mak=roms/$rom/config.mak

Re: [Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Posted by Alex Bennée 4 years, 8 months ago
Paolo Bonzini <pbonzini@redhat.com> writes:

> On 07/08/19 15:33, Eric Blake wrote:
>> On 8/7/19 8:06 AM, Paolo Bonzini wrote:
>>> On 07/08/19 14:40, Alex Bennée wrote:
>>>>
>>>> Paolo Bonzini <pbonzini@redhat.com> writes:
>>>>
>>>>> The tests/tcg rely a lot on per-target informations from
>>>>> the QEMU makefiles, but most of the definitions in there
>>>>> aren't really relevant to TCG tests.
>>>>>
>>>>> This series is just a cleanup, but it could also be
>>>>> a useful start in making it possible to compile tests/tcg
>>>>> out of QEMU's tree, and/or making it a submodule, and/or
>>>>> unifying the system emulation tests with kvm-unit-tests.
>>>>
>>>> Hmm something is throwing off configure and making it use my login shell
>>>> instead of /bin/sh:
>>>>
>>>>   libpmem support   no
>>>>   libudev           yes
>>>>   default devices   yes
>>>>   ~/lsrc/qemu.git/tests/tcg/configure.sh (line 63): 'case' builtin not inside of switch block
>>>>     case $arch in
>>>>     ^
>>>>   <W> fish: Error while reading file /home/alex/lsrc/qemu.git/tests/tcg/configure.sh
>>>
>>> It's the ${SHELL} you found in patch 3.  The disadvantage of relying on
>>> #! is that some people have bash in /usr/bin/bash rather than /bin/bash.
>>>  But we already assume /bin/bash elsewhere so I can drop it.
>>
>> Rather, we use '#!/usr/bin/env bash' to find bash anywhere.
>
> Nevermind - this script is pure Bourne shell.  The only fix needed
> should be

I thought we wanted to use pure POSIX shell and not rely on bash-ism's
creeping in?

>
> diff --git a/configure b/configure
> index eeeda8760a..f216f3f9d9 100755
> --- a/configure
> +++ b/configure
> @@ -6468,12 +6468,6 @@ if ! $python -c 'import sys; sys.exit(sys.version_info < (3,0))'; then
>    echo "warning: Python 3 will be required for building future versions of QEMU" >&2
>  fi
>
> -(for i in $cross_cc_vars; do
> -  export $i
> -done
> -export target_list source_path
> -${SHELL-/bin/sh} $source_path/tests/tcg/configure.sh)
> -
>  config_host_mak="config-host.mak"
>
>  echo "# Automatically generated by configure - do not modify" >config-all-disas.mak
> @@ -7844,6 +7838,12 @@ for f in $LINKS ; do
>      fi
>  done
>
> +(for i in $cross_cc_vars; do
> +  export $i
> +done
> +export target_list source_path
> +$source_path/tests/tcg/configure.sh)
> +

I also had chmod +x the script.

>  # temporary config to build submodules
>  for rom in seabios vgabios ; do
>      config_mak=roms/$rom/config.mak


--
Alex Bennée

Re: [Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Posted by Paolo Bonzini 4 years, 8 months ago
On 07/08/19 18:38, Alex Bennée wrote:
>>> Rather, we use '#!/usr/bin/env bash' to find bash anywhere.
>> Nevermind - this script is pure Bourne shell.  The only fix needed
>> should be
> I thought we wanted to use pure POSIX shell and not rely on bash-ism's
> creeping in?
> 

There are uses of bash as long as it's marked as such (and not /bin/sh).
 But Bourne shell = /bin/sh, bash is the "Bourne-again" shell. :)

Paolo

Re: [Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Posted by no-reply@patchew.org 4 years, 8 months ago
Patchew URL: https://patchew.org/QEMU/20190730123759.21723-1-pbonzini@redhat.com/



Hi,

This series seems to have some coding style problems. See output below for
more information:

Type: series
Subject: [Qemu-devel] [PATCH 0/3] tests/tcg: disentangle makefiles
Message-id: 20190730123759.21723-1-pbonzini@redhat.com

=== TEST SCRIPT BEGIN ===
#!/bin/bash
git rev-parse base > /dev/null || exit 0
git config --local diff.renamelimit 0
git config --local diff.renames True
git config --local diff.algorithm histogram
./scripts/checkpatch.pl --mailback base..
=== TEST SCRIPT END ===

Updating 3c8cf5a9c21ff8782164d1def7f44bd888713384
From https://github.com/patchew-project/qemu
   ee9545e..6e9a6cb  master     -> master
 * [new tag]         patchew/20190730123759.21723-1-pbonzini@redhat.com -> patchew/20190730123759.21723-1-pbonzini@redhat.com
Submodule 'capstone' (https://git.qemu.org/git/capstone.git) registered for path 'capstone'
Submodule 'dtc' (https://git.qemu.org/git/dtc.git) registered for path 'dtc'
Submodule 'roms/QemuMacDrivers' (https://git.qemu.org/git/QemuMacDrivers.git) registered for path 'roms/QemuMacDrivers'
Submodule 'roms/SLOF' (https://git.qemu.org/git/SLOF.git) registered for path 'roms/SLOF'
Submodule 'roms/edk2' (https://git.qemu.org/git/edk2.git) registered for path 'roms/edk2'
Submodule 'roms/ipxe' (https://git.qemu.org/git/ipxe.git) registered for path 'roms/ipxe'
Submodule 'roms/openbios' (https://git.qemu.org/git/openbios.git) registered for path 'roms/openbios'
Submodule 'roms/openhackware' (https://git.qemu.org/git/openhackware.git) registered for path 'roms/openhackware'
Submodule 'roms/opensbi' (https://git.qemu.org/git/opensbi.git) registered for path 'roms/opensbi'
Submodule 'roms/qemu-palcode' (https://git.qemu.org/git/qemu-palcode.git) registered for path 'roms/qemu-palcode'
Submodule 'roms/seabios' (https://git.qemu.org/git/seabios.git/) registered for path 'roms/seabios'
Submodule 'roms/seabios-hppa' (https://git.qemu.org/git/seabios-hppa.git) registered for path 'roms/seabios-hppa'
Submodule 'roms/sgabios' (https://git.qemu.org/git/sgabios.git) registered for path 'roms/sgabios'
Submodule 'roms/skiboot' (https://git.qemu.org/git/skiboot.git) registered for path 'roms/skiboot'
Submodule 'roms/u-boot' (https://git.qemu.org/git/u-boot.git) registered for path 'roms/u-boot'
Submodule 'roms/u-boot-sam460ex' (https://git.qemu.org/git/u-boot-sam460ex.git) registered for path 'roms/u-boot-sam460ex'
Submodule 'slirp' (https://git.qemu.org/git/libslirp.git) registered for path 'slirp'
Submodule 'tests/fp/berkeley-softfloat-3' (https://git.qemu.org/git/berkeley-softfloat-3.git) registered for path 'tests/fp/berkeley-softfloat-3'
Submodule 'tests/fp/berkeley-testfloat-3' (https://git.qemu.org/git/berkeley-testfloat-3.git) registered for path 'tests/fp/berkeley-testfloat-3'
Submodule 'ui/keycodemapdb' (https://git.qemu.org/git/keycodemapdb.git) registered for path 'ui/keycodemapdb'
Cloning into 'capstone'...
Submodule path 'capstone': checked out '22ead3e0bfdb87516656453336160e0a37b066bf'
Cloning into 'dtc'...
Submodule path 'dtc': checked out '88f18909db731a627456f26d779445f84e449536'
Cloning into 'roms/QemuMacDrivers'...
Submodule path 'roms/QemuMacDrivers': checked out '90c488d5f4a407342247b9ea869df1c2d9c8e266'
Cloning into 'roms/SLOF'...
Submodule path 'roms/SLOF': checked out 'ba1ab360eebe6338bb8d7d83a9220ccf7e213af3'
Cloning into 'roms/edk2'...
Submodule path 'roms/edk2': checked out '20d2e5a125e34fc8501026613a71549b2a1a3e54'
Submodule 'SoftFloat' (https://github.com/ucb-bar/berkeley-softfloat-3.git) registered for path 'ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3'
Submodule 'CryptoPkg/Library/OpensslLib/openssl' (https://github.com/openssl/openssl) registered for path 'CryptoPkg/Library/OpensslLib/openssl'
Cloning into 'ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3'...
Submodule path 'roms/edk2/ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3': checked out 'b64af41c3276f97f0e181920400ee056b9c88037'
Cloning into 'CryptoPkg/Library/OpensslLib/openssl'...
Submodule path 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl': checked out '50eaac9f3337667259de725451f201e784599687'
Submodule 'boringssl' (https://boringssl.googlesource.com/boringssl) registered for path 'boringssl'
Submodule 'krb5' (https://github.com/krb5/krb5) registered for path 'krb5'
Submodule 'pyca.cryptography' (https://github.com/pyca/cryptography.git) registered for path 'pyca-cryptography'
Cloning into 'boringssl'...
Submodule path 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl/boringssl': checked out '2070f8ad9151dc8f3a73bffaa146b5e6937a583f'
Cloning into 'krb5'...
Submodule path 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl/krb5': checked out 'b9ad6c49505c96a088326b62a52568e3484f2168'
Cloning into 'pyca-cryptography'...
Submodule path 'roms/edk2/CryptoPkg/Library/OpensslLib/openssl/pyca-cryptography': checked out '09403100de2f6f1cdd0d484dcb8e620f1c335c8f'
Cloning into 'roms/ipxe'...
Submodule path 'roms/ipxe': checked out 'de4565cbe76ea9f7913a01f331be3ee901bb6e17'
Cloning into 'roms/openbios'...
Submodule path 'roms/openbios': checked out 'c79e0ecb84f4f1ee3f73f521622e264edd1bf174'
Cloning into 'roms/openhackware'...
Submodule path 'roms/openhackware': checked out 'c559da7c8eec5e45ef1f67978827af6f0b9546f5'
Cloning into 'roms/opensbi'...
Submodule path 'roms/opensbi': checked out 'ce228ee0919deb9957192d723eecc8aaae2697c6'
Cloning into 'roms/qemu-palcode'...
Submodule path 'roms/qemu-palcode': checked out 'bf0e13698872450164fa7040da36a95d2d4b326f'
Cloning into 'roms/seabios'...
Submodule path 'roms/seabios': checked out 'a5cab58e9a3fb6e168aba919c5669bea406573b4'
Cloning into 'roms/seabios-hppa'...
Submodule path 'roms/seabios-hppa': checked out '0f4fe84658165e96ce35870fd19fc634e182e77b'
Cloning into 'roms/sgabios'...
Submodule path 'roms/sgabios': checked out 'cbaee52287e5f32373181cff50a00b6c4ac9015a'
Cloning into 'roms/skiboot'...
Submodule path 'roms/skiboot': checked out '261ca8e779e5138869a45f174caa49be6a274501'
Cloning into 'roms/u-boot'...
Submodule path 'roms/u-boot': checked out 'd3689267f92c5956e09cc7d1baa4700141662bff'
Cloning into 'roms/u-boot-sam460ex'...
Submodule path 'roms/u-boot-sam460ex': checked out '60b3916f33e617a815973c5a6df77055b2e3a588'
Cloning into 'slirp'...
Submodule path 'slirp': checked out 'f0da6726207b740f6101028b2992f918477a4b08'
Cloning into 'tests/fp/berkeley-softfloat-3'...
Submodule path 'tests/fp/berkeley-softfloat-3': checked out 'b64af41c3276f97f0e181920400ee056b9c88037'
Cloning into 'tests/fp/berkeley-testfloat-3'...
Submodule path 'tests/fp/berkeley-testfloat-3': checked out '5a59dcec19327396a011a17fd924aed4fec416b3'
Cloning into 'ui/keycodemapdb'...
Submodule path 'ui/keycodemapdb': checked out '6b3d716e2b6472eb7189d3220552280ef3d832ce'
Switched to a new branch 'test'
a8a63d5 tests/tcg: move configuration to a sub-shell script
7a1ae61 tests/tcg: cleanup Makefile inclusions
d5cb6df tests/tcg: use EXTRA_CFLAGS everywhere

=== OUTPUT BEGIN ===
1/3 Checking commit d5cb6df2dcd3 (tests/tcg: use EXTRA_CFLAGS everywhere)
2/3 Checking commit 7a1ae6123820 (tests/tcg: cleanup Makefile inclusions)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#83: 
rename from tests/tcg/Makefile.probe

total: 0 errors, 1 warnings, 341 lines checked

Patch 2/3 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.
3/3 Checking commit a8a63d5aa20e (tests/tcg: move configuration to a sub-shell script)
WARNING: added, moved or deleted file(s), does MAINTAINERS need updating?
#690: 
deleted file mode 100644

WARNING: line over 80 characters
#909: FILE: tests/tcg/configure.sh:179:
+  echo "# Automatically generated by configure - do not modify" > $config_target_mak

ERROR: line over 90 characters
#936: FILE: tests/tcg/configure.sh:206:
+    if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC -static ; then

WARNING: line over 80 characters
#938: FILE: tests/tcg/configure.sh:208:
+      if ! do_compiler "$target_compiler" $target_compiler_cflags -o $TMPE $TMPC ; then

WARNING: line over 80 characters
#949: FILE: tests/tcg/configure.sh:219:
+  if test $got_cross_cc = no && test "$docker" != no && test -n "$docker_image"; then

total: 1 errors, 4 warnings, 845 lines checked

Patch 3/3 has style problems, please review.  If any of these errors
are false positives report them to the maintainer, see
CHECKPATCH in MAINTAINERS.

=== OUTPUT END ===

Test command exited with code: 1


The full log is available at
http://patchew.org/logs/20190730123759.21723-1-pbonzini@redhat.com/testing.checkpatch/?type=message.
---
Email generated automatically by Patchew [https://patchew.org/].
Please send your feedback to patchew-devel@redhat.com