qemu-rust.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/11] rust: allow minimum version of 1.77
@ 2025-05-05  9:04 Paolo Bonzini
  2025-05-05  9:04 ` [PATCH 01/11] lcitool: use newer Rust for Debian and Ubuntu Paolo Bonzini
                   ` (10 more replies)
  0 siblings, 11 replies; 26+ messages in thread
From: Paolo Bonzini @ 2025-05-05  9:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: manos.pitsidianakis, qemu-rust

Debian bookworm provides Rust 1.78 on all architectures except for mips64el,
as part of its packaging of Firefox.  Michael Tokarev confirmed that
it is not a problem at this point to require a rustup-based toolchain
when building for mips64el on bookworm.

This series therefore updates the minimum supported Rust version
to 1.77 (since 1.78 does not really add anything that QEMU needs).
It removes several temporary compatibility shims (including offset_of)
and enables the introduction of some more modern idioms, for example
cast_const()/cast_mut() and "let ... else".  These were useful as early
experiments with procedural macros and with supporting old versions of
Rust, but are not needed anymore.

The remaining major obstacle is const_refs_static, which was stabilized
in 1.83.0 and allows for much-improved vmstate bindings.  These were
prototyped by Zhao and myself and I'll post them shortly for reference.
It's unlikely that Debian bookworm will update rustc-web any further,
since the next Firefox ESR version is expected roughly at the same time
as the Debian trixie release.

Paolo

v1->v2:
* rebase on top of "rust: centralize config in workspace root"
* also adjust Dockerfile for Ubuntu 22.04
* extract separate patch to require Rust 1.77.0 in Meson and Cargo
* fix TODO about zeroability of classes
* use "let ... else" more (and better) in qemu_api_macros
* run everything through rustfmt
* place ptr_cast_constness patch earlier, since cast_mut()/cast_const()
  were introduced before offset_of and c"" literals

