[PATCH 7/7] meson: Build block_syms and qemu_syms only when enable_modules

Kostiantyn Kostiuk posted 7 patches 1 week ago
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>, Kevin Wolf <kwolf@redhat.com>
There is a newer version of this series
[PATCH 7/7] meson: Build block_syms and qemu_syms only when enable_modules
Posted by Kostiantyn Kostiuk 1 week ago
Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
---
 meson.build | 25 ++++++++++++++-----------
 1 file changed, 14 insertions(+), 11 deletions(-)

diff --git a/meson.build b/meson.build
index e1baa0ea80..c7ab9c47c4 100644
--- a/meson.build
+++ b/meson.build
@@ -3897,6 +3897,9 @@ modinfo_generate = find_program('scripts/modinfo-generate.py')
 modinfo_files = []
 audio_modinfo_files = []
 
+block_syms = []
+qemu_syms = []
+
 block_mods = []
 system_mods = []
 emulator_modules = []
@@ -4012,18 +4015,18 @@ if enable_modules
   if emulator_modules.length() > 0
     alias_target('modules', emulator_modules)
   endif
-endif
 
-nm = find_program('nm')
-undefsym = find_program('scripts/undefsym.py')
-block_syms = custom_target('block.syms', output: 'block.syms',
-                             input: [libqemuutil, block_mods],
-                             capture: true,
-                             command: [undefsym, nm, '@INPUT@'])
-qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
-                             input: [libqemuutil, system_mods],
-                             capture: true,
-                             command: [undefsym, nm, '@INPUT@'])
+  nm = find_program('nm')
+  undefsym = find_program('scripts/undefsym.py')
+  block_syms = custom_target('block.syms', output: 'block.syms',
+                              input: [libqemuutil, block_mods],
+                              capture: true,
+                              command: [undefsym, nm, '@INPUT@'])
+  qemu_syms = custom_target('qemu.syms', output: 'qemu.syms',
+                              input: [libqemuutil, system_mods],
+                              capture: true,
+                              command: [undefsym, nm, '@INPUT@'])
+endif
 
 authz_ss = authz_ss.apply({})
 libauthz = static_library('authz', authz_ss.sources() + genh,
-- 
2.52.0
Re: [PATCH 7/7] meson: Build block_syms and qemu_syms only when enable_modules
Posted by Kevin Wolf 1 week ago
Am 26.03.2026 um 17:00 hat Kostiantyn Kostiuk geschrieben:
> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>

I'm not a meson expert, but the change itself looks ok to me.

However, the commit message is definitely a bit too empty. It should say
why you want to make this change.

Kevin
Re: [PATCH 7/7] meson: Build block_syms and qemu_syms only when enable_modules
Posted by Paolo Bonzini 6 days, 9 hours ago
On 3/26/26 18:10, Kevin Wolf wrote:
> Am 26.03.2026 um 17:00 hat Kostiantyn Kostiuk geschrieben:
>> Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
> 
> I'm not a meson expert, but the change itself looks ok to me.
> 
> However, the commit message is definitely a bit too empty. It should say
> why you want to make this change.

Agreed, I *think* it's because scripts/undefsym.py would immediately 
exit here:

     if len(args) <= 3:
         sys.exit(0)

but it should be spelled out.

Paolo
Re: [PATCH 7/7] meson: Build block_syms and qemu_syms only when enable_modules
Posted by Kevin Wolf 6 days, 9 hours ago
Am 27.03.2026 um 11:47 hat Paolo Bonzini geschrieben:
> On 3/26/26 18:10, Kevin Wolf wrote:
> > Am 26.03.2026 um 17:00 hat Kostiantyn Kostiuk geschrieben:
> > > Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
> > 
> > I'm not a meson expert, but the change itself looks ok to me.
> > 
> > However, the commit message is definitely a bit too empty. It should say
> > why you want to make this change.
> 
> Agreed, I *think* it's because scripts/undefsym.py would immediately exit
> here:
> 
>     if len(args) <= 3:
>         sys.exit(0)
> 
> but it should be spelled out.

If that's a problem, why doesn't ./configure --disable-modules fail on
Linux?

Kevin
Re: [PATCH 7/7] meson: Build block_syms and qemu_syms only when enable_modules
Posted by Kostiantyn Kostiuk 6 days, 9 hours ago
On Fri, Mar 27, 2026 at 1:04 PM Kevin Wolf <kwolf@redhat.com> wrote:

> Am 27.03.2026 um 11:47 hat Paolo Bonzini geschrieben:
> > On 3/26/26 18:10, Kevin Wolf wrote:
> > > Am 26.03.2026 um 17:00 hat Kostiantyn Kostiuk geschrieben:
> > > > Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
> > >
> > > I'm not a meson expert, but the change itself looks ok to me.
> > >
> > > However, the commit message is definitely a bit too empty. It should
> say
> > > why you want to make this change.
> >
> > Agreed, I *think* it's because scripts/undefsym.py would immediately exit
> > here:
> >
> >     if len(args) <= 3:
> >         sys.exit(0)
> >
> > but it should be spelled out.
>
> If that's a problem, why doesn't ./configure --disable-modules fail on
> Linux?
>

It does not fail because it exits with 0, no error.
Problem in my environment because nm is missing,
but at the same time, running undefsym when modules
are disabled has zero sense because nothing will be generated


>
> Kevin
>
>
Re: [PATCH 7/7] meson: Build block_syms and qemu_syms only when enable_modules
Posted by Kevin Wolf 6 days, 7 hours ago
Am 27.03.2026 um 12:10 hat Kostiantyn Kostiuk geschrieben:
> On Fri, Mar 27, 2026 at 1:04 PM Kevin Wolf <kwolf@redhat.com> wrote:
> 
> > Am 27.03.2026 um 11:47 hat Paolo Bonzini geschrieben:
> > > On 3/26/26 18:10, Kevin Wolf wrote:
> > > > Am 26.03.2026 um 17:00 hat Kostiantyn Kostiuk geschrieben:
> > > > > Signed-off-by: Kostiantyn Kostiuk <kkostiuk@redhat.com>
> > > >
> > > > I'm not a meson expert, but the change itself looks ok to me.
> > > >
> > > > However, the commit message is definitely a bit too empty. It should
> > say
> > > > why you want to make this change.
> > >
> > > Agreed, I *think* it's because scripts/undefsym.py would immediately exit
> > > here:
> > >
> > >     if len(args) <= 3:
> > >         sys.exit(0)
> > >
> > > but it should be spelled out.
> >
> > If that's a problem, why doesn't ./configure --disable-modules fail on
> > Linux?
> 
> It does not fail because it exits with 0, no error.
> Problem in my environment because nm is missing,
> but at the same time, running undefsym when modules
> are disabled has zero sense because nothing will be generated

Ok, makes sense. Then how about making the subject line something like
"meson: Don't require nm for non-modular builds", and explaining in the
commit message on which platform nm is missing and that the change is
harmless because it already didn't do anything before?

Kevin