public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
From: michael.opdenacker@bootlin.com
To: docs@lists.yoctoproject.org
Cc: Michael Opdenacker <michael.opdenacker@bootlin.com>
Subject: [PATCH] ref-manual: document Rust classes
Date: Fri, 13 Jan 2023 19:09:32 +0100	[thread overview]
Message-ID: <20230113180932.1507356-1-michael.opdenacker@bootlin.com> (raw)

From: Michael Opdenacker <michael.opdenacker@bootlin.com>

Signed-off-by: Michael Opdenacker <michael.opdenacker@bootlin.com>
---
 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 <https://doc.rust-lang.org/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 </openembedded-core/tree/meta/recipes-extended/rust-example/rust-hello-world_git.bb>`
+recipe. A more complex example, with package dependencies, is the
+:oe_git:`uutils-coreutils </meta-openembedded/tree/meta-oe/recipes-core/uutils-coreutils>`
+recipe, which was generated by the `cargo-bitbake <https://crates.io/crates/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``
-- 
2.37.2



             reply	other threads:[~2023-01-13 18:09 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-13 18:09 michael.opdenacker [this message]
2023-01-15 20:03 ` [docs] [PATCH] ref-manual: document Rust classes Alex Kiernan
2023-01-15 20:09   ` Alexander Kanavin
2023-01-16 17:18   ` Michael Opdenacker
2023-01-16 19:30     ` Alex Kiernan
2023-02-02 18:06   ` Michael Opdenacker
2023-02-03  9:42     ` Michael Opdenacker
2023-02-03 12:06       ` Alex Kiernan
2023-02-03 17:32         ` Michael Opdenacker
2023-01-16  7:35 ` Ulrich Ölmann
2023-01-16 16:05   ` Michael Opdenacker
2023-01-16 16:15     ` Richard Purdie
     [not found]     ` <173AD6377FCD14EA.23170@lists.yoctoproject.org>
2023-01-16 16:34       ` Richard Purdie
2023-01-16 17:08         ` Michael Opdenacker

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=20230113180932.1507356-1-michael.opdenacker@bootlin.com \
    --to=michael.opdenacker@bootlin.com \
    --cc=docs@lists.yoctoproject.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