Paolo Bonzini (11):
  lcitool: use newer Rust for Debian and Ubuntu
  meson, cargo: require Rust 1.77.0
  rust: use std::ffi instead of std::os::raw
  rust: let bilge use "let ... else"
  rust: qemu_api_macros: make pattern matching more readable and
    efficient
  rust: use MaybeUninit::zeroed() in const context
  rust: qom: fix TODO about zeroability of classes
  rust: enable clippy::ptr_cast_constness
  rust: remove offset_of replacement
  rust: replace c_str! with c"" literals
  docs: rust: update for newer minimum supported version

 docs/about/build-platforms.rst                |  11 +-
 docs/devel/rust.rst                           |  38 +---
 meson.build                                   |   6 +-
 rust/Cargo.lock                               |   1 -
 rust/Cargo.toml                               |   6 +-
 rust/clippy.toml                              |   2 +-
 rust/hw/char/pl011/src/device.rs              |   4 +-
 rust/hw/char/pl011/src/device_class.rs        |  13 +-
 rust/hw/char/pl011/src/lib.rs                 |   6 +-
 rust/hw/timer/hpet/src/fw_cfg.rs              |   6 +-
 rust/hw/timer/hpet/src/hpet.rs                |  28 ++-
 rust/hw/timer/hpet/src/lib.rs                 |   4 +-
 rust/qemu-api-macros/src/lib.rs               | 113 ++++--------
 rust/qemu-api/Cargo.toml                      |   3 -
 rust/qemu-api/build.rs                        |   7 -
 rust/qemu-api/meson.build                     |   5 -
 rust/qemu-api/src/c_str.rs                    |  61 -------
 rust/qemu-api/src/cell.rs                     |   6 +-
 rust/qemu-api/src/chardev.rs                  |   5 +-
 rust/qemu-api/src/irq.rs                      |   6 +-
 rust/qemu-api/src/lib.rs                      |   7 +-
 rust/qemu-api/src/memory.rs                   |   3 +-
 rust/qemu-api/src/offset_of.rs                | 168 ------------------
 rust/qemu-api/src/qdev.rs                     |   9 +-
 rust/qemu-api/src/qom.rs                      |  14 +-
 rust/qemu-api/src/timer.rs                    |   4 +-
 rust/qemu-api/src/vmstate.rs                  |  14 +-
 rust/qemu-api/src/zeroable.rs                 | 104 ++---------
 rust/qemu-api/tests/tests.rs                  |  11 +-
 rust/qemu-api/tests/vmstate_tests.rs          |  27 +--
 .../ci/setup/ubuntu/ubuntu-2204-aarch64.yaml  |   2 +-
 .../ci/setup/ubuntu/ubuntu-2204-s390x.yaml    |   2 +-
 subprojects/bilge-impl-0.2-rs.wrap            |   1 -
 .../packagefiles/bilge-impl-1.63.0.patch      |  45 -----
 .../dockerfiles/debian-amd64-cross.docker     |   2 +-
 .../dockerfiles/debian-arm64-cross.docker     |   2 +-
 .../dockerfiles/debian-armhf-cross.docker     |   2 +-
 .../dockerfiles/debian-i686-cross.docker      |   2 +-
 .../dockerfiles/debian-mips64el-cross.docker  |   2 +-
 .../dockerfiles/debian-mipsel-cross.docker    |   2 +-
 .../dockerfiles/debian-ppc64el-cross.docker   |   2 +-
 .../dockerfiles/debian-s390x-cross.docker     |   2 +-
 tests/docker/dockerfiles/debian.docker        |   2 +-
 tests/docker/dockerfiles/ubuntu2204.docker    |   3 +-
 tests/lcitool/mappings.yml                    |   5 +
 tests/lcitool/refresh                         |   5 +-
 46 files changed, 169 insertions(+), 604 deletions(-)
 delete mode 100644 rust/qemu-api/src/c_str.rs
 delete mode 100644 rust/qemu-api/src/offset_of.rs
 delete mode 100644 subprojects/packagefiles/bilge-impl-1.63.0.patch

-- 
2.49.0



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

end of thread, other threads:[~2025-05-06  8:17 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-05-05  9:04 [PATCH 00/11] rust: allow minimum version of 1.77 Paolo Bonzini
2025-05-05  9:04 ` [PATCH 01/11] lcitool: use newer Rust for Debian and Ubuntu Paolo Bonzini
2025-05-05  9:04 ` [PATCH 02/11] meson, cargo: require Rust 1.77.0 Paolo Bonzini
2025-05-05  9:29   ` Manos Pitsidianakis
2025-05-06  7:39   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 03/11] rust: use std::ffi instead of std::os::raw Paolo Bonzini
2025-05-06  7:40   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 04/11] rust: let bilge use "let ... else" Paolo Bonzini
2025-05-06  7:41   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 05/11] rust: qemu_api_macros: make pattern matching more readable and efficient Paolo Bonzini
2025-05-06  7:48   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 06/11] rust: use MaybeUninit::zeroed() in const context Paolo Bonzini
2025-05-06  7:56   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 07/11] rust: qom: fix TODO about zeroability of classes Paolo Bonzini
2025-05-05  9:32   ` Manos Pitsidianakis
2025-05-06  8:01   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 08/11] rust: enable clippy::ptr_cast_constness Paolo Bonzini
2025-05-06  8:04   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 09/11] rust: remove offset_of replacement Paolo Bonzini
2025-05-05  9:34   ` Manos Pitsidianakis
2025-05-06  8:32   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 10/11] rust: replace c_str! with c"" literals Paolo Bonzini
2025-05-06  8:34   ` Zhao Liu
2025-05-05  9:04 ` [PATCH 11/11] docs: rust: update for newer minimum supported version Paolo Bonzini
2025-05-05  9:35   ` Manos Pitsidianakis
2025-05-06  8:38   ` Zhao Liu

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