[PATCH preview 0/3] rust: update build system for Meson 1.8.0

Paolo Bonzini posted 3 patches 8 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250405100603.253421-1-pbonzini@redhat.com
Maintainers: "Alex Bennée" <alex.bennee@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Thomas Huth <thuth@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
There is a newer version of this series
docs/devel/rust.rst        |  2 --
.gitlab-ci.d/buildtest.yml |  5 -----
rust/qemu-api/meson.build  | 35 +++++++++++++++--------------------
rust/qemu-api/src/cell.rs  | 22 +++++++++-------------
4 files changed, 24 insertions(+), 40 deletions(-)
[PATCH preview 0/3] rust: update build system for Meson 1.8.0
Posted by Paolo Bonzini 8 months, 2 weeks ago
Meson 1.7.0 and 1.8.0 include improved support for Rust, namely:
* support for "objects" in Rust executables
* support for doctest targets

Use it to remove BQL-related hacks, fix --enable-modules --enable-rust
and also simplify the Meson logic for building the qemu-api crate
(which may help splitting the crate, too).

Meson also supports clippy and rustdoc but there are some bugs in the
prerelease.  I'll try to get them fixed before 1.8.0.

Paolo

Paolo Bonzini (3):
  rust: use "objects" for Rust executables as well
  rust: add qemu-api doctests to "meson test"
  rust: cell: remove support for running doctests with "cargo test --doc"

 docs/devel/rust.rst        |  2 --
 .gitlab-ci.d/buildtest.yml |  5 -----
 rust/qemu-api/meson.build  | 35 +++++++++++++++--------------------
 rust/qemu-api/src/cell.rs  | 22 +++++++++-------------
 4 files changed, 24 insertions(+), 40 deletions(-)

-- 
2.49.0
Re: [PATCH preview 0/3] rust: update build system for Meson 1.8.0
Posted by Bernhard Beschow 8 months, 2 weeks ago

Am 5. April 2025 10:06:00 UTC schrieb Paolo Bonzini <pbonzini@redhat.com>:
>Meson 1.7.0 and 1.8.0 include improved support for Rust, namely:
>* support for "objects" in Rust executables
>* support for doctest targets

Using Meson 1.7.2 (shipped with my distro) I didn't succeed with either of these. If just applying the first patch with --enable-modules I get linker errors again. With all patches applied, "doctest" isn't recognized. Is this perhaps 1.8-only material?

Best regards,
Bernhard

>
>Use it to remove BQL-related hacks, fix --enable-modules --enable-rust
>and also simplify the Meson logic for building the qemu-api crate
>(which may help splitting the crate, too).
>
>Meson also supports clippy and rustdoc but there are some bugs in the
>prerelease.  I'll try to get them fixed before 1.8.0.
>
>Paolo
>
>Paolo Bonzini (3):
>  rust: use "objects" for Rust executables as well
>  rust: add qemu-api doctests to "meson test"
>  rust: cell: remove support for running doctests with "cargo test --doc"
>
> docs/devel/rust.rst        |  2 --
> .gitlab-ci.d/buildtest.yml |  5 -----
> rust/qemu-api/meson.build  | 35 +++++++++++++++--------------------
> rust/qemu-api/src/cell.rs  | 22 +++++++++-------------
> 4 files changed, 24 insertions(+), 40 deletions(-)
>
Re: [PATCH preview 0/3] rust: update build system for Meson 1.8.0
Posted by Paolo Bonzini 8 months, 2 weeks ago
Il mar 8 apr 2025, 22:34 Bernhard Beschow <shentey@gmail.com> ha scritto:

>
>
> Am 5. April 2025 10:06:00 UTC schrieb Paolo Bonzini <pbonzini@redhat.com>:
> >Meson 1.7.0 and 1.8.0 include improved support for Rust, namely:
> >* support for "objects" in Rust executables
> >* support for doctest targets
>
> Using Meson 1.7.2 (shipped with my distro) I didn't succeed with either of
> these. If just applying the first patch with --enable-modules I get linker
> errors again. With all patches applied, "doctest" isn't recognized. Is this
> perhaps 1.8-only material?
>

Yes, it's 1.8 only. Once it's released I will repost it with an update to
pythondeps.toml, for now you can uninstall the distro Meson and install
from their git repository using pip (I think "pip install ." should work).

I did test modules a few months ago when you reported it, but I will check
again before reposting.

Paolo


> Best regards,
> Bernhard
>
> >
> >Use it to remove BQL-related hacks, fix --enable-modules --enable-rust
> >and also simplify the Meson logic for building the qemu-api crate
> >(which may help splitting the crate, too).
> >
> >Meson also supports clippy and rustdoc but there are some bugs in the
> >prerelease.  I'll try to get them fixed before 1.8.0.
> >
> >Paolo
> >
> >Paolo Bonzini (3):
> >  rust: use "objects" for Rust executables as well
> >  rust: add qemu-api doctests to "meson test"
> >  rust: cell: remove support for running doctests with "cargo test --doc"
> >
> > docs/devel/rust.rst        |  2 --
> > .gitlab-ci.d/buildtest.yml |  5 -----
> > rust/qemu-api/meson.build  | 35 +++++++++++++++--------------------
> > rust/qemu-api/src/cell.rs  | 22 +++++++++-------------
> > 4 files changed, 24 insertions(+), 40 deletions(-)
> >
>
>
Re: [PATCH preview 0/3] rust: update build system for Meson 1.8.0
Posted by Zhao Liu 8 months, 2 weeks ago
On Sat, Apr 05, 2025 at 12:06:00PM +0200, Paolo Bonzini wrote:
> Date: Sat,  5 Apr 2025 12:06:00 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: [PATCH preview 0/3] rust: update build system for Meson 1.8.0
> X-Mailer: git-send-email 2.49.0
> 
> Meson 1.7.0 and 1.8.0 include improved support for Rust, namely:
> * support for "objects" in Rust executables
> * support for doctest targets

Is there a patch missing to actually bump the required meson version up
to v1.8.0?

Regards,
Zhao
Re: [PATCH preview 0/3] rust: update build system for Meson 1.8.0
Posted by Paolo Bonzini 8 months, 2 weeks ago
On Mon, Apr 7, 2025 at 9:17 AM Zhao Liu <zhao1.liu@intel.com> wrote:
> On Sat, Apr 05, 2025 at 12:06:00PM +0200, Paolo Bonzini wrote:
> > Date: Sat,  5 Apr 2025 12:06:00 +0200
> > From: Paolo Bonzini <pbonzini@redhat.com>
> > Subject: [PATCH preview 0/3] rust: update build system for Meson 1.8.0
> > X-Mailer: git-send-email 2.49.0
> >
> > Meson 1.7.0 and 1.8.0 include improved support for Rust, namely:
> > * support for "objects" in Rust executables
> > * support for doctest targets
>
> Is there a patch missing to actually bump the required meson version up
> to v1.8.0?

Yes, because there has not been a 1.8.0 release yet (or even an -rc).

Paolo