[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency
From: |
Zhao Liu |
Subject: |
Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency |
Date: |
Thu, 11 Jul 2024 16:30:46 +0800 |
On Wed, Jul 10, 2024 at 04:50:10PM +0200, Paolo Bonzini wrote:
> Date: Wed, 10 Jul 2024 16:50:10 +0200
> From: Paolo Bonzini <pbonzini@redhat.com>
> Subject: Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency
>
> On Wed, Jul 10, 2024 at 4:48 PM Zhao Liu <zhao1.liu@intel.com> wrote:
> >
> > On Tue, Jul 09, 2024 at 02:28:38PM +0200, Paolo Bonzini wrote:
> > >
> > > Here are the stopping points that I found over the last couple weeks:
> > >
> > > 1.56.0: 2021 edition
> > > 1.59.0: const CStr::from_bytes_with_nul_unchecked (needed by cstr
> > > crate, see below)
> > > 1.64.0: std::ffi::c_char
> > > 1.65.0: Generic Associated Types
> > > 1.74.0: Clippy can be configured in Cargo.toml
> > > 1.77.0: C string literals, offset_of!
> > >
> > > I think 1.59.0 is pretty much the lower bound. Not having offset_of!
> > > will be a bit painful, but it can be worked around (and pretty much
> > > has to be, because 1.77.0 is really new).
> > >
> >
> > An additional question: does our minimum rust version requirement
> > indicate that users with this rust version can compile other
> > dependencies that satisfy QEMU requirements, such as bindgen?
>
> Yes (though in the case of bindgen, like cargo and rustc, we'll use it
> from the distro; Debian bookworm has 0.60.1 so that's what we'll have
> to stick with).
>
I just did some build tests to hopefully help Manos clarify the gap.
With 1.59.0 rust and 0.60.1 bindgen, I found the big problem is this
version can't support current external crates ("bilge" and
"arbitrary-int").
The lowest possible version of bilge is 0.1.1 (because 0.1.0 contains the
removed unstable feature), but v0.1.1 bilge depends on arbitrary-int
(lowest bound is 1.2.4), which is not supported by v1.59.0 rust. So for
this case either we have to keep raising the minimum rust version, or we
have to reconsider the external crates.
And with 1.63.0, the main problem is core_ffi_c is unstable (once_cell
doesn't matter since it's unneeded). Roughly speaking, it seems that if
we didn't have to use the c type as parameters, this problem could
possibly be worked around.
So maybe 1.63.0 is the proper minimum version and this is aligned with
Debian bullseye.
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, (continued)
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Paolo Bonzini, 2024/07/08
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Alex Bennée, 2024/07/09
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Peter Maydell, 2024/07/09
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Paolo Bonzini, 2024/07/09
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Daniel P . Berrangé, 2024/07/09
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Pierrick Bouvier, 2024/07/11
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Manos Pitsidianakis, 2024/07/12
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Alex Bennée, 2024/07/09
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Zhao Liu, 2024/07/10
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Paolo Bonzini, 2024/07/10
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency,
Zhao Liu <=
- Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Alex Bennée, 2024/07/09
Re: [RFC PATCH v4 2/7] rust: add bindgen step as a meson dependency, Alex Bennée, 2024/07/10
[RFC PATCH v4 5/7] .gitattributes: add Rust diff and merge attributes, Manos Pitsidianakis, 2024/07/04
[RFC PATCH v4 7/7] DO NOT MERGE: replace TYPE_PL011 with x-pl011-rust in arm virt machine, Manos Pitsidianakis, 2024/07/04
[RFC PATCH v4 6/7] DO NOT MERGE: add rustdoc build for gitlab pages, Manos Pitsidianakis, 2024/07/04
[RFC PATCH v4 4/7] rust: add PL011 device model, Manos Pitsidianakis, 2024/07/04
Re: [RFC PATCH v4 0/7] Add Rust support, implement ARM PL011, Paolo Bonzini, 2024/07/08