From patchwork Fri Jan 13 18:09:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Opdenacker X-Patchwork-Id: 18113 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 336F5C54EBD for ; Fri, 13 Jan 2023 18:09:47 +0000 (UTC) Received: from relay3-d.mail.gandi.net (relay3-d.mail.gandi.net [217.70.183.195]) by mx.groups.io with SMTP id smtpd.web11.95759.1673633381231771893 for ; Fri, 13 Jan 2023 10:09:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=bRTINQ5F; spf=pass (domain: bootlin.com, ip: 217.70.183.195, mailfrom: michael.opdenacker@bootlin.com) Received: (Authenticated sender: michael.opdenacker@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id C103F60008; Fri, 13 Jan 2023 18:09:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1673633379; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=t6IueuQ0M0dZE5QCMtye+boMbDeXTvLgUvmerH9sjl0=; b=bRTINQ5FGsfRpH2uGi6wbr4XuIiAZhyxbtVcuJgWvGVNr+CWLXzly+7hC5oz1RiIoIp4+2 PE6ys4nmWoXZuDBBYgoPTZsw/74waLEe1ciqwo2qBBUXLrh+T3Tr0sdra4IALJ+VJy2cx5 LZjHc87eTuFvugsqH4lQqxmxkmrQYVso1bi/r8YJpOTyjjWYpx4o9HwGdOgIEIybtPSCD+ 5ksIx4j7GEdWosmaVTS6g9H7lroOuts5NanXiL8eV6FaDwSCxZ3B8kNJ8eFJVhV64VF2iS i1FinOP+VvoQ2bqJMRJalzMHhpdHpVWZcekXwu3JZN2FohEbBIUC79oaY35xPQ== From: michael.opdenacker@bootlin.com To: docs@lists.yoctoproject.org Cc: Michael Opdenacker Subject: [PATCH] ref-manual: document Rust classes Date: Fri, 13 Jan 2023 19:09:32 +0100 Message-Id: <20230113180932.1507356-1-michael.opdenacker@bootlin.com> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 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 ; Fri, 13 Jan 2023 18:09:47 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/3604 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-manual/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 end of the build on sstate re-use. In order to function, this class requires the :ref:`ref-classes-buildstats` class be enabled. +.. _ref-classes-cargo: + +``cargo`` +========= + +The :ref:`ref-classes-cargo` class allows to compile Rust language programs +using `Cargo `__. Cargo is Rust's package +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`` +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`` +================ + +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-cargo` +class. This is why this class was introduced. + .. _ref-classes-ccache: ``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. +.. _ref-classes-rust: + +``rust`` +======== + +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`` +=============== + +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: ``sanity``