summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools
diff options
context:
space:
mode:
authorRandy MacLeod <randy.macleod@windriver.com>2021-02-24 20:48:18 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-08-26 22:09:43 +0100
commite9263ee7640e2a418ea67a4555f05a445c10d44f (patch)
tree03544d1518bfd6b313e332d081be7dc196fa0ffd /meta/recipes-devtools
parent61e1570c6a09c1984e919e8c0a82a74c1a08d821 (diff)
downloadpoky-e9263ee7640e2a418ea67a4555f05a445c10d44f.tar.gz
rust: mv README.md to recipes-devtools/rust/README-rust.md
Import the meta-rust/README.md but relocate and rename it. (From OE-Core rev: a36b43187f9b78c279bdbd0ee9c6f7063a0e7cc7) Signed-off-by: Randy MacLeod <Randy.MacLeod@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r--meta/recipes-devtools/rust/README-rust.md69
1 files changed, 69 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/README-rust.md b/meta/recipes-devtools/rust/README-rust.md
new file mode 100644
index 0000000000..329d59ab7b
--- /dev/null
+++ b/meta/recipes-devtools/rust/README-rust.md
@@ -0,0 +1,69 @@
1## Introduction
2
3This OpenEmbedded layer provides the rust compiler, tools for building packages
4(cargo), and a few example projects.
5
6## What works:
7
8 - Building `rust-native` and `cargo-native`
9 - Building Rust based projects with Cargo for the TARGET
10 - e.g. `rustfmt` which is used by the CI system
11 - `-buildsdk` and `-crosssdk` packages
12
13## What doesn't:
14
15 - Using anything but x86_64 as the build environment
16 - rust (built for target) issue #81
17
18## What's untested:
19
20 - cargo (built for target)
21
22## Building a rust package
23
24When building a rust package in bitbake, it's usually easiest to build with
25cargo using cargo.bbclass. If the package already has a Cargo.toml file (most
26rust packages do), then it's especially easy. Otherwise you should probably
27get the code building in cargo first.
28
29Once your package builds in cargo, you can use
30[cargo-bitbake](https://github.com/cardoe/cargo-bitbake) to generate a bitbake
31recipe for it. This allows bitbake to fetch all the necessary dependent
32crates, as well as a pegged version of the crates.io index, to ensure maximum
33reproducibility.
34
35NOTE: You will have to edit the generated recipe based on the comments
36contained within it
37
38## TODO
39
40## Pitfalls
41
42 - TARGET_SYS _must_ be different from BUILD_SYS. This is due to the way Rust configuration options are tracked for different targets. This is the reason we use the Yocto triples instead of the native Rust triples. See rust-lang/cargo#3349.
43
44## Dependencies
45
46On the host:
47 - Any `-sys` packages your project might need must have RDEPENDs for
48 the native library.
49
50On the target:
51 - Any `-sys` packages your project might need must have RDEPENDs for
52 the native library.
53
54## Maintainer(s) & Patch policy
55
56Open a Pull Request.
57
58The master branch supports the latest master of poky. When poky creates releases, we will create a branch with the same name as the poky release. This release branch should always work with that poky release. Note that these release branches will typically be less tested than the master branch.
59
60All new patches against rust, rust-llvm, and cargo must have referenced
61upstream issues or PRs opened or an explanation why the patch cannot be
62upstreamed. This cooresponds to the OpenEmbedded policy for other meta layers.
63
64More info can be seen on the wiki.
65
66## Copyright
67
68MIT OR Apache-2.0 - Same as rust
69