Skip to content

Meson changes for QEMU 8.0

Paolo Bonzini qemu-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest30 patches 61 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/30configure: remove useless write_c_skeletonconfigure+0 -12 replies
2/30configure: remove dead functionconfigure+0 -42 replies
3/30configure: remove useless testconfigure+1 -113 replies
4/30configure: preserve qemu-ga variablesconfigure+6 -172 replies
5/30configure: remove backwards-compatibility and obsolete optionsconfigure+0 -202 replies
6/30meson: tweak hardening options for Windowsmeson.build+1 -43 replies
7/30meson: support meson 0.64 -Doptimization=plainmeson.build+7 -92 replies
8/30meson: require 0.63.0configure meson meson.build+3 -31 reply
9/30meson: use prefer_static optionconfigure docs/devel/build-system.rst meson.build +1 more+7 -132 replies
10/30meson: remove static_kwargsmeson.build tcg/meson.build+84 -1302 replies
11/30meson: cleanup dummy-cpus.c rulesaccel/meson.build+2 -72 replies
12/30modinfo: lookup compile_commands.json by objectmeson.build scripts/modinfo-collect.py+15 -221 reply
13/30configure: remove backwards-compatibility codeconfigure+0 -101 reply
14/30configure: test all warningsconfigure+5 -22 replies
15/30meson: cleanup compiler detectionmeson.build+35 -272 replies
16/30build: move glib detection and workarounds to mesonblock/meson.build configure contrib/plugins/Makefile +2 more+74 -971 reply
17/30configure: remove pkg-config functionsconfigure docs/devel/build-system.rst+3 -202 replies
18/30configure, meson: move --enable-modules to Mesonconfigure meson.build meson_options.txt +1 more+12 -212 replies
19/30configure, meson: move --enable-debug-info to Mesonconfigure scripts/meson-buildoptions.py scripts/meson-buildoptions.sh+5 -55 replies
20/30meson: prepare move of QEMU_CFLAGS to mesonmeson.build+29 -242 replies
21/30build: move sanitizer tests to mesonconfigure docs/devel/build-system.rst meson.build +4 more+73 -1593 replies
22/30build: move SafeStack tests to mesonconfigure meson.build meson_options.txt +1 more+32 -731 reply
23/30build: move coroutine backend selection to mesonconfigure meson.build meson_options.txt +4 more+38 -651 reply
24/30build: move stack protector flag selection to mesonconfigure meson.build meson_options.txt +1 more+34 -431 reply
25/30build: move warning flag selection to mesonconfigure contrib/plugins/Makefile meson.build+51 -1181 reply
26/30build: move remaining compiler flag tests to mesonconfigure meson.build+59 -691 reply
27/30build: move compiler version check to mesonconfigure meson.build+11 -254 replies
28/30docs: update build system docsdocs/devel/build-system.rst+164 -1111 reply
29/30configure: do not rerun the tests with -Werrorconfigure+1 -341 reply
30/30meson: always log qemu-iotests verboselytests/qemu-iotests/meson.build+1 -04 replies

Reviews trailers per patch

26 of 30 patches have a Reviewed-by or Acked-by.

PatchPeter MaydellPhilippe Mathieu-DaudéThomas HuthMarc-André LureauDaniel P. Berrangé
1/30R-b R-b
2/30R-b R-b
3/30R-b R-b
4/30R-b R-b
5/30R-b R-b
6/30R-b
7/30R-b
8/30R-b
9/30R-b R-b
10/30R-b R-b
11/30R-b R-b
12/30R-b
13/30R-b
14/30R-b R-b
15/30R-b R-b
16/30R-b
17/30R-b R-b
18/30R-b R-b
19/30R-b
20/30R-b R-b
21/30
22/30R-b
23/30R-b
24/30R-b
25/30R-b
26/30R-b
27/30
28/30
29/30R-b
30/30

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 5 reviewers.

Read the v1 thread

Cover letter [PATCH for-8.0 00/30] Meson changes for QEMU 8.0

The final bout of conversions removes the remaining compiler tests for emulators, applies a few cleanups that are enabled by version 0.63 of Meson, and updates the documentation.

Committing this however requires first a libvirt-ci update, in order to enable using Python 3.8/3.9 on CentOS 8 and SLES 15. I am still working on it but the review can start early for these patches.

