meson: Fixes for dbus modules
v2 cover meson: Fixes for dbus modules
I found it was failing to build dbus modules when --enable-dbus so here are fixes.
---
Changes in v2:
- Updated MAINTAINERS.
- Link to v1: https://lore.kernel.org/r/[email protected]
---
Akihiko Odaki (4):
Move dbus-display1 out of ui
audio: Depend on dbus_display1_dep
meson: Explicitly specify dbus-display1.h dependency tests/qtest: Depend on dbus_display1_dep
MAINTAINERS | 1 + meson.build | 21 +++++++++++++++++++++ ui/dbus.h | 2 +- audio/dbusaudio.c | 2 +- tests/qtest/dbus-display-test.c | 2 +- audio/meson.build | 3 ++- ui/dbus-display1.xml => dbus-display1.xml | 0 tests/qtest/meson.build | 2 +- ui/meson.build | 18 ------------------ 9 files changed, 28 insertions(+), 23 deletions(-)
---
base-commit: 4705fc0c8511d073bee4751c3c974aab2b10a970
change-id: 20231215-dbus-86876ecb7b09
Best regards,
Signature · 1 line
Akihiko Odaki <[email protected]>
PATCH v2 1/4 Move dbus-display1 out of ui
Despite its name, dbus-display1 does not only provide DBus interfaces for the display but also for the audio.
--- MAINTAINERS | 1 + meson.build | 21 +++++++++++++++++++++ ui/dbus.h | 2 +- audio/dbusaudio.c | 2 +- tests/qtest/dbus-display-test.c | 2 +- ui/dbus-display1.xml => dbus-display1.xml | 0 ui/meson.build | 18 ------------------ 7 files changed, 25 insertions(+), 21 deletions(-)
MAINTAINERS +1 -0
@@ -3389,6 +3389,7 @@ F: docs/sphinx/dbus* F: docs/sphinx/fakedbusdoc.py F: tests/qtest/dbus* F: scripts/xml-preprocess* +F: dbus-display.xml Seccomp M: Daniel P. Berrange <[email protected]>
meson.build +21 -0
@@ -2014,6 +2014,27 @@ dbus_display = get_option('dbus_display') \ error_message: gdbus_codegen_error.format('-display dbus')) \ .allowed() +if dbus_display + env = environment() + env.set('TARGETOS', targetos) + xml = custom_target('dbus-display preprocess', + input: 'dbus-display1.xml', + output: 'dbus-display1.xml', + env: env, + command: [xml_pp, '@INPUT@', '@OUTPUT@']) + dbus_display1 = custom_target('dbus-display gdbus-codegen', + output: ['dbus-display1.h', 'dbus-display1.c'], + input: xml, + command: [gdbus_codegen, '@INPUT@', + '--glib-min-required', '2.64', + '--output-directory', meson.current_build_dir(), + '--interface-prefix', 'org.qemu.', + '--c-namespace', 'QemuDBus', + '--generate-c-code', '@BASENAME@']) + dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) + dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) +endif + have_virtfs = get_option('virtfs') \ .require(targetos == 'linux' or targetos == 'darwin', error_message: 'virtio-9p (virtfs) requires Linux or macOS') \
ui/dbus.h +1 -1
@@ -31,7 +31,7 @@#include "ui/console.h" #include "ui/clipboard.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" typedef struct DBusClipboardRequest { GDBusMethodInvocation *invocation;
audio/dbusaudio.c +1 -1
@@ -34,7 +34,7 @@#endif #include "ui/dbus.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" #define AUDIO_CAP "dbus"#include "audio.h"
tests/qtest/dbus-display-test.c +1 -1
@@ -5,7 +5,7 @@#include <gio/gio.h> #include <gio/gunixfdlist.h> #include "libqtest.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" static GDBusConnection *test_dbus_p2p_from_fd (int fd)
dbus-display1.xml renamed from ui/dbus-display1.xml +0 -0
ui/meson.build +0 -18
@@ -75,24 +75,6 @@ endif if dbus_display dbus_ss = ss.source_set() - env = environment() - env.set('TARGETOS', targetos) - xml = custom_target('dbus-display preprocess', - input: 'dbus-display1.xml', - output: 'dbus-display1.xml', - env: env, - command: [xml_pp, '@INPUT@', '@OUTPUT@']) - dbus_display1 = custom_target('dbus-display gdbus-codegen', - output: ['dbus-display1.h', 'dbus-display1.c'], - input: xml, - command: [gdbus_codegen, '@INPUT@', - '--glib-min-required', '2.64', - '--output-directory', meson.current_build_dir(), - '--interface-prefix', 'org.qemu.', - '--c-namespace', 'QemuDBus', - '--generate-c-code', '@BASENAME@']) - dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) - dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) dbus_ss.add(when: [gio, dbus_display1_dep], if_true: [files( 'dbus-chardev.c',
Signature · 1 line
2.43.0
Re: [PATCH v2 1/4] Move dbus-display1 out of ui
Hi
Quoted 5 lines · Akihiko Odaki
Despite its name, dbus-display1 does not only provide DBus interfaces for the display but also for the audio.
Signed-off-by Akihiko Odaki <[email protected]>
It can actually do a lot more, since you can arbitrarily redirect chardev devices.. USB, smartcard, QMP and what's not are possible.
Yet, this is a -display module, so we should leave it under ui/ for now imho
Quoted 131 lines
--- MAINTAINERS | 1 + meson.build | 21 +++++++++++++++++++++ ui/dbus.h | 2 +- audio/dbusaudio.c | 2 +- tests/qtest/dbus-display-test.c | 2 +- ui/dbus-display1.xml => dbus-display1.xml | 0 ui/meson.build | 18 ------------------ 7 files changed, 25 insertions(+), 21 deletions(-)MAINTAINERS +1
-0@@ -3389,6 +3389,7 @@ F: docs/sphinx/dbus* F: docs/sphinx/fakedbusdoc.py F: tests/qtest/dbus* F: scripts/xml-preprocess* +F: dbus-display.xml Seccomp M: Daniel P. Berrange <[email protected]>meson.build +21
-0@@ -2014,6 +2014,27 @@ dbus_display = get_option('dbus_display') \ error_message: gdbus_codegen_error.format('-display dbus')) \ .allowed() +if dbus_display + env = environment() + env.set('TARGETOS', targetos) + xml = custom_target('dbus-display preprocess', + input: 'dbus-display1.xml', + output: 'dbus-display1.xml', + env: env, + command: [xml_pp, '@INPUT@', '@OUTPUT@']) + dbus_display1 = custom_target('dbus-display gdbus-codegen', + output: ['dbus-display1.h', 'dbus-display1.c'], + input: xml, + command: [gdbus_codegen, '@INPUT@', + '--glib-min-required', '2.64', + '--output-directory', meson.current_build_dir(), + '--interface-prefix', 'org.qemu.', + '--c-namespace', 'QemuDBus', + '--generate-c-code', '@BASENAME@']) + dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) + dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) +endif + have_virtfs = get_option('virtfs') \ .require(targetos == 'linux' or targetos == 'darwin', error_message: 'virtio-9p (virtfs) requires Linux or macOS') \ui/dbus.h +1
-1@@ -31,7 +31,7 @@#include "ui/console.h" #include "ui/clipboard.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" typedef struct DBusClipboardRequest { GDBusMethodInvocation *invocation;audio/dbusaudio.c +1
-1@@ -34,7 +34,7 @@#endif #include "ui/dbus.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" #define AUDIO_CAP "dbus"#include "audio.h" tests/qtest/dbus-display-test.c +1
-1@@ -5,7 +5,7 @@#include <gio/gio.h> #include <gio/gunixfdlist.h> #include "libqtest.h" -#include "ui/dbus-display1.h" +#include "dbus-display1.h" static GDBusConnection *test_dbus_p2p_from_fd (int fd)dbus-display1.xml renamed from ui/dbus-display1.xml +0
-0ui/meson.build +0
-19@@ -75,24 +75,6 @@ endif if dbus_display dbus_ss = ss.source_set() - env = environment() - env.set('TARGETOS', targetos) - xml = custom_target('dbus-display preprocess', - input: 'dbus-display1.xml', - output: 'dbus-display1.xml', - env: env, - command: [xml_pp, '@INPUT@', '@OUTPUT@']) - dbus_display1 = custom_target('dbus-display gdbus-codegen', - output: ['dbus-display1.h', 'dbus-display1.c'], - input: xml, - command: [gdbus_codegen, '@INPUT@', - '--glib-min-required', '2.64', - '--output-directory', meson.current_build_dir(), - '--interface-prefix', 'org.qemu.', - '--c-namespace', 'QemuDBus', - '--generate-c-code', '@BASENAME@']) - dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) - dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) dbus_ss.add(when: [gio, dbus_display1_dep], if_true: [files( 'dbus-chardev.c', --2.43.0
Signature · 1 line
Marc-André Lureau
Re: [PATCH v2 1/4] Move dbus-display1 out of ui
Quoted 7 lines · Marc-André Lureau
Hi
Quoted 4 lines · Akihiko Odaki
Despite its name, dbus-display1 does not only provide DBus interfaces for the display but also for the audio.
Quoted 6 lines
Quoted 1 line
Signed-off-by Akihiko Odaki <[email protected]>It can actually do a lot more, since you can arbitrarily redirect chardev devices.. USB, smartcard, QMP and what's not are possible.
Yet, this is a -display module, so we should leave it under ui/ for now imho
I'm making this change specifically for audio. audio/dbusaudio.c has no dependency on the display despite it's part of the dbus-display1 interface.
By the way, I noticed audio/dbusaudio.c includes ui/dbus.h for no reason so I removed the inclusion in v3. It clarifies audio/dbus is independent of ui/dbus.
Regards,
Akihiko Odaki
PATCH v2 2/4 audio: Depend on dbus_display1_dep
In reply to Akihiko Odakidbusaudio needs dbus_display1_dep.
--- audio/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
audio/meson.build +2 -1
@@ -30,7 +30,8 @@ endforeach if dbus_display module_ss = ss.source_set() - module_ss.add(when: [gio, pixman], if_true: files('dbusaudio.c')) + module_ss.add(when: [gio, dbus_display1_dep, pixman], + if_true: files('dbusaudio.c')) audio_modules += {'dbus': module_ss} endif
Signature · 1 line
2.43.0
Re: [PATCH v2 2/4] audio: Depend on dbus_display1_dep
Hi
Quoted 4 lines · Akihiko Odaki
dbusaudio needs
dbus_display1_dep.Fixes 739362d4205c ("audio: add "dbus" audio backend")
The build didn't fail, did it? You don't need to backport this, thus I don't think "Fixes" apply here.
(furthermore, dbus_display1_dep was added later, in commit 1222070e7 "meson: ensure dbus-display generated code is built before other units")
Quoted 1 line
Signed-off-by Akihiko Odaki <[email protected]>
otherwise, lgtm
Quoted 23 lines
--- audio/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)audio/meson.build +2
-2@@ -30,7 +30,8 @@ endforeach if dbus_display module_ss = ss.source_set() - module_ss.add(when: [gio, pixman], if_true: files('dbusaudio.c')) + module_ss.add(when: [gio, dbus_display1_dep, pixman], + if_true: files('dbusaudio.c')) audio_modules += {'dbus': module_ss} endif --2.43.0
Signature · 1 line
Marc-André Lureau
PATCH v2 3/4 meson: Explicitly specify dbus-display1.h dependency
In reply to Akihiko OdakiExplicitly specify dbus-display1.h as a dependency so that files depending on it will not get compiled too early.
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
meson.build +1 -1
@@ -2032,7 +2032,7 @@ if dbus_display '--c-namespace', 'QemuDBus', '--generate-c-code', '@BASENAME@']) dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) - dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) + dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, sources: dbus_display1[0]) endif have_virtfs = get_option('virtfs') \
Signature · 1 line
2.43.0
Re: [PATCH v2 3/4] meson: Explicitly specify dbus-display1.h dependency
Hi
Quoted 6 lines · Akihiko Odaki
Explicitly specify
dbus-display1.has a dependency so that files depending on it will not get compiled too early.Fixes 1222070e7728 ("meson: ensure dbus-display generated code is built before other units")Signed-off-by Akihiko Odaki <[email protected]>
ok, hopefully this finally fixes the problem.. I have the feeling the solution applied in this commit isn't the right one..
Quoted 22 lines
--- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)meson.build +1
-2@@ -2032,7 +2032,7 @@ if dbus_display '--c-namespace', 'QemuDBus', '--generate-c-code', '@BASENAME@']) dbus_display1_lib = static_library('dbus-display1', dbus_display1, dependencies: gio) - dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, include_directories: include_directories('.')) + dbus_display1_dep = declare_dependency(link_with: dbus_display1_lib, sources: dbus_display1[0]) endif have_virtfs = get_option('virtfs') \ --2.43.0
Signature · 1 line
Marc-André Lureau
PATCH v2 4/4 tests/qtest: Depend on dbus_display1_dep
In reply to Akihiko OdakiIt ensures dbus-display1.c will not be recompiled.
--- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/qtest/meson.build +1 -1
@@ -332,7 +332,7 @@ if vnc.found() endif if dbus_display - qtests += {'dbus-display-test': [dbus_display1, gio]} + qtests += {'dbus-display-test': [dbus_display1_dep, gio]} endif qtest_executables = {}
Signature · 1 line
2.43.0
Re: [PATCH v2 4/4] tests/qtest: Depend on dbus_display1_dep
Quoted 4 lines · Akihiko Odaki
It ensures
dbus-display1.cwill not be recompiled.Signed-off-by Akihiko Odaki <[email protected]>
Quoted 22 lines
--- tests/qtest/meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/qtest/meson.build +1
-2@@ -332,7 +332,7 @@ if vnc.found() endif if dbus_display - qtests += {'dbus-display-test': [dbus_display1, gio]} + qtests += {'dbus-display-test': [dbus_display1_dep, gio]} endif qtest_executables = {} --2.43.0
Signature · 1 line
Marc-André Lureau
Hi Akihiko
Quoted 10 lines · Akihiko Odaki
I found it was failing to build dbus modules when --enable-dbus so here are fixes.
Signed-off-by Akihiko Odaki <[email protected]>---
Changes in v2:
- UpdatedMAINTAINERS.
- Link to v1: https://lore.kernel.org/r/[email protected]
Quoted 6 lines
---
Akihiko Odaki (4):
Move dbus-display1 out of ui
audio: Depend ondbus_display1_dep
meson: Explicitly specifydbus-display1.hdependency tests/qtest: Depend ondbus_display1_dep
Can you send a v4 which doesn't move the dbus-display.xml out of display/ but has the rest of the dependency fixes and r-b?
thanks
Quoted 20 lines
MAINTAINERS | 1 + meson.build | 21 +++++++++++++++++++++ ui/dbus.h | 2 +- audio/dbusaudio.c | 2 +- tests/qtest/dbus-display-test.c | 2 +- audio/meson.build | 3 ++- ui/dbus-display1.xml => dbus-display1.xml | 0 tests/qtest/meson.build | 2 +- ui/meson.build | 18 ------------------ 9 files changed, 28 insertions(+), 23 deletions(-)---
base-commit:4705fc0c8511d073bee4751c3c974aab2b10a970
change-id: 20231215-dbus-86876ecb7b09Best regards,
--
Akihiko Odaki <[email protected]>
Signature · 1 line
Marc-André Lureau