From: Kevin Wolf <kwolf@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Daniel P. Berrangé" <berrange@redhat.com>, qemu-devel@nongnu.org
Subject: Re: [RFC PATCH 00/16] rust: allow older versions of rustc and bindgen
Date: Fri, 18 Oct 2024 19:05:39 +0200 [thread overview]
Message-ID: <ZxKVY_5pfP3cAlcP@redhat.com> (raw)
In-Reply-To: <2f34640b-77ad-4267-975e-7898b6f8e38d@redhat.com>
Am 18.10.2024 um 17:43 hat Paolo Bonzini geschrieben:
> On 10/18/24 15:31, Daniel P. Berrangé wrote:
> > On Tue, Oct 15, 2024 at 03:17:18PM +0200, Paolo Bonzini wrote:
> > > On top of this, the required version of bindgen is still too new
> > > for Debian 12 and Ubuntu 22.04. This is fixed by the last four patches.
> > >
> > > This is an RFC for two reasons. First, because it would be a valid
> > > decision to delay enabling of Rust until at least some of these
> > > features are available in all supported distros.
> >
> > Lets say we maximise our back compatibility today, and have to
> > carry some sub-optimal code patterns.
> >
> > 1, 2, 3, 4 years down the lines, we can gradually eliminate
> > those undesired code patterns / workarounds, as older distros
> > naturally age-out of our matrix. After 4 years our entire
> > matrix will have cycled, so we're not needing to carry this
> > debt for very long (4 years is not long in the context of a
> > project like QEMU which has been going several decades)
>
> I agree, for what it's worth.
>
> > Personally I tend towards quicker adoption of Rust, despite
> > the need for short term workarounds, as they'll disappear
> > again reasonably quickly.
>
> Yes, especially since (as Kevin pointed out) most of the workarounds are
> okay in terms of maintainability. If the worst is "if let", and it only
> occurs in a dependency, we're in a good place overall.
s/if let/let else/
"only occurs in a dependency" is probably not the right argument while
we haven't really started writing our own Rust code. If it were
available, we would probably use it in new code. But even without that,
the conclusion is the same, of course: This doesn't prevent implementing
anything and is far from being a show stopper.
I'm in favour of anything that lets up keep the phase of duplication as
short as possible if it doesn't severly limit what we can do. And I
don't see anything in this series that would do that.
> > > Another possibility
> > > could be to accept Rust 1.64.0 but require installing a newer bindgen
> > > (0.66.x for example) on those two distros with an older release.
> >
> > How difficult is it to get newer 'bindgen' installed on these
> > platforms ? The audience here is not so much distros trying to
> > package new QEMU, as that's ony relevant for new distro, but
> > rather it is end usrs/contributors building QEMU for themslves.
>
> Very simple - "cargo install bindgen-cli", as already seen in the
> fedora-rust-nightly container's Dockerfile (note: building QEMU does _not_
> need cargo). In fact we could in fact do it via libvirt-ci, and it's quite
> possible that MacOS or some BSDs will need it.
>
> Personally I'd be okay with allowing Debian 12 but not Ubuntu 22.04, for
> various reasons:
>
> - Ubuntu 22.04 has a new rustc and an old bindgen---so it's really just
> laziness.
>
> - any workarounds for Debian 12 would last shorter, and anyway
>
> - Debian 12 has the really important feature (--allowlist-file), whereas the
> lack of --generate-cstr is only annoying.
>
> > Can it be done automagically in the same way we "do the right thing"
> > with the 3rd party crates we depend on, or is bindgen special in
> > some way that makes it more inconvenient for users ?
>
> bindgen is special in that it has a metric ton of indirect dependencies,
> which we'd all have to write a meson.build for (by hand). :/
If configure errors out with a message "Please run 'cargo install
bindgen-cli'" and that is really enough to make it build, I think that
should be enough to be counted as supporting the distro.
Kevin
next prev parent reply other threads:[~2024-10-18 17:06 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-10-15 13:17 [RFC PATCH 00/16] rust: allow older versions of rustc and bindgen Paolo Bonzini
2024-10-15 13:17 ` [PATCH 01/16] meson: import rust module into a global variable Paolo Bonzini
2024-10-18 15:12 ` Zhao Liu
2024-10-15 13:17 ` [PATCH 02/16] meson: remove repeated search for rust_root_crate.sh Paolo Bonzini
2024-10-16 6:50 ` Junjie Mao
2024-10-18 15:16 ` Zhao Liu
2024-10-15 13:17 ` [PATCH 03/16] rust: pass rustc_args when building all crates Paolo Bonzini
2024-10-21 6:32 ` Zhao Liu
2024-10-21 13:38 ` Paolo Bonzini
2024-10-21 14:49 ` Zhao Liu
2024-10-22 2:22 ` Junjie Mao
2024-10-22 3:59 ` Paolo Bonzini
2024-10-15 13:17 ` [PATCH 04/16] rust: patch bilge-impl to allow compilation with 1.63.0 Paolo Bonzini
2024-10-18 15:55 ` Zhao Liu
2024-10-15 13:17 ` [PATCH 05/16] rust: fix cfgs of proc-macro2 for 1.63.0 Paolo Bonzini
2024-10-21 7:40 ` Zhao Liu
2024-10-15 13:17 ` [PATCH 06/16] rust: do not use OnceLock for properties Paolo Bonzini
2024-10-18 16:02 ` Zhao Liu
2024-10-15 13:17 ` [PATCH 07/16] rust: use std::os::raw instead of core::ffi Paolo Bonzini
2024-10-18 16:07 ` Zhao Liu
2024-10-15 13:17 ` [PATCH 08/16] rust: build tests for the qemu_api crate Paolo Bonzini
2024-10-21 9:07 ` Zhao Liu
2024-10-21 8:51 ` Paolo Bonzini
2024-10-21 14:51 ` Zhao Liu
2024-10-21 14:36 ` Paolo Bonzini
2024-10-21 16:04 ` Zhao Liu
2024-10-15 13:17 ` [PATCH 09/16] rust: introduce a c_str macro Paolo Bonzini
2024-10-15 13:17 ` [PATCH 10/16] rust: introduce alternative implementation of offset_of! Paolo Bonzini
2024-10-17 5:07 ` Junjie Mao
2024-10-17 8:44 ` Paolo Bonzini
2024-10-18 3:01 ` Junjie Mao
2024-10-18 6:51 ` Paolo Bonzini
2024-10-15 13:17 ` [PATCH 11/16] rust: do not use MaybeUninit::zeroed() Paolo Bonzini
2024-10-15 13:17 ` [PATCH 12/16] rust: allow version 1.63.0 of rustc Paolo Bonzini
2024-10-16 6:01 ` Junjie Mao
2024-10-16 7:51 ` Paolo Bonzini
2024-10-16 9:53 ` Junjie Mao
2024-10-18 2:44 ` Junjie Mao
2024-10-18 9:56 ` Paolo Bonzini
2024-10-15 13:17 ` [PATCH 13/16] rust: do not use TYPE_CHARDEV unnecessarily Paolo Bonzini
2024-10-15 13:17 ` [PATCH 14/16] rust: do not use --no-size_t-is-usize Paolo Bonzini
2024-10-15 13:17 ` [PATCH 15/16] rust: do not use --generate-cstr Paolo Bonzini
2024-10-15 13:17 ` [PATCH 16/16] rust: allow older version of bindgen Paolo Bonzini
2024-10-16 6:15 ` Junjie Mao
2024-10-16 7:50 ` Paolo Bonzini
2024-10-18 13:09 ` [RFC PATCH 00/16] rust: allow older versions of rustc and bindgen Kevin Wolf
2024-10-18 13:31 ` Daniel P. Berrangé
2024-10-18 15:43 ` Paolo Bonzini
2024-10-18 17:05 ` Kevin Wolf [this message]
2024-10-21 14:15 ` Peter Maydell
2024-10-21 14:48 ` 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=ZxKVY_5pfP3cAlcP@redhat.com \
--to=kwolf@redhat.com \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@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).