A final comparison for the effort has a net negative of around 4000 lines of code, despite the growth of QEMU itself in the meanwhile:

before after
--------------------------------------------------------------------------
8647 configure 4240 meson.build
1296 Makefile 1970 configure

  985 tests/Makefile.include         337 Makefile
  440 rules.mak                      224 scripts/meson-buildoptions.py
  379 scripts/tap-driver.pl          171 tests/Makefile.include
  287 Makefile.target                129 scripts/nsis.py
  263 tests/tcg/configure.sh         113 scripts/mtest2make.py

129 scripts/create_config 48 scripts/undefsym.py
~5500 various Makefile fragments ~6500 various meson.build files
--------------------------------------------------------------------------
17926 total 13732 total

Completing the conversion took roughly two years and a lot of the complexity in how QEMU is built is indeed essential, but I think it's agreed that:

- the disruption to the developers was minimal, and even Windows only took a month or so to solidify;

- there is overall feature parity for both configure/Makefile<->meson and for tap-driver.pl<->"meson test", but with fewer bugs and fewer (though not zero) workarounds required. For Meson, the main recurring issue is probably the gnutls headers issue on Homebrew; see for example commit 76f67bac79f6, "meson: Propagate gnutls dependency to migration", 2021-04-01)

- the original target of the conversion ("make it trivial to do trivial things; easy to extend existing things; possible to do everything else") has been achieved. New dependencies such as ninja, were introduced in such a way as to make them familiar to shell/Make users, and did provide subtle quality of life improvements (e.g. rebuild targets on command line changes)

New build system features since the introduction of Meson include switching to config/targets files, custom device configuration (--with-devices-ARCH=), the modinfo mechanism for module loading, entitlement support for Hypervisor.framework, the preinstall tree, autogenerated parsing of the configure command line, and cross-compilation of pc-bios/ (admittedly not done by Meson, but not hindered either).

Big thanks to Akihiko, Alex, Daniel, Marc-André, Richard, Thomas and everybody else that shared the work and the reviews!

Thanks,

Paolo

Paolo Bonzini (30):
configure: remove useless write_c_skeleton
configure: remove dead function
configure: remove useless test
configure: preserve qemu-ga variables
configure: remove backwards-compatibility and obsolete options
meson: tweak hardening options for Windows
meson: support meson 0.64 -Doptimization=plain
meson: require 0.63.0
meson: use prefer_static option
meson: remove static_kwargs
meson: cleanup dummy-cpus.c rules
modinfo: lookup compile_commands.json by object
configure: remove backwards-compatibility code
configure: test all warnings
meson: cleanup compiler detection
build: move glib detection and workarounds to meson
configure: remove pkg-config functions
configure, meson: move --enable-modules to Meson configure, meson: move --enable-debug-info to Meson
meson: prepare move of QEMU_CFLAGS to meson
build: move sanitizer tests to meson
build: move SafeStack tests to meson
build: move coroutine backend selection to meson
build: move stack protector flag selection to meson
build: move warning flag selection to meson
build: move remaining compiler flag tests to meson
build: move compiler version check to meson
docs: update build system docs
configure: do not rerun the tests with -Werror
meson: always log qemu-iotests verbosely

 accel/meson.build                             |   9 +-
 block/meson.build                             |   1 +
 configure                                     | 760 +-----------------
 contrib/plugins/Makefile                      |   7 +-
 docs/devel/build-system.rst                   | 286 ++++---
 meson                                         |   2 +-
 meson.build                                   | 684 +++++++++++-----
 meson_options.txt                             |  13 +
 plugins/meson.build                           |   2 +-
 qga/meson.build                               |   2 +-
 scripts/meson-buildoptions.py                 |   3 +
 scripts/meson-buildoptions.sh                 |  22 +
 scripts/modinfo-collect.py                    |  23 +-
 tcg/meson.build                               |   2 +-
 tests/qemu-iotests/meson.build                |   3 +-
 tests/unit/meson.build                        |   2 +-
 ...{coroutine-win32.c => coroutine-windows.c} |   0
 util/meson.build                              |   2 +-
 18 files changed, 716 insertions(+), 1107 deletions(-)
 rename util/{coroutine-win32.c => coroutine-windows.c} (100%)
Signature · 1 line
2.38.1