From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: "Marc-André Lureau" <marcandre.lureau@redhat.com>,
berrange@redhat.com, armbru@redhat.com
Subject: [Qemu-devel] [RFC PATCH v2 0/8] Proof of concept for Meson integration
Date: Wed, 10 Jul 2019 18:14:19 +0200 [thread overview]
Message-ID: <1562775267-1222-1-git-send-email-pbonzini@redhat.com> (raw)
The main change from v1 is that libqemuutil.a, and with it the tracetool
and QAPI generated code, is now generated with meson. This shows how
to do some "computations" in meson.build using its array and dictionary
data structures. It is also a basic usage of the sourceset module for
conditional compilation.
Overall the look of the meson.build code is quite good, but I must
mention the two snags I encountered:
- one is just aboud debuggability. Quoting rules on Windows are crazy
so you really do not want to go through quoting there; with Make the
choice is basically to not support spaces in filenames, Ninja instead
chose to only do shell expansion on POSIX systems. For the sake of
cross-platformness, Meson uses an external script to do "x > y" on both
POSIX and Windows, and that currently is not very debuggable when you
use "make V=1". I know how to fix this and, even though the first
attempt was rejected at https://github.com/mesonbuild/meson/pull/5573,
but I have other arrows in my quiver. Worst case we could pass the
output file to tracetool as a command line argument, but I'd rather
not do that as it is not a QEMU-specific issue and my philosophy so
far has been to improve Meson whenever possible---at least this endeavour
would provide benefit to the community even if QEMU rejects it.
- the second is more fundamental: with Make we're enjoying much freedom in
choosing the include path, in particular the tracing headers are using
$(build_root)/$(<D). Meson does not like that for reasons I have not
completely understood. For now my solution is to generate headers like
"trace/trace-audio.h" and have sixty one-line forwarding headers in the
source tree; for example "audio/trace.h" includes "trace/trace-audio.h".
I'm not sure if it's possible to instead add a one-line "generate
trace headers" directive to each subdirectory's meson.build file.
I suspect that it _is_ possible but you'd still have to change the
#include directives to include the subdirectory name (and then I prefer
the forwarding headers).
The forwarding headers mechanism would of course be possible with the
current Makefiles too, of course.
Other notes:
1) this is only very lightly tested (./configure && make basically)
2) I have not yet converted qemu-ga, which would be next, but I can
already say that the conversion probably will *not* remove the code
duplication we have between Makefile's rules for qemu-ga's QAPI files,
and qapi/Makefile.objs's rules for QEMU's QAPI files.
3) there are two main changes outside patch 4: scripts/ninjatool is now
built from meson.build, which removes duplicate code between Makefile and
configure; and "type -p" is replaced throughout with the more correct
"command -v".
Paolo Bonzini (8):
configure: do not include $(...) variables in config-host.mak
configure: set $PYTHON to a full path
configure: integrate Meson in the build system
convert libqemuutil to meson
libvhost-user: convert to Meson
vhost-user-blk: convert to Meson
vhost-user-scsi: convert to Meson
rdmacm-mux: convert to Meson
.gitignore | 13 +-
Makefile | 191 ++-----
Makefile.objs | 94 +---
audio/trace.h | 1 +
chardev/trace.h | 1 +
configure | 63 ++-
contrib/libvhost-user/Makefile.objs | 1 -
contrib/libvhost-user/meson.build | 2 +
contrib/rdmacm-mux/Makefile.objs | 3 -
contrib/rdmacm-mux/meson.build | 6 +
contrib/vhost-user-blk/Makefile.objs | 1 -
contrib/vhost-user-blk/meson.build | 3 +
contrib/vhost-user-scsi/Makefile.objs | 1 -
contrib/vhost-user-scsi/meson.build | 3 +
crypto/Makefile.objs | 3 +-
hw/9pfs/trace.h | 1 +
hw/acpi/trace.h | 1 +
hw/alpha/trace.h | 1 +
hw/arm/trace.h | 1 +
hw/audio/trace.h | 1 +
hw/block/dataplane/trace.h | 1 +
hw/block/trace.h | 1 +
hw/char/trace.h | 1 +
hw/display/trace.h | 1 +
hw/dma/trace.h | 1 +
hw/gpio/trace.h | 1 +
hw/hppa/trace.h | 1 +
hw/i2c/trace.h | 1 +
hw/i386/trace.h | 1 +
hw/i386/xen/trace.h | 1 +
hw/ide/trace.h | 1 +
hw/input/trace.h | 1 +
hw/intc/trace.h | 1 +
hw/isa/trace.h | 1 +
hw/mem/trace.h | 1 +
hw/misc/macio/trace.h | 1 +
hw/misc/trace.h | 1 +
hw/net/trace.h | 1 +
hw/nvram/trace.h | 1 +
hw/pci-host/trace.h | 1 +
hw/pci/trace.h | 1 +
hw/ppc/trace.h | 1 +
hw/rdma/trace.h | 1 +
hw/rdma/vmw/trace.h | 1 +
hw/riscv/trace.h | 1 +
hw/s390x/trace.h | 1 +
hw/scsi/trace.h | 1 +
hw/sd/trace.h | 1 +
hw/sparc/trace.h | 1 +
hw/sparc64/trace.h | 1 +
hw/timer/trace.h | 1 +
hw/tpm/trace.h | 1 +
hw/usb/trace.h | 1 +
hw/vfio/trace.h | 1 +
hw/virtio/trace.h | 1 +
hw/watchdog/trace.h | 1 +
hw/xen/trace.h | 1 +
meson.build | 154 ++++++
migration/trace.h | 1 +
net/trace.h | 1 +
qapi/Makefile.objs | 20 -
qapi/meson.build | 54 ++
qapi/trace.h | 1 +
qobject/Makefile.objs | 3 -
qobject/meson.build | 3 +
qom/trace.h | 1 +
scripts/ninjatool.py | 988 ++++++++++++++++++++++++++++++++++
scripts/qapi-gen.py | 2 +-
scripts/tracetool.py | 2 +-
scripts/tracetool/backend/ust.py | 6 +-
scripts/tracetool/format/c.py | 5 +-
stubs/Makefile.objs | 43 --
stubs/meson.build | 45 ++
target/arm/trace.h | 1 +
target/hppa/trace.h | 1 +
target/i386/trace.h | 1 +
target/mips/trace.h | 1 +
target/ppc/trace.h | 1 +
target/riscv/trace.h | 1 +
target/s390x/trace.h | 1 +
target/sparc/trace.h | 1 +
trace/Makefile.objs | 51 --
trace/meson.build | 75 +++
ui/trace.h | 1 +
util/Makefile.objs | 59 --
util/meson.build | 57 ++
util/trace.h | 1 +
87 files changed, 1536 insertions(+), 473 deletions(-)
create mode 100644 audio/trace.h
create mode 100644 chardev/trace.h
delete mode 100644 contrib/libvhost-user/Makefile.objs
create mode 100644 contrib/libvhost-user/meson.build
delete mode 100644 contrib/rdmacm-mux/Makefile.objs
create mode 100644 contrib/rdmacm-mux/meson.build
delete mode 100644 contrib/vhost-user-blk/Makefile.objs
create mode 100644 contrib/vhost-user-blk/meson.build
delete mode 100644 contrib/vhost-user-scsi/Makefile.objs
create mode 100644 contrib/vhost-user-scsi/meson.build
create mode 100644 hw/9pfs/trace.h
create mode 100644 hw/acpi/trace.h
create mode 100644 hw/alpha/trace.h
create mode 100644 hw/arm/trace.h
create mode 100644 hw/audio/trace.h
create mode 100644 hw/block/dataplane/trace.h
create mode 100644 hw/block/trace.h
create mode 100644 hw/char/trace.h
create mode 100644 hw/display/trace.h
create mode 100644 hw/dma/trace.h
create mode 100644 hw/gpio/trace.h
create mode 100644 hw/hppa/trace.h
create mode 100644 hw/i2c/trace.h
create mode 100644 hw/i386/trace.h
create mode 100644 hw/i386/xen/trace.h
create mode 100644 hw/ide/trace.h
create mode 100644 hw/input/trace.h
create mode 100644 hw/intc/trace.h
create mode 100644 hw/isa/trace.h
create mode 100644 hw/mem/trace.h
create mode 100644 hw/misc/macio/trace.h
create mode 100644 hw/misc/trace.h
create mode 100644 hw/net/trace.h
create mode 100644 hw/nvram/trace.h
create mode 100644 hw/pci-host/trace.h
create mode 100644 hw/pci/trace.h
create mode 100644 hw/ppc/trace.h
create mode 100644 hw/rdma/trace.h
create mode 100644 hw/rdma/vmw/trace.h
create mode 100644 hw/riscv/trace.h
create mode 100644 hw/s390x/trace.h
create mode 100644 hw/scsi/trace.h
create mode 100644 hw/sd/trace.h
create mode 100644 hw/sparc/trace.h
create mode 100644 hw/sparc64/trace.h
create mode 100644 hw/timer/trace.h
create mode 100644 hw/tpm/trace.h
create mode 100644 hw/usb/trace.h
create mode 100644 hw/vfio/trace.h
create mode 100644 hw/virtio/trace.h
create mode 100644 hw/watchdog/trace.h
create mode 100644 hw/xen/trace.h
create mode 100644 meson.build
create mode 100644 migration/trace.h
create mode 100644 net/trace.h
create mode 100644 qapi/meson.build
create mode 100644 qapi/trace.h
delete mode 100644 qobject/Makefile.objs
create mode 100644 qobject/meson.build
create mode 100644 qom/trace.h
create mode 100755 scripts/ninjatool.py
delete mode 100644 stubs/Makefile.objs
create mode 100644 stubs/meson.build
create mode 100644 target/arm/trace.h
create mode 100644 target/hppa/trace.h
create mode 100644 target/i386/trace.h
create mode 100644 target/mips/trace.h
create mode 100644 target/ppc/trace.h
create mode 100644 target/riscv/trace.h
create mode 100644 target/s390x/trace.h
create mode 100644 target/sparc/trace.h
create mode 100644 trace/meson.build
create mode 100644 ui/trace.h
delete mode 100644 util/Makefile.objs
create mode 100644 util/meson.build
create mode 100644 util/trace.h
--
1.8.3.1
next reply other threads:[~2019-07-10 16:18 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-10 16:14 Paolo Bonzini [this message]
2019-07-10 16:14 ` [Qemu-devel] [PATCH 1/8] configure: do not include $(...) variables in config-host.mak Paolo Bonzini
2019-07-10 16:14 ` [Qemu-devel] [PATCH 2/8] configure: set $PYTHON to a full path Paolo Bonzini
2019-07-10 16:14 ` [Qemu-devel] [PATCH 3/8] configure: integrate Meson in the build system Paolo Bonzini
2019-07-10 16:14 ` [Qemu-devel] [PATCH 4/8] convert libqemuutil to meson Paolo Bonzini
2019-07-13 14:15 ` Markus Armbruster
2019-07-13 21:26 ` Paolo Bonzini
2019-07-27 7:16 ` Markus Armbruster
2019-07-27 12:23 ` Paolo Bonzini
2019-07-27 18:20 ` Peter Maydell
2019-07-29 7:09 ` Markus Armbruster
2019-07-29 8:51 ` Paolo Bonzini
2019-07-29 9:21 ` Peter Maydell
2019-07-29 9:29 ` Paolo Bonzini
2019-07-29 9:32 ` Peter Maydell
2019-07-29 9:36 ` Paolo Bonzini
2019-07-29 11:12 ` Markus Armbruster
2019-07-29 8:21 ` Daniel P. Berrangé
2019-07-29 9:19 ` Peter Maydell
2019-07-29 12:41 ` Alex Bennée
2019-07-29 14:08 ` Paolo Bonzini
2019-07-10 16:14 ` [Qemu-devel] [PATCH 5/8] libvhost-user: convert to Meson Paolo Bonzini
2019-07-10 16:14 ` [Qemu-devel] [PATCH 6/8] vhost-user-blk: " Paolo Bonzini
2019-07-10 16:14 ` [Qemu-devel] [PATCH 7/8] vhost-user-scsi: " Paolo Bonzini
2019-07-10 16:14 ` [Qemu-devel] [PATCH 8/8] rdmacm-mux: " Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1562775267-1222-1-git-send-email-pbonzini@redhat.com \
--to=pbonzini@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=marcandre.lureau@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).