Skip to contentSkip to conversation

tests: add missing genh dependency

PATCH In review Paolo Bonzini 3 participants 3 messages Sep 11, 2020 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests: add missing genh dependency

Fix high-parallelism builds by forcing all generated headers to be created before tests are compiled.

---
 tests/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/meson.build +2 -2
index 3683512dca..e2b915ea8f 100644
@@ -56,7 +56,7 @@ test_qapi_files = custom_target('Test QAPI files',
 # perhaps change qapi_gen to replace / with _, like Meson itself does?
 subdir('include')
 
-libtestqapi = static_library('testqapi', sources: [test_qapi_files, test_qapi_outputs_extra])
+libtestqapi = static_library('testqapi', sources: [test_qapi_files, genh, test_qapi_outputs_extra])
 testqapi = declare_dependency(link_with: libtestqapi)
 
 testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')
@@ -223,7 +223,7 @@ foreach test_name, extra: tests
     src += test_ss.all_sources()
     deps += test_ss.all_dependencies()
   endif
-  exe = executable(test_name, src, dependencies: deps)
+  exe = executable(test_name, src, genh, dependencies: deps)
 
   test(test_name, exe,
        depends: test_deps.get(test_name, []),
Signature · 1 line
2.26.2
Tested-by on v1 1/1
#1 lore raw
Quoted 24 lines · Paolo Bonzini

Fix high-parallelism builds by forcing all generated headers to be created before tests are compiled.

---
 tests/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/meson.build +1 -1
index 3683512dca..e2b915ea8f 100644
@@ -56,7 +56,7 @@ test_qapi_files = custom_target('Test QAPI files',
 # perhaps change qapi_gen to replace / with _, like Meson itself does?
 subdir('include')
 
-libtestqapi = static_library('testqapi', sources: [test_qapi_files, test_qapi_outputs_extra])
+libtestqapi = static_library('testqapi', sources: [test_qapi_files, genh, test_qapi_outputs_extra])
 testqapi = declare_dependency(link_with: libtestqapi)
 
 testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')

tests/meson.build foreach test_name, extra: tests · line 229

Quoted 8 lines
tests/meson.build +1 -1
@@ -223,7 +223,7 @@ foreach test_name, extra: tests
     src += test_ss.all_sources()
     deps += test_ss.all_dependencies()
   endif
-  exe = executable(test_name, src, dependencies: deps)
+  exe = executable(test_name, src, genh, dependencies: deps)
 
   test(test_name, exe,
        depends: test_deps.get(test_name, []),

Tested with 160 processors,

make -j120

Reviewed-by on v1 1/1
#2 lore raw
In reply to Paolo Bonzini
Quoted 2 lines · Paolo Bonzini

Fix high-parallelism builds by forcing all generated headers to be created before tests are compiled.

FYI I had this problem too (simply building with -j8) simply adding a new qapi/file.json.

Quoted 30 lines
---
 tests/meson.build | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
tests/meson.build +2 -2
index 3683512dca..e2b915ea8f 100644
@@ -56,7 +56,7 @@ test_qapi_files = custom_target('Test QAPI files',
 # perhaps change qapi_gen to replace / with _, like Meson itself does?
 subdir('include')
 
-libtestqapi = static_library('testqapi', sources: [test_qapi_files, test_qapi_outputs_extra])
+libtestqapi = static_library('testqapi', sources: [test_qapi_files, genh, test_qapi_outputs_extra])
 testqapi = declare_dependency(link_with: libtestqapi)
 
 testblock = declare_dependency(dependencies: [block], sources: 'iothread.c')
@@ -223,7 +223,7 @@ foreach test_name, extra: tests
     src += test_ss.all_sources()
     deps += test_ss.all_dependencies()
   endif
-  exe = executable(test_name, src, dependencies: deps)
+  exe = executable(test_name, src, genh, dependencies: deps)
 
   test(test_name, exe,
        depends: test_deps.get(test_name, []),