Skip to contentSkip to conversation

meson: build all modules by default

PATCH In review Paolo Bonzini 2 participants 2 messages Jan 7, 2022 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 meson: build all modules by default

With more recent versions of Meson, the build.ninja file is more selective as to what is built by default, and not building the modules results in test failures.

Mark the modules as built-by-default and, to make the dependencies more precise, also require them to be up-to-date before running tests.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/801

---
 meson.build             | 4 +++-
 tests/qtest/meson.build | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)
meson.build +3 -1
index 6489ff8425..703eefea13 100644
@@ -2866,8 +2866,10 @@ common_ss.add(hwcore)
 # Targets #
 ###########
 
+emulator_modules = []
 foreach m : block_mods + softmmu_mods
-  shared_module(m.name(),
+  emulator_modules += shared_module(m.name(),
+                build_by_default: true,
                 name_prefix: '',
                 link_whole: m,
                 install: true,
tests/qtest/meson.build +1 -2
index 37e1eaa449..26937deb6d 100644
@@ -335,10 +335,9 @@ foreach dir : target_dirs
         test: executable(test, src, dependencies: deps)
       }
     endif
-    # FIXME: missing dependency on the emulator binary and qemu-img
     test('qtest-@0@/@1@'.format(target_base, test),
          qtest_executables[test],
-         depends: [test_deps, qtest_emulator],
+         depends: [test_deps, qtest_emulator, emulator_modules],
          env: qtest_env,
          args: ['--tap', '-k'],
          protocol: 'tap',
Signature · 1 line
2.33.1
Tested-by on v1 1/1
#1 lore raw
Quoted 37 lines · Paolo Bonzini

With more recent versions of Meson, the build.ninja file is more selective as to what is built by default, and not building the modules results in test failures.

Mark the modules as built-by-default and, to make the dependencies more precise, also require them to be up-to-date before running tests.

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/801

---
  meson.build             | 4 +++-
  tests/qtest/meson.build | 3 +--
  2 files changed, 4 insertions(+), 3 deletions(-)
meson.build +3 -1
index 6489ff8425..703eefea13 100644
@@ -2866,8 +2866,10 @@ common_ss.add(hwcore)
  # Targets #
  ###########
 
+emulator_modules = []
  foreach m : block_mods + softmmu_mods
-  shared_module(m.name(),
+  emulator_modules += shared_module(m.name(),
+                build_by_default: true,
                  name_prefix: '',
                  link_whole: m,
                  install: true,
tests/qtest/meson.build +0 -0
index 37e1eaa449..26937deb6d 100644
@@ -335,10 +335,9 @@ foreach dir : target_dirs
          test: executable(test, src, dependencies: deps)

tests/qtest/meson.build foreach dir : target_dirs · line 343

Quoted 10 lines
tests/qtest/meson.build +1 -2
        }
      endif
-    # FIXME: missing dependency on the emulator binary and qemu-img
      test('qtest-@0@/@1@'.format(target_base, test),
           qtest_executables[test],
-         depends: [test_deps, qtest_emulator],
+         depends: [test_deps, qtest_emulator, emulator_modules],
           env: qtest_env,
           args: ['--tap', '-k'],
           protocol: 'tap',

Thanks. The issue is fixed.

Thanks
Li