* [PATCH 3/4] Allow tests to be disabled
@ 2024-01-17 12:32 Manolo de Medici
2024-01-17 17:35 ` Peter Maydell
0 siblings, 1 reply; 6+ messages in thread
From: Manolo de Medici @ 2024-01-17 12:32 UTC (permalink / raw)
To: qemu-devel, bug-hurd
tests/qtest/tpm-* compilation is not disabled by disable-tpm,
for this reason compilation fails on systems that doesn't
support the linux/bsd TPM api. Fix this by allowing tests
to be disabled.
Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
---
configure | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/configure b/configure
index 21ab9a64e9..c36ce1f7e2 100755
--- a/configure
+++ b/configure
@@ -254,6 +254,7 @@ skip_meson=no
use_containers="yes"
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
gdb_arches=""
+tests="auto"
# Don't accept a target_list environment variable.
unset target_list
@@ -741,6 +742,10 @@ for opt do
;;
--disable-cfi) cfi=false
;;
+ --disable-tests) tests="disabled"
+ ;;
+ --enable-tests) tests="enabled"
+ ;;
--disable-download) download="disabled"; git_submodules_action=validate;
;;
--enable-download) download="enabled"; git_submodules_action=update;
@@ -887,6 +892,7 @@ cat << EOF
linux-user all linux usermode emulation targets
bsd-user all BSD usermode emulation targets
pie Position Independent Executables
+ tests build tests
NOTE: The object files are built at the place where configure is launched
EOF
@@ -1792,6 +1798,7 @@ if test "$skip_meson" = no; then
# QEMU options
test "$cfi" != false && meson_option_add "-Dcfi=$cfi" "-Db_lto=$cfi"
test "$docs" != auto && meson_option_add "-Ddocs=$docs"
+ test "$tests" != auto && meson_option_add "-Dtests=$tests"
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add
"-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
test "$plugins" = yes && meson_option_add "-Dplugins=true"
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/4] Allow tests to be disabled
@ 2024-01-17 12:32 Manolo de Medici
2024-01-17 15:09 ` Manolo de Medici
0 siblings, 1 reply; 6+ messages in thread
From: Manolo de Medici @ 2024-01-17 12:32 UTC (permalink / raw)
To: qemu-devel, bug-hurd
tests/qtest/tpm-* compilation is not disabled by disable-tpm,
for this reason compilation fails on systems that doesn't
support the linux/bsd TPM api. Fix this by allowing tests
to be disabled.
Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
---
configure | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/configure b/configure
index 21ab9a64e9..c36ce1f7e2 100755
--- a/configure
+++ b/configure
@@ -254,6 +254,7 @@ skip_meson=no
use_containers="yes"
gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
gdb_arches=""
+tests="auto"
# Don't accept a target_list environment variable.
unset target_list
@@ -741,6 +742,10 @@ for opt do
;;
--disable-cfi) cfi=false
;;
+ --disable-tests) tests="disabled"
+ ;;
+ --enable-tests) tests="enabled"
+ ;;
--disable-download) download="disabled"; git_submodules_action=validate;
;;
--enable-download) download="enabled"; git_submodules_action=update;
@@ -887,6 +892,7 @@ cat << EOF
linux-user all linux usermode emulation targets
bsd-user all BSD usermode emulation targets
pie Position Independent Executables
+ tests build tests
NOTE: The object files are built at the place where configure is launched
EOF
@@ -1792,6 +1798,7 @@ if test "$skip_meson" = no; then
# QEMU options
test "$cfi" != false && meson_option_add "-Dcfi=$cfi" "-Db_lto=$cfi"
test "$docs" != auto && meson_option_add "-Ddocs=$docs"
+ test "$tests" != auto && meson_option_add "-Dtests=$tests"
test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add
"-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
test "$plugins" = yes && meson_option_add "-Dplugins=true"
test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
--
2.43.0
root@hurd:~/qemu# cat 0004-Add-the-GNU-Hurd-as-a-target-host.patch
From 5d7bf83c00168cede72a03d87d7546a0018b82a5 Mon Sep 17 00:00:00 2001
Message-ID: <5d7bf83c00168cede72a03d87d7546a0018b82a5.1705439227.git.manolo.demedici@gmail.com>
In-Reply-To: <cover.1705439227.git.manolo.demedici@gmail.com>
References: <cover.1705439227.git.manolo.demedici@gmail.com>
From: Manolo de Medici <manolo.demedici@gmail.com>
Date: Tue, 16 Jan 2024 20:12:50 +0100
Subject: [PATCH 4/4] Add the GNU/Hurd as a target host
Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
---
configure | 2 ++
1 file changed, 2 insertions(+)
diff --git a/configure b/configure
index c36ce1f7e2..d4648af96a 100755
--- a/configure
+++ b/configure
@@ -354,6 +354,8 @@ elif check_define __NetBSD__; then
host_os=netbsd
elif check_define __APPLE__; then
host_os=darwin
+elif check_define __GNU__; then
+ host_os=hurd
else
# This is a fatal error, but don't report it yet, because we
# might be going to just print the --help text, or it might
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 3/4] Allow tests to be disabled
2024-01-17 12:32 Manolo de Medici
@ 2024-01-17 15:09 ` Manolo de Medici
0 siblings, 0 replies; 6+ messages in thread
From: Manolo de Medici @ 2024-01-17 15:09 UTC (permalink / raw)
To: qemu-devel, bug-hurd
The current patch misses this bit.
diff --git a/meson_options.txt b/meson_options.txt
index 0a99a059ec..9a2acd6f83 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -305,6 +305,8 @@ option('libvduse', type: 'feature', value: 'auto',
description: 'build VDUSE Library')
option('vduse_blk_export', type: 'feature', value: 'auto',
description: 'VDUSE block export support')
+option('tests', type : 'feature', value : 'auto',
+ description: 'Tests build support')
option('capstone', type: 'feature', value: 'auto',
description: 'Whether and how to find the capstone library')
On Wed, Jan 17, 2024 at 1:32 PM Manolo de Medici
<manolodemedici@gmail.com> wrote:
>
> tests/qtest/tpm-* compilation is not disabled by disable-tpm,
> for this reason compilation fails on systems that doesn't
> support the linux/bsd TPM api. Fix this by allowing tests
> to be disabled.
>
> Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
> ---
> configure | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/configure b/configure
> index 21ab9a64e9..c36ce1f7e2 100755
> --- a/configure
> +++ b/configure
> @@ -254,6 +254,7 @@ skip_meson=no
> use_containers="yes"
> gdb_bin=$(command -v "gdb-multiarch" || command -v "gdb")
> gdb_arches=""
> +tests="auto"
>
> # Don't accept a target_list environment variable.
> unset target_list
> @@ -741,6 +742,10 @@ for opt do
> ;;
> --disable-cfi) cfi=false
> ;;
> + --disable-tests) tests="disabled"
> + ;;
> + --enable-tests) tests="enabled"
> + ;;
> --disable-download) download="disabled"; git_submodules_action=validate;
> ;;
> --enable-download) download="enabled"; git_submodules_action=update;
> @@ -887,6 +892,7 @@ cat << EOF
> linux-user all linux usermode emulation targets
> bsd-user all BSD usermode emulation targets
> pie Position Independent Executables
> + tests build tests
>
> NOTE: The object files are built at the place where configure is launched
> EOF
> @@ -1792,6 +1798,7 @@ if test "$skip_meson" = no; then
> # QEMU options
> test "$cfi" != false && meson_option_add "-Dcfi=$cfi" "-Db_lto=$cfi"
> test "$docs" != auto && meson_option_add "-Ddocs=$docs"
> + test "$tests" != auto && meson_option_add "-Dtests=$tests"
> test -n "${LIB_FUZZING_ENGINE+xxx}" && meson_option_add
> "-Dfuzzing_engine=$LIB_FUZZING_ENGINE"
> test "$plugins" = yes && meson_option_add "-Dplugins=true"
> test "$tcg" != enabled && meson_option_add "-Dtcg=$tcg"
> --
> 2.43.0
>
> root@hurd:~/qemu# cat 0004-Add-the-GNU-Hurd-as-a-target-host.patch
> From 5d7bf83c00168cede72a03d87d7546a0018b82a5 Mon Sep 17 00:00:00 2001
> Message-ID: <5d7bf83c00168cede72a03d87d7546a0018b82a5.1705439227.git.manolo.demedici@gmail.com>
> In-Reply-To: <cover.1705439227.git.manolo.demedici@gmail.com>
> References: <cover.1705439227.git.manolo.demedici@gmail.com>
> From: Manolo de Medici <manolo.demedici@gmail.com>
> Date: Tue, 16 Jan 2024 20:12:50 +0100
> Subject: [PATCH 4/4] Add the GNU/Hurd as a target host
>
> Signed-off-by: Manolo de Medici <manolo.demedici@gmail.com>
> ---
> configure | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/configure b/configure
> index c36ce1f7e2..d4648af96a 100755
> --- a/configure
> +++ b/configure
> @@ -354,6 +354,8 @@ elif check_define __NetBSD__; then
> host_os=netbsd
> elif check_define __APPLE__; then
> host_os=darwin
> +elif check_define __GNU__; then
> + host_os=hurd
> else
> # This is a fatal error, but don't report it yet, because we
> # might be going to just print the --help text, or it might
> --
> 2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH 3/4] Allow tests to be disabled
2024-01-17 12:32 [PATCH 3/4] Allow tests to be disabled Manolo de Medici
@ 2024-01-17 17:35 ` Peter Maydell
2024-01-17 18:14 ` Manolo de Medici
0 siblings, 1 reply; 6+ messages in thread
From: Peter Maydell @ 2024-01-17 17:35 UTC (permalink / raw)
To: Manolo de Medici; +Cc: qemu-devel, bug-hurd
On Wed, 17 Jan 2024 at 12:59, Manolo de Medici <manolodemedici@gmail.com> wrote:
>
> tests/qtest/tpm-* compilation is not disabled by disable-tpm,
> for this reason compilation fails on systems that doesn't
> support the linux/bsd TPM api. Fix this by allowing tests
> to be disabled.
This isn't the right way to fix this. Either the tpm test
code has portability issues that can be fixed, or else it
should be guarded by a suitable check that means we don't
try to build it on hosts that don't have the host-specific
functions/whatever that it needs.
thanks
-- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/4] Allow tests to be disabled
2024-01-17 17:35 ` Peter Maydell
@ 2024-01-17 18:14 ` Manolo de Medici
2024-01-17 18:40 ` Alex Bennée
0 siblings, 1 reply; 6+ messages in thread
From: Manolo de Medici @ 2024-01-17 18:14 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel, bug-hurd
I agree with you, I mentioned that this was the "minimal effort"
patchset to get qemu compilable.
On Wed, Jan 17, 2024 at 6:35 PM Peter Maydell <peter.maydell@linaro.org> wrote:
[...]
> should be guarded by a suitable check that means we don't
> try to build it on hosts that don't have the host-specific
> functions/whatever that it needs.
This is the best solution for this problem, any pointers on how to best do this?
Thanks
On Wed, Jan 17, 2024 at 6:35 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Wed, 17 Jan 2024 at 12:59, Manolo de Medici <manolodemedici@gmail.com> wrote:
> >
> > tests/qtest/tpm-* compilation is not disabled by disable-tpm,
> > for this reason compilation fails on systems that doesn't
> > support the linux/bsd TPM api. Fix this by allowing tests
> > to be disabled.
>
> This isn't the right way to fix this. Either the tpm test
> code has portability issues that can be fixed, or else it
> should be guarded by a suitable check that means we don't
> try to build it on hosts that don't have the host-specific
> functions/whatever that it needs.
>
> thanks
> -- PMM
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 3/4] Allow tests to be disabled
2024-01-17 18:14 ` Manolo de Medici
@ 2024-01-17 18:40 ` Alex Bennée
0 siblings, 0 replies; 6+ messages in thread
From: Alex Bennée @ 2024-01-17 18:40 UTC (permalink / raw)
To: Manolo de Medici; +Cc: Peter Maydell, qemu-devel, bug-hurd, Paolo Bonzini
Manolo de Medici <manolodemedici@gmail.com> writes:
> I agree with you, I mentioned that this was the "minimal effort"
> patchset to get qemu compilable.
>
> On Wed, Jan 17, 2024 at 6:35 PM Peter Maydell <peter.maydell@linaro.org> wrote:
> [...]
>> should be guarded by a suitable check that means we don't
>> try to build it on hosts that don't have the host-specific
>> functions/whatever that it needs.
>
> This is the best solution for this problem, any pointers on how to
> best do this?
Look in tests/qtest/meson.build for lines like:
config_all_devices.has_key('CONFIG_TPM_TIS_ISA') ? ['tpm-tis-test'] : [])
It seems we have a bunch of logic for qtests_i386 and qtests_aarch64
which isn't applied to the qtests list. Commenting those out I still get
the full list:
meson test --list | grep tpm
qemu:qtest+qtest-aarch64 / qtest-aarch64/tpm-tis-device-test
qemu:qtest+qtest-aarch64 / qtest-aarch64/tpm-tis-device-swtpm-test
qemu:qtest+qtest-aarch64 / qtest-aarch64/tpm-tis-i2c-test
qemu:qtest+qtest-arm / qtest-arm/tpm-tis-i2c-test
qemu:qtest+qtest-i386 / qtest-i386/tpm-crb-test
qemu:qtest+qtest-i386 / qtest-i386/tpm-crb-swtpm-test
qemu:qtest+qtest-i386 / qtest-i386/tpm-tis-test
qemu:qtest+qtest-i386 / qtest-i386/tpm-tis-swtpm-test
qemu:qtest+qtest-x86_64 / qtest-x86_64/tpm-crb-test
qemu:qtest+qtest-x86_64 / qtest-x86_64/tpm-crb-swtpm-test
qemu:qtest+qtest-x86_64 / qtest-x86_64/tpm-tis-test
qemu:qtest+qtest-x86_64 / qtest-x86_64/tpm-tis-swtpm-test
But I guess there are there to ensure the dependencies are correct so
I'm sure that's not the right fix.
Paolo,
Where is that meant to be done?
>
> Thanks
>
> On Wed, Jan 17, 2024 at 6:35 PM Peter Maydell <peter.maydell@linaro.org> wrote:
>>
>> On Wed, 17 Jan 2024 at 12:59, Manolo de Medici <manolodemedici@gmail.com> wrote:
>> >
>> > tests/qtest/tpm-* compilation is not disabled by disable-tpm,
>> > for this reason compilation fails on systems that doesn't
>> > support the linux/bsd TPM api. Fix this by allowing tests
>> > to be disabled.
>>
>> This isn't the right way to fix this. Either the tpm test
>> code has portability issues that can be fixed, or else it
>> should be guarded by a suitable check that means we don't
>> try to build it on hosts that don't have the host-specific
>> functions/whatever that it needs.
>>
>> thanks
>> -- PMM
--
Alex Bennée
Virtualisation Tech Lead @ Linaro
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2024-01-17 18:41 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-17 12:32 [PATCH 3/4] Allow tests to be disabled Manolo de Medici
2024-01-17 17:35 ` Peter Maydell
2024-01-17 18:14 ` Manolo de Medici
2024-01-17 18:40 ` Alex Bennée
-- strict thread matches above, loose matches on Subject: below --
2024-01-17 12:32 Manolo de Medici
2024-01-17 15:09 ` Manolo de Medici
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).