From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3FCDDC46467 for ; Mon, 16 Jan 2023 07:43:56 +0000 (UTC) Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [85.220.165.71]) by mx.groups.io with SMTP id smtpd.web11.161507.1673855033840062719 for ; Sun, 15 Jan 2023 23:43:54 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: pengutronix.de, ip: 85.220.165.71, mailfrom: u.oelmann@pengutronix.de) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHK9n-0001W8-2o; Mon, 16 Jan 2023 08:43:51 +0100 Received: from uol by pty.hi.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1pHK9l-001cOO-Sf; Mon, 16 Jan 2023 08:43:49 +0100 References: <20230113180932.1507356-1-michael.opdenacker@bootlin.com> User-agent: mu4e 1.6.9; emacs 29.0.50 From: Ulrich =?utf-8?Q?=C3=96lmann?= To: michael.opdenacker@bootlin.com Cc: "Michael Opdenacker via lists.yoctoproject.org" , docs@lists.yoctoproject.org Subject: Re: [docs] [PATCH] ref-manual: document Rust classes Date: Mon, 16 Jan 2023 08:35:02 +0100 In-reply-to: <20230113180932.1507356-1-michael.opdenacker@bootlin.com> Message-ID: <6rsfga2abu.fsf@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: u.oelmann@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: docs@lists.yoctoproject.org List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Mon, 16 Jan 2023 07:43:56 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/3608 Hi Michael, I am no inhabitant of the rust world, so I can not evaluate the technical content - nevertheless: thanks for writing this up! There is only a small typo I came across. On Fri, Jan 13 2023 at 19:09 +0100, "Michael Opdenacker via lists.yoctoproj= ect.org" wrote: > From: Michael Opdenacker > > Signed-off-by: Michael Opdenacker > --- > documentation/ref-manual/classes.rst | 54 ++++++++++++++++++++++++++++ > 1 file changed, 54 insertions(+) > > diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-man= ual/classes.rst > index 0cb507b500..cc6ba04bff 100644 > --- a/documentation/ref-manual/classes.rst > +++ b/documentation/ref-manual/classes.rst > @@ -254,6 +254,42 @@ When inherited globally, prints statistics at the en= d of the build on > sstate re-use. In order to function, this class requires the > :ref:`ref-classes-buildstats` class be enabled. >=20=20 > +.. _ref-classes-cargo: > + > +``cargo`` > +=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +The :ref:`ref-classes-cargo` class allows to compile Rust language progr= ams > +using `Cargo `__. Cargo is Rust's pack= age > +manager, allowing to fetch package dependencies and build your program. > + > +Using this class makes it very easy to build Rust programs. All you need > +is to use the :term:`SRC_URI` variable to point to a source repository > +which can be built by Cargo, typically one that was created by the > +``cargo new`` command, containing a ``Cargo.toml`` file and an ``src`` s/and an ``src``/and a ``src``/ Best regards Ulrich > +subdirectory. > + > +You will find a simple example in the > +:oe_git:`rust-hello-world_git.bb ` > +recipe. A more complex example, with package dependencies, is the > +:oe_git:`uutils-coreutils ` > +recipe, which was generated by the `cargo-bitbake `__ > +tool. > + > +This class inherits the :ref:`ref-classes-cargo_common` class. > + > +.. _ref-classes-cargo_common: > + > +``cargo_common`` > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +The :ref:`ref-classes-cargo_common` class is an internal class > +that is not intended to be used directly. > + > +An exception is the "rust" recipe, to build the Rust compiler and runtime > +library, which is built by Cargo but cannot use the :ref:`ref-classes-ca= rgo` > +class. This is why this class was introduced. > + > .. _ref-classes-ccache: >=20=20 > ``ccache`` > @@ -2493,6 +2529,24 @@ For information on how root filesystem images are = created, see the > ":ref:`overview-manual/concepts:image generation`" > section in the Yocto Project Overview and Concepts Manual. >=20=20 > +.. _ref-classes-rust: > + > +``rust`` > +=3D=3D=3D=3D=3D=3D=3D=3D > + > +The :ref:`ref-classes-rust` class is an internal class which is just used > +in the "rust" recipe, to build the Rust compiler and runtime > +library. Except for this recipe, it is not intended to be used directly. > + > +.. _ref-classes-rust-common: > + > +``rust-common`` > +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > + > +The :ref:`ref-classes-rust-common` class is an internal class to the > +:ref:`ref-classes-cargo_common` and :ref:`ref-classes-rust` classes and = is not > +intended to be used directly. > + > .. _ref-classes-sanity: >=20=20 > ``sanity`` --=20 Pengutronix e.K. | Ulrich =C3=96lmann = | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |