public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
* [PATCH] ref-manual: document Rust classes
@ 2023-01-13 18:09 michael.opdenacker
  2023-01-15 20:03 ` [docs] " Alex Kiernan
  2023-01-16  7:35 ` Ulrich Ölmann
  0 siblings, 2 replies; 14+ messages in thread
From: michael.opdenacker @ 2023-01-13 18:09 UTC (permalink / raw)
  To: docs; +Cc: Michael Opdenacker

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



^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-02-03 17:32 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-01-13 18:09 [PATCH] ref-manual: document Rust classes michael.opdenacker
2023-01-15 20:03 ` [docs] " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox