qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH for 11.0 00/11] First batch of Meson/Rust build system changes
@ 2025-12-15  7:49 Paolo Bonzini
  2025-12-15  7:49 ` [PATCH 01/11] build: do not include @block.syms/@qemu.sys with modules disabled Paolo Bonzini
                   ` (9 more replies)
  0 siblings, 10 replies; 16+ messages in thread
From: Paolo Bonzini @ 2025-12-15  7:49 UTC (permalink / raw)
  To: qemu-devel; +Cc: qemu-rust, marcandre.lureau

By bumping the minimum supported version of Meson to 1.10.0 (at least
when --enable-rust is used), C objects can be passed to Rust targets.
This allows to simplify the build process, and possibly also to link
the executables dynamically linking to Rust's libstd which makes them
smaller.

The major snag here is that QEMU wants to be very explicit about the order
of libraries on the command line.  rustc has a normally useful feature
where it records dependent static libraries and adds them to the linker
automatically, but for us it messes up libqemuutil.a's stubs mechanism.
This is fixed (or worked around depending on how you see it) by patches
4 and 5.

Meson 1.10.0 also contains some bugfixes such that Rust can now also be
added to the Windows and macOS CI jobs.  This reveals a few more bugs,
such as the ones fixed in patch 1 and 8.

Finally, Meson 1.10.0 improves Meson's embedded Cargo.toml/Cargo.lock
interpreter, but those changes are still mostly internal and the
interpreter cannot be used yet.  The required changes are planned for
1.11.0; Marc-André already played with them for his GStreamer audio
backend, and a couple more users are hanging out and helping on the
#meson IRC channel, too.  Once this functionality is merged, it will
replace a few hundreds lines of meson.build code and will make it simpler
to add new devices.

I still expect that the --enable-rust option will require bleeding
edge Meson for a good part of next year.  However, as was the case for
the original switch to Meson, this will smooth out and Meson will have
improved much for the whole ecosystem.

Paolo

Marc-André Lureau (2):
  cirrus/macos: enable Rust
  gitlab-ci: enable rust for msys2-64bit

Martin Kletzander (1):
  rust: Do not link qemuutil into Rust rlibs

Paolo Bonzini (8):
  build: do not include @block.syms/@qemu.sys with modules disabled
  tests/meson: do not reuse migration_files variable
  bump meson wheel to 1.10.0
  rust: only link the Rust part of the code into devices
  rust: Meson now adds -Cdefault-linker-libraries
  meson: let Meson handle mixed-language linking of Rust and C objects
  rust: skip compilation if there are no system emulators
  lcitool: enable Rust for Windows cross targets

 configure                                     |   4 +-
 meson.build                                   |  36 +++++++-----------
 .gitlab-ci.d/cirrus.yml                       |   2 +-
 .gitlab-ci.d/windows.yml                      |   7 +++-
 python/scripts/vendor.py                      |   4 +-
 python/wheels/meson-1.10.0-py3-none-any.whl   | Bin 0 -> 1057029 bytes
 pythondeps.toml                               |   4 +-
 rust/chardev/meson.build                      |   2 +-
 rust/hw/char/pl011/meson.build                |  18 +++++----
 rust/hw/timer/hpet/meson.build                |  18 ++++-----
 rust/meson.build                              |   7 ++++
 rust/qom/meson.build                          |   2 +-
 rust/util/meson.build                         |   4 +-
 scripts/rust/rust_root_crate.sh               |   1 +
 .../dockerfiles/fedora-win64-cross.docker     |   2 +
 tests/lcitool/refresh                         |   5 +--
 tests/qtest/meson.build                       |   6 +--
 17 files changed, 64 insertions(+), 58 deletions(-)
 create mode 100644 python/wheels/meson-1.10.0-py3-none-any.whl

-- 
2.52.0



^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2025-12-17  3:31 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-15  7:49 [PATCH for 11.0 00/11] First batch of Meson/Rust build system changes Paolo Bonzini
2025-12-15  7:49 ` [PATCH 01/11] build: do not include @block.syms/@qemu.sys with modules disabled Paolo Bonzini
2025-12-15  7:49 ` [PATCH 02/11] tests/meson: do not reuse migration_files variable Paolo Bonzini
2025-12-15  7:49 ` [PATCH 04/11] rust: Do not link qemuutil into Rust rlibs Paolo Bonzini
2025-12-17  3:37   ` Zhao Liu
2025-12-15  7:49 ` [PATCH 05/11] rust: only link the Rust part of the code into devices Paolo Bonzini
2025-12-17  3:42   ` Zhao Liu
2025-12-15  7:49 ` [PATCH 06/11] rust: Meson now adds -Cdefault-linker-libraries Paolo Bonzini
2025-12-17  3:43   ` Zhao Liu
2025-12-15  7:49 ` [PATCH 07/11] meson: let Meson handle mixed-language linking of Rust and C objects Paolo Bonzini
2025-12-15  7:49 ` [PATCH 08/11] rust: skip compilation if there are no system emulators Paolo Bonzini
2025-12-17  3:55   ` Zhao Liu
2025-12-15  7:49 ` [PATCH 09/11] lcitool: enable Rust for Windows cross targets Paolo Bonzini
2025-12-15 13:01   ` Alex Bennée
2025-12-15  7:49 ` [PATCH 10/11] cirrus/macos: enable Rust Paolo Bonzini
2025-12-15  7:50 ` [PATCH 11/11] gitlab-ci: enable rust for msys2-64bit Paolo Bonzini

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).