[PATCH] meson: do not descend into *-user if no user-mode emulators built

Paolo Bonzini posted 1 patch 4 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20251016170357.1362790-1-pbonzini@redhat.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, "Philippe Mathieu-Daudé" <philmd@linaro.org>
meson.build | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
[PATCH] meson: do not descend into *-user if no user-mode emulators built
Posted by Paolo Bonzini 4 weeks ago
User-mode emulators cannot be built for unsupported host architectures;
avoid incorrectly descending into common-user/unknown.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 meson.build | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/meson.build b/meson.build
index afaefa01722..3facde5b68f 100644
--- a/meson.build
+++ b/meson.build
@@ -3935,9 +3935,11 @@ endif
 
 common_user_inc = []
 
-subdir('common-user')
-subdir('bsd-user')
-subdir('linux-user')
+if have_user
+  subdir('common-user')
+  subdir('bsd-user')
+  subdir('linux-user')
+endif
 
 # needed for fuzzing binaries
 subdir('tests/qtest/libqos')
-- 
2.51.0
Re: [PATCH] meson: do not descend into *-user if no user-mode emulators built
Posted by Daniel P. Berrangé 4 weeks ago
On Thu, Oct 16, 2025 at 07:03:57PM +0200, Paolo Bonzini wrote:
> User-mode emulators cannot be built for unsupported host architectures;
> avoid incorrectly descending into common-user/unknown.
> 
> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
> ---
>  meson.build | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/meson.build b/meson.build
> index afaefa01722..3facde5b68f 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -3935,9 +3935,11 @@ endif
>  
>  common_user_inc = []
>  
> -subdir('common-user')
> -subdir('bsd-user')
> -subdir('linux-user')
> +if have_user
> +  subdir('common-user')
> +  subdir('bsd-user')
> +  subdir('linux-user')
> +endif

The first lines of meson.buld in each subdir are already doing a
check and calling subdir_done() straighaway, so what does this
really give us ? 

With regards,
Daniel
-- 
|: https://berrange.com      -o-    https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org         -o-            https://fstop138.berrange.com :|
|: https://entangle-photo.org    -o-    https://www.instagram.com/dberrange :|