qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: qemu-devel@nongnu.org
Cc: qemu-rust@nongnu.org, marcandre.lureau@redhat.com
Subject: [PATCH for 11.0 00/11] First batch of Meson/Rust build system changes
Date: Mon, 15 Dec 2025 08:49:49 +0100	[thread overview]
Message-ID: <20251215075000.335043-1-pbonzini@redhat.com> (raw)

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



             reply	other threads:[~2025-12-15  7:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-15  7:49 Paolo Bonzini [this message]
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

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=20251215075000.335043-1-pbonzini@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-rust@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).