From: "Daniel P. Berrangé" <berrange@redhat.com>
To: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
Cc: qemu-devel@nongnu.org, "Stefan Hajnoczi" <stefanha@redhat.com>,
"Mads Ynddal" <mads@ynddal.dk>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Alex Bennée" <alex.bennee@linaro.org>,
"Marc-André Lureau" <marcandre.lureau@redhat.com>,
"Thomas Huth" <thuth@redhat.com>,
"Markus Armbruster" <armbru@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Zhao Liu" <zhao1.liu@intel.com>,
"Gustavo Romero" <gustavo.romero@linaro.org>,
"Pierrick Bouvier" <pierrick.bouvier@linaro.org>,
rowan.hart@intel.com,
"Richard Henderson" <richard.henderson@linaro.org>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"John Snow" <jsnow@redhat.com>, "Cleber Rosa" <crosa@redhat.com>
Subject: Re: [RFC PATCH v3 1/5] build-sys: Add rust feature option
Date: Mon, 24 Jun 2024 17:52:07 +0100 [thread overview]
Message-ID: <ZnmkN2PL3r-2sxqe@redhat.com> (raw)
In-Reply-To: <e74803e6b570ab36ebc538dd84dc7c4bc2fbe4e7.1718827153.git.manos.pitsidianakis@linaro.org>
On Wed, Jun 19, 2024 at 11:13:58PM +0300, Manos Pitsidianakis wrote:
> Add options for Rust in meson_options.txt, meson.build, configure to
> prepare for adding Rust code in the followup commits.
>
> `rust` is a reserved meson name, so we have to use an alternative.
> `with_rust` was chosen.
>
> A cargo_wrapper.py script is added that is heavily based on the work of
> Marc-André Lureau from 2021.
>
> https://patchew.org/QEMU/20210907121943.3498701-1-marcandre.lureau@redhat.com/
>
> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
> Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> MAINTAINERS | 5 +
> configure | 11 ++
> meson.build | 11 ++
> meson_options.txt | 4 +
> scripts/cargo_wrapper.py | 279 ++++++++++++++++++++++++++++++++++
> scripts/meson-buildoptions.sh | 6 +
> 6 files changed, 316 insertions(+)
> create mode 100644 scripts/cargo_wrapper.py
> diff --git a/configure b/configure
> index 38ee257701..6894d7c2d1 100755
> --- a/configure
> +++ b/configure
> @@ -302,6 +302,9 @@ else
> objcc="${objcc-${cross_prefix}clang}"
> fi
>
> +with_rust="auto"
On last week's call one of the things we discussed is the expectations
for consumers of QEMU around the usage of Rust & its optionality (or
not) long term.
If we consider Rust to be an optional feature, then this largely
precludes re-writing existing C code in Rust, as we would be
forced to either remove existing features from users, or maintain
parallel impls in both C & Rust. Neither of these are desirable
situations.
I'm of the view that to be valuable for QEMU, we need to consider
Rust to become a mandatory feature. There's a question of how quickly
we move, however, before declaring it mandatory. The longer we take
to declare it mandatory, the longer we are limiting the value we
can take from Rust.
If we want to make Rust mandatory, then we should set the user
expectations to reflect this from the start.
IOW, with_rust="enabled" should be the default, and require an
explicit --disable-rust to opt-out on a very time limited
basis. Any use of --disable-rust ought to print a warning at
the end of configure, and solicit feedback:
WARNING: Building without Rust is deprecated. QEMU intends
WARNING: to make Rust a mandatory build dependency in the
WARNING: 10.0.0 release.
WARNING:
WARNING: If you have concerns about this requirement
WARNING: please contact qemu-devel@nongnu.org
I illustrated '10.0.0' on the assumption that we add Rust
support in 9.1.0, and thus have 2 releases where it is
optional to align with our deprecation policy. Even though
we don't usually apply our deprecation policy to build
dependencies, this is a significant unique situation so
IMHO worth doing.
> +with_rust_target_triple=""
> +
> ar="${AR-${cross_prefix}ar}"
> as="${AS-${cross_prefix}as}"
> ccas="${CCAS-$cc}"
> @@ -760,6 +763,12 @@ for opt do
> ;;
> --gdb=*) gdb_bin="$optarg"
> ;;
> + --enable-with-rust) with_rust=enabled
> + ;;
> + --disable-with-rust) with_rust=disabled
> + ;;
--enable-with-XXX / --disable-with-XXX is pretty unsual naming.
Normally you'd see either --enable-XXX or --with-XXX and their
corresponding --disable-XXX or --without-XXX.
> + --with-rust-target-triple=*) with_rust_target_triple="$optarg"
As with previous posting, IMHO, this should ideally not exist. We should
honour the --cross-prefix= values, re-mapping to to Rust targets for all
the combos we know about. --with-rust-target-triple should only be needed
as a workaround for where we might have missed a mapping.
With regards,
Daniel
--
|: https://berrange.com -o- https://www.flickr.com/photos/dberrange :|
|: https://libvirt.org -o- https://fstop138.berrange.com :|
|: https://entangle-photo.org -o- https://www.instagram.com/dberrange :|
next prev parent reply other threads:[~2024-06-24 16:53 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-19 20:13 [RFC PATCH v3 0/5] Implement ARM PL011 in Rust Manos Pitsidianakis
2024-06-19 20:13 ` [RFC PATCH v3 1/5] build-sys: Add rust feature option Manos Pitsidianakis
2024-06-20 13:21 ` Paolo Bonzini
2024-06-20 18:06 ` Manos Pitsidianakis
2024-06-20 19:44 ` Paolo Bonzini
2024-06-24 8:51 ` Zhao Liu
2024-06-24 16:35 ` Paolo Bonzini
2024-06-20 13:41 ` Alex Bennée
2024-06-20 18:14 ` Manos Pitsidianakis
2024-06-24 16:52 ` Daniel P. Berrangé [this message]
2024-06-24 17:14 ` Paolo Bonzini
2024-06-25 21:47 ` Manos Pitsidianakis
2024-06-26 9:34 ` Paolo Bonzini
2024-07-02 14:38 ` Manos Pitsidianakis
2024-07-02 15:23 ` Paolo Bonzini
2024-06-19 20:13 ` [RFC PATCH v3 2/5] rust: add bindgen step as a meson dependency Manos Pitsidianakis
2024-06-20 11:10 ` Alex Bennée
2024-06-20 12:34 ` Paolo Bonzini
2024-06-20 18:18 ` Manos Pitsidianakis
2024-06-20 12:32 ` Alex Bennée
2024-06-20 18:22 ` Manos Pitsidianakis
2024-06-24 19:52 ` Stefan Hajnoczi
2024-06-20 14:01 ` Richard Henderson
2024-06-20 18:36 ` Manos Pitsidianakis
2024-06-20 19:30 ` Richard Henderson
2024-06-24 10:12 ` Zhao Liu
2024-06-24 10:02 ` Manos Pitsidianakis
2024-06-25 16:00 ` Zhao Liu
2024-06-25 18:08 ` Manos Pitsidianakis
2024-06-27 23:47 ` Pierrick Bouvier
2024-06-28 19:12 ` Pierrick Bouvier
2024-06-28 21:50 ` Paolo Bonzini
2024-07-01 18:53 ` Pierrick Bouvier
2024-06-29 8:06 ` Manos Pitsidianakis
2024-07-01 18:54 ` Pierrick Bouvier
2024-07-02 12:25 ` Manos Pitsidianakis
2024-07-02 16:07 ` Pierrick Bouvier
2024-06-19 20:14 ` [RFC PATCH v3 3/5] rust: add PL011 device model Manos Pitsidianakis
2024-06-19 20:14 ` [RFC PATCH v3 4/5] DO NOT MERGE: add rustdoc build for gitlab pages Manos Pitsidianakis
2024-06-19 20:14 ` [RFC PATCH v3 5/5] DO NOT MERGE: replace TYPE_PL011 with x-pl011-rust in arm virt machine Manos Pitsidianakis
2024-06-25 16:18 ` Zhao Liu
2024-06-25 18:23 ` Manos Pitsidianakis
2024-06-25 19:15 ` Daniel P. Berrangé
2024-06-25 20:43 ` Peter Maydell
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=ZnmkN2PL3r-2sxqe@redhat.com \
--to=berrange@redhat.com \
--cc=alex.bennee@linaro.org \
--cc=armbru@redhat.com \
--cc=crosa@redhat.com \
--cc=gustavo.romero@linaro.org \
--cc=jsnow@redhat.com \
--cc=mads@ynddal.dk \
--cc=manos.pitsidianakis@linaro.org \
--cc=marcandre.lureau@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=philmd@linaro.org \
--cc=pierrick.bouvier@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=rowan.hart@intel.com \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
--cc=zhao1.liu@intel.com \
/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).