Skip to contentSkip to conversation

Merge meta-rust to oe-core

PATCH In review Randy MacLeod 3 participants 13 messages Feb 25, 2021 – Mar 4, 2021 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v2 1/1 Merge meta-rust to oe-core

Added or updated these commits:

86109491bc maintainers: Add myself as maintainer for rust pkgs
...
b411e322b3 rust: remove container build scripts used by meta-rust c646d47ebc rust: update the README to conform to being in oe-core e19d823567 meta-rust: merge commits

The last commit update was just squashing a new commit from meta-rust:
f8b9103 Remove checks for Rust versions we don't build anymore.

To Do List
==========

1) cargo-bitbake - the README suggest adding this using desktop cargo but once we get the SDK merged, it should be added there. Someone suggested using devtool for this rather than cargo-bitbake.

2) Fix the SDK libcrypto, libstdc++ glibc-2.33 problem. I'm running a git bisect using poky, meta-oe/master, meta-rust+SDK patches.

3) Add a test case to either:
- just build rust-hello-world or
- run it in qemu

N) Fix *some* of the remaining bugs in:
https://github.com/meta-rust/meta-rust/issues

FYI:

$ git log --oneline -8
fceca1dfbe (HEAD -> rust-squash) maintainers: Add myself as maintainer for rust pkgs
791684e0c1 cargo/rust/rustfmt: exclude from world
b411e322b3 rust: remove container build scripts used by meta-rust
c646d47ebc rust: update the README to conform to being in oe-core
e19d823567 meta-rust: merge commits
ab137fb83c rust: mv README.md to recipes-devtools/rust/README-rust.md
dac403bcc1 meta-rust: move code to oe-core from meta-rust layer
5a1a5baa0a libgit2: pull in updates from meta-oe  <----- now in master next so omitted.
$ git diff 5a1a5baa0a HEAD | diffstat
 classes/cargo.bbclass                                                                      |   77 ++
 classes/cargo_common.bbclass                                                               |  121 +++
 classes/crate-fetch.bbclass                                                                |   13 
 classes/rust-bin.bbclass                                                                   |  149 ++++
 classes/rust-common.bbclass                                                                |  167 ++++
 classes/rust.bbclass                                                                       |   45 +
 conf/distro/include/maintainers.inc                                                        |    7 
 conf/distro/include/rust_security_flags.inc                                                |    7 
 conf/distro/include/rust_versions.inc                                                      |   13 
 conf/layer.conf                                                                            |    2 
 lib/crate.py                                                                               |  149 ++++
 recipes-devtools/cargo/cargo-1.47.0/0001-Disable-http2.patch                               |   31 
 recipes-devtools/cargo/cargo-1.49.0/0001-Disable-http2.patch                               |   31 
 recipes-devtools/cargo/cargo.inc                                                           |   52 +
 recipes-devtools/cargo/cargo_1.47.0.bb                                                     |    3 
 recipes-devtools/cargo/cargo_1.49.0.bb                                                     |    3 
 recipes-devtools/rust/README-rust.md                                                       |   58 +
 recipes-devtools/rust/libstd-rs.inc                                                        |   40 +
 recipes-devtools/rust/libstd-rs_1.47.0.bb                                                  |    5 
 recipes-devtools/rust/libstd-rs_1.49.0.bb                                                  |    5 
 recipes-devtools/rust/rust-cross.inc                                                       |   71 +
 recipes-devtools/rust/rust-cross_1.47.0.bb                                                 |    2 
 recipes-devtools/rust/rust-cross_1.49.0.bb                                                 |    2 
 recipes-devtools/rust/rust-llvm.inc                                                        |   64 +
 recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch             |   32 
 recipes-devtools/rust/rust-llvm_1.47.0.bb                                                  |    2 
 recipes-devtools/rust/rust-llvm_1.49.0.bb                                                  |    2 
 recipes-devtools/rust/rust-snapshot-1.47.0.inc                                             |   13 
 recipes-devtools/rust/rust-snapshot-1.49.0.inc                                             |   13 
 recipes-devtools/rust/rust-snapshot.inc                                                    |    9 
 recipes-devtools/rust/rust-source-1.47.0.inc                                               |    3 
 recipes-devtools/rust/rust-source-1.49.0.inc                                               |    3 
 recipes-devtools/rust/rust-source.inc                                                      |    3 
 recipes-devtools/rust/rust-target.inc                                                      |   10 
 recipes-devtools/rust/rust.inc                                                             |  512 ++++++++++++++
 recipes-devtools/rust/rust/0001-rustc_target-Fix-dash-vs-underscore-mismatches-in-op.patch |   75 ++
 recipes-devtools/rust/rust_1.47.0.bb                                                       |    9 
 recipes-devtools/rust/rust_1.49.0.bb                                                       |   15 
 recipes-example/rust-hello-world/rust-hello-world/0001-enable-LTO.patch                    |   23 
 recipes-example/rust-hello-world/rust-hello-world_git.bb                                   |   17 
 recipes-example/rustfmt/rustfmt_1.4.2.bb                                                   |  171 ++++
 41 files changed, 2029 insertions(+)
#2 lore raw

PATCH 1/7 meta-rust: move code to oe-core from meta-rust layer

Rust is becoming more widely used so move the
meta-rust layer. Taken from meta-rust at commit:
11aed43 cargo-1.37.0: fix patch fuzz

---
 meta/classes/cargo.bbclass                    |  70 +++
 meta/classes/cargo_common.bbclass             |  98 ++++
 meta/classes/crate-fetch.bbclass              |  13 +
 meta/classes/rust-bin.bbclass                 | 149 +++++
 meta/classes/rust-common.bbclass              | 144 +++++
 meta/classes/rust.bbclass                     |  45 ++
 .../distro/include/rust_security_flags.inc    |   7 +
 meta/conf/layer.conf                          |   2 +
 meta/lib/crate.py                             | 149 +++++
 .../cargo-1.34.2/0001-Disable-http2.patch     |  29 +
 .../cargo-1.36.0/0001-Disable-http2.patch     |  31 ++
 .../cargo-1.37.0/0001-Disable-http2.patch     |  29 +
 meta/recipes-devtools/cargo/cargo.inc         |  43 ++
 meta/recipes-devtools/cargo/cargo_1.34.2.bb   |   8 +
 meta/recipes-devtools/cargo/cargo_1.36.0.bb   |   8 +
 meta/recipes-devtools/cargo/cargo_1.37.0.bb   |   8 +
 meta/recipes-devtools/rust/libstd-rs.inc      |  31 ++
 .../recipes-devtools/rust/libstd-rs_1.34.2.bb |   8 +
 .../recipes-devtools/rust/libstd-rs_1.36.0.bb |   8 +
 .../recipes-devtools/rust/libstd-rs_1.37.0.bb |   8 +
 meta/recipes-devtools/rust/rust-cross.inc     |  52 ++
 .../rust/rust-cross_1.34.2.bb                 |   3 +
 .../rust/rust-cross_1.36.0.bb                 |   3 +
 .../rust/rust-cross_1.37.0.bb                 |   3 +
 meta/recipes-devtools/rust/rust-llvm.inc      |  62 +++
 ...-llvm-allow-env-override-of-exe-path.patch |  32 ++
 .../recipes-devtools/rust/rust-llvm_1.34.2.bb |  16 +
 .../recipes-devtools/rust/rust-llvm_1.36.0.bb |  16 +
 .../recipes-devtools/rust/rust-llvm_1.37.0.bb |  16 +
 .../rust/rust-snapshot-1.34.2.inc             |  24 +
 .../rust/rust-snapshot-1.36.0.inc             |  24 +
 .../rust/rust-snapshot-1.37.0.inc             |  24 +
 .../rust/rust-source-1.34.2.inc               |  11 +
 .../rust/rust-source-1.36.0.inc               |  11 +
 .../rust/rust-source-1.37.0.inc               |  11 +
 meta/recipes-devtools/rust/rust.inc           | 509 ++++++++++++++++++
 meta/recipes-devtools/rust/rust_1.34.2.bb     |  12 +
 meta/recipes-devtools/rust/rust_1.36.0.bb     |  12 +
 meta/recipes-devtools/rust/rust_1.37.0.bb     |  12 +
 .../rust-hello-world/rust-hello-world_git.bb  |  13 +
 meta/recipes-example/rustfmt/rustfmt_0.8.0.bb |  67 +++
 scripts/build.sh                              |  19 +
 scripts/cleanup-env.sh                        |  14 +
 scripts/containerize.sh                       |  54 ++
 scripts/fetch.sh                              | 103 ++++
 scripts/publish-build-cache.sh                |  13 +
 scripts/setup-env.sh                          |  12 +
 47 files changed, 2036 insertions(+)
 create mode 100644 meta/classes/cargo.bbclass
 create mode 100644 meta/classes/cargo_common.bbclass
 create mode 100644 meta/classes/crate-fetch.bbclass
 create mode 100644 meta/classes/rust-bin.bbclass
 create mode 100644 meta/classes/rust-common.bbclass
 create mode 100644 meta/classes/rust.bbclass
 create mode 100644 meta/conf/distro/include/rust_security_flags.inc
 create mode 100644 meta/lib/crate.py
 create mode 100644 meta/recipes-devtools/cargo/cargo-1.34.2/0001-Disable-http2.patch
 create mode 100644 meta/recipes-devtools/cargo/cargo-1.36.0/0001-Disable-http2.patch
 create mode 100644 meta/recipes-devtools/cargo/cargo-1.37.0/0001-Disable-http2.patch
 create mode 100644 meta/recipes-devtools/cargo/cargo.inc
 create mode 100644 meta/recipes-devtools/cargo/cargo_1.34.2.bb
 create mode 100644 meta/recipes-devtools/cargo/cargo_1.36.0.bb
 create mode 100644 meta/recipes-devtools/cargo/cargo_1.37.0.bb
 create mode 100644 meta/recipes-devtools/rust/libstd-rs.inc
 create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.34.2.bb
 create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.36.0.bb
 create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.37.0.bb
 create mode 100644 meta/recipes-devtools/rust/rust-cross.inc
 create mode 100644 meta/recipes-devtools/rust/rust-cross_1.34.2.bb
 create mode 100644 meta/recipes-devtools/rust/rust-cross_1.36.0.bb
 create mode 100644 meta/recipes-devtools/rust/rust-cross_1.37.0.bb
 create mode 100644 meta/recipes-devtools/rust/rust-llvm.inc
 create mode 100644 meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch
 create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.34.2.bb
 create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.36.0.bb
 create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.37.0.bb
 create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.34.2.inc
 create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.36.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.37.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-source-1.34.2.inc
 create mode 100644 meta/recipes-devtools/rust/rust-source-1.36.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-source-1.37.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust.inc
 create mode 100644 meta/recipes-devtools/rust/rust_1.34.2.bb
 create mode 100644 meta/recipes-devtools/rust/rust_1.36.0.bb
 create mode 100644 meta/recipes-devtools/rust/rust_1.37.0.bb
 create mode 100644 meta/recipes-example/rust-hello-world/rust-hello-world_git.bb
 create mode 100644 meta/recipes-example/rustfmt/rustfmt_0.8.0.bb
 create mode 100755 scripts/build.sh
 create mode 100755 scripts/cleanup-env.sh
 create mode 100755 scripts/containerize.sh
 create mode 100755 scripts/fetch.sh
 create mode 100755 scripts/publish-build-cache.sh
 create mode 100755 scripts/setup-env.sh
meta/classes/cargo.bbclass new file +70 -0
new file mode 100644
index 0000000000..c321e6bf70
@@ -0,0 +1,70 @@
+##
+## Purpose:
+## This class is used by any recipes that are built using
+## Cargo.
+
+inherit cargo_common
+
+# the binary we will use
+CARGO = "cargo"
+
+# We need cargo to compile for the target
+BASEDEPENDS_append = " cargo-native"
+
+# Ensure we get the right rust variant
+DEPENDS_append_class-target = " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}"
+DEPENDS_append_class-native = " rust-native"
+
+# Cargo only supports in-tree builds at the moment
+B = "${S}"
+
+# In case something fails in the build process, give a bit more feedback on
+# where the issue occured
+export RUST_BACKTRACE = "1"
+
+RUSTFLAGS ??= ""
+BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
+CARGO_BUILD_FLAGS = "-v --target ${HOST_SYS} ${BUILD_MODE}"
+
+# This is based on the content of CARGO_BUILD_FLAGS and generally will need to
+# change if CARGO_BUILD_FLAGS changes.
+BUILD_DIR = "${@['release', 'debug'][d.getVar('DEBUG_BUILD') == '1']}"
+CARGO_TARGET_SUBDIR="${HOST_SYS}/${BUILD_DIR}"
+oe_cargo_build () {
+	export RUSTFLAGS="${RUSTFLAGS}"
+	export RUST_TARGET_PATH="${RUST_TARGET_PATH}"
+	bbnote "cargo = $(which ${CARGO})"
+	bbnote "rustc = $(which ${RUSTC})"
+	bbnote "${CARGO} build ${CARGO_BUILD_FLAGS} $@"
+	"${CARGO}" build ${CARGO_BUILD_FLAGS} "$@"
+}
+
+cargo_do_compile () {
+	oe_cargo_fix_env
+	oe_cargo_build
+}
+
+cargo_do_install () {
+	local have_installed=false
+	for tgt in "${B}/target/${CARGO_TARGET_SUBDIR}/"*; do
+		case $tgt in
+		*.so|*.rlib)
+			install -d "${D}${rustlibdir}"
+			install -m755 "$tgt" "${D}${rustlibdir}"
+			have_installed=true
+			;;
+		*)
+			if [ -f "$tgt" ] && [ -x "$tgt" ]; then
+				install -d "${D}${bindir}"
+				install -m755 "$tgt" "${D}${bindir}"
+				have_installed=true
+			fi
+			;;
+		esac
+	done
+	if ! $have_installed; then
+		die "Did not find anything to install"
+	fi
+}
+
+EXPORT_FUNCTIONS do_compile do_install
meta/classes/cargo_common.bbclass new file +98 -0

98 lines not on this page · raw message

meta/classes/crate-fetch.bbclass new file +13 -0
new file mode 100644
index 0000000000..c0ed434a96
@@ -0,0 +1,13 @@
+#
+# crate-fetch class
+#
+# Registers 'crate' method for Bitbake fetch2.
+#
+# Adds support for following format in recipe SRC_URI:
+# crate://<packagename>/<version>
+#
+
+python () {
+        import crate
+        bb.fetch2.methods.append( crate.Crate() )
+}
meta/classes/rust-bin.bbclass new file +149 -0

149 lines not on this page · raw message

meta/classes/rust-common.bbclass new file +144 -0

144 lines not on this page · raw message

meta/classes/rust.bbclass new file +45 -0

45 lines not on this page · raw message

meta/conf/distro/include/rust_security_flags.inc new file +7 -0
new file mode 100644
index 0000000000..7e6377e8c7
@@ -0,0 +1,7 @@
+# Build errors with PIE options enabled
+SECURITY_CFLAGS_pn-rust-native = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-rust-cross-${TARGET_ARCH} = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-rust = "${SECURITY_NO_PIE_CFLAGS}"
+SECURITY_CFLAGS_pn-rust-llvm = "${SECURITY_NO_PIE_CFLAGS}"
+
+SECURITY_LDFLAGS_pn-rust-cross-arm = " -lssp_nonshared -lssp"
meta/conf/layer.conf +2 -0
index cda37c33b4..d834be1d02 100644
@@ -105,3 +105,5 @@ SSTATE_EXCLUDEDEPS_SYSROOT += ".*->autoconf-archive-native"
 # Avoid empty path entries
 BITBAKEPATH := "${@os.path.dirname(bb.utils.which(d.getVar('PATH'),'bitbake'))}"
 PATH := "${@'${BITBAKEPATH}:' if '${BITBAKEPATH}' != '' else ''}${HOSTTOOLS_DIR}"
+
+require conf/distro/include/rust_security_flags.inc
meta/lib/crate.py new file +149 -0

149 lines not on this page · raw message

meta/recipes-devtools/cargo/cargo-1.34.2/0001-Disable-http2.patch new file +29 -0
new file mode 100644
index 0000000000..a44482a112
@@ -0,0 +1,29 @@
+From 44cf21036646e4849e9f8566db7decb7da917394 Mon Sep 17 00:00:00 2001
+From: Johan Anderholm <[email protected]>
+Date: Sun, 27 Jan 2019 10:19:00 +0100
+Subject: [PATCH] Disable http2
+
+http2 requires that curl is build with nghttp2 which in turn depends on
+many dependencies and ultimately a dependency loop in the case of
+curl-native. As long as multiplexing is disabled in cargo this should
+be fine.
+
+Upstream-Status: Inappropriate
+
+---
+ Cargo.toml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index 8238380861d9..ced1defea459 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -24,7 +24,7 @@ bytesize = "1.0"
+ crates-io = { path = "src/crates-io", version = "0.23" }
+ crossbeam-utils = "0.6"
+ crypto-hash = "0.3.1"
+-curl = { version = "0.4.19", features = ['http2'] }
++curl = { version = "0.4.19" }
+ curl-sys = "0.4.15"
+ env_logger = "0.6.0"
+ pretty_env_logger = { version = "0.3", optional = true }
meta/recipes-devtools/cargo/cargo-1.36.0/0001-Disable-http2.patch new file +31 -0
new file mode 100644
index 0000000000..9794ec05f9
@@ -0,0 +1,31 @@
+From 42e65192b6f7520b7a05924856e00600961f6758 Mon Sep 17 00:00:00 2001
+From: Johan Anderholm <[email protected]>
+Date: Sun, 27 Jan 2019 10:19:00 +0100
+Subject: [PATCH] Disable http2
+
+http2 requires that curl is build with nghttp2 which in turn depends on
+many dependencies and ultimately a dependency loop in the case of
+curl-native. As long as multiplexing is disabled in cargo this should
+be fine.
+
+Upstream-Status: Inappropriate
+---
+ Cargo.toml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index c3fcacf5..bd6ec50b 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -24,7 +24,7 @@ bytesize = "1.0"
+ crates-io = { path = "src/crates-io", version = "0.25" }
+ crossbeam-utils = "0.6"
+ crypto-hash = "0.3.1"
+-curl = { version = "0.4.21", features = ['http2'] }
++curl = { version = "0.4.21" }
+ curl-sys = "0.4.18"
+ env_logger = "0.6.0"
+ pretty_env_logger = { version = "0.3", optional = true }
+-- 
+2.11.0
+
meta/recipes-devtools/cargo/cargo-1.37.0/0001-Disable-http2.patch new file +29 -0
new file mode 100644
index 0000000000..c804297d48
@@ -0,0 +1,29 @@
+From 0e2384133664ebeb548b782ad763c3a627c1bc66 Mon Sep 17 00:00:00 2001
+From: Johan Anderholm <[email protected]>
+Date: Sun, 27 Jan 2019 10:19:00 +0100
+Subject: [PATCH] Disable http2
+
+http2 requires that curl is build with nghttp2 which in turn depends on
+many dependencies and ultimately a dependency loop in the case of
+curl-native. As long as multiplexing is disabled in cargo this should
+be fine.
+
+Upstream-Status: Inappropriate
+
+---
+ src/tools/cargo/Cargo.toml | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index d15aa2513..ba9c77d25 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -24,7 +24,7 @@ bytesize = "1.0"
+ crates-io = { path = "crates/crates-io", version = "0.26" }
+ crossbeam-utils = "0.6"
+ crypto-hash = "0.3.1"
+-curl = { version = "0.4.21", features = ['http2'] }
++curl = { version = "0.4.21" }
+ curl-sys = "0.4.18"
+ env_logger = "0.6.0"
+ pretty_env_logger = { version = "0.3", optional = true }
meta/recipes-devtools/cargo/cargo.inc new file +43 -0

43 lines not on this page · raw message

meta/recipes-devtools/cargo/cargo_1.34.2.bb new file +8 -0
new file mode 100644
index 0000000000..d79f958c6e
@@ -0,0 +1,8 @@
+require recipes-devtools/rust/rust-source-${PV}.inc
+require recipes-devtools/rust/rust-snapshot-${PV}.inc
+require cargo.inc
+
+LIC_FILES_CHKSUM += " \
+    file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
+    file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \
+"
meta/recipes-devtools/cargo/cargo_1.36.0.bb new file +8 -0
new file mode 100644
index 0000000000..f048779aae
@@ -0,0 +1,8 @@
+require recipes-devtools/rust/rust-source-${PV}.inc
+require recipes-devtools/rust/rust-snapshot-${PV}.inc
+require cargo.inc
+
+LIC_FILES_CHKSUM += " \
+    file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \
+    file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \
+"
meta/recipes-devtools/cargo/cargo_1.37.0.bb new file +8 -0
new file mode 100644
index 0000000000..f048779aae
@@ -0,0 +1,8 @@
+require recipes-devtools/rust/rust-source-${PV}.inc
+require recipes-devtools/rust/rust-snapshot-${PV}.inc
+require cargo.inc
+
+LIC_FILES_CHKSUM += " \
+    file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \
+    file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \
+"
meta/recipes-devtools/rust/libstd-rs.inc new file +31 -0
new file mode 100644
index 0000000000..5298c00706
@@ -0,0 +1,31 @@
+SUMMARY = "Rust standard libaries"
+HOMEPAGE = "http://www.rust-lang.org"
+SECTION = "devel"
+LICENSE = "MIT | Apache-2.0"
+
+RUSTLIB_DEP = ""
+inherit cargo
+
+DEPENDS_append_libc-musl = " libunwind"
+# Needed so cargo can find libbacktrace
+RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
+
+S = "${RUSTSRC}/src/libstd"
+
+CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
+
+do_compile_prepend () {
+    export CARGO_TARGET_DIR="${B}"
+    # For Rust 1.13.0 and newer
+    export RUSTC_BOOTSTRAP="1"
+}
+
+do_install () {
+    mkdir -p ${D}${rustlibdir}
+
+    # With the incremental build support added in 1.24, the libstd deps directory also includes dependency
+    # files that get installed. Those are really only needed to incrementally rebuild the libstd library
+    # itself and don't need to be installed.
+    rm -f ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/*.d
+    cp ${B}/${TARGET_SYS}/${BUILD_DIR}/deps/* ${D}${rustlibdir}
+}
meta/recipes-devtools/rust/libstd-rs_1.34.2.bb new file +8 -0
new file mode 100644
index 0000000000..69cb48ad07
@@ -0,0 +1,8 @@
+require rust-source-${PV}.inc
+require libstd-rs.inc
+
+LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
+
+CARGO_FEATURES ?= "panic-unwind backtrace"
+
+CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/libstd-rs_1.36.0.bb new file +8 -0
new file mode 100644
index 0000000000..69cb48ad07
@@ -0,0 +1,8 @@
+require rust-source-${PV}.inc
+require libstd-rs.inc
+
+LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
+
+CARGO_FEATURES ?= "panic-unwind backtrace"
+
+CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/libstd-rs_1.37.0.bb new file +8 -0
new file mode 100644
index 0000000000..69cb48ad07
@@ -0,0 +1,8 @@
+require rust-source-${PV}.inc
+require libstd-rs.inc
+
+LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
+
+CARGO_FEATURES ?= "panic-unwind backtrace"
+
+CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/rust-cross.inc new file +52 -0

52 lines not on this page · raw message

meta/recipes-devtools/rust/rust-cross_1.34.2.bb new file +3 -0
new file mode 100644
index 0000000000..bb92b99ccc
@@ -0,0 +1,3 @@
+require rust-cross.inc
+require rust-source-${PV}.inc
+
meta/recipes-devtools/rust/rust-cross_1.36.0.bb new file +3 -0
new file mode 100644
index 0000000000..bb92b99ccc
@@ -0,0 +1,3 @@
+require rust-cross.inc
+require rust-source-${PV}.inc
+
meta/recipes-devtools/rust/rust-cross_1.37.0.bb new file +3 -0
new file mode 100644
index 0000000000..bb92b99ccc
@@ -0,0 +1,3 @@
+require rust-cross.inc
+require rust-source-${PV}.inc
+
meta/recipes-devtools/rust/rust-llvm.inc new file +62 -0

62 lines not on this page · raw message

meta/recipes-devtools/rust/rust-llvm/0002-llvm-allow-env-override-of-exe-path.patch new file +32 -0
new file mode 100644
index 0000000000..65dbd6ffd6
@@ -0,0 +1,32 @@
+From 7111770e8290082530d920e120995bf81431b0aa Mon Sep 17 00:00:00 2001
+From: Martin Kelly <[email protected]>
+Date: Fri, 19 May 2017 00:22:57 -0700
+Subject: [PATCH 12/18] llvm: allow env override of exe path
+
+When using a native llvm-config from inside a sysroot, we need llvm-config to
+return the libraries, include directories, etc. from inside the sysroot rather
+than from the native sysroot. Thus provide an env override for calling
+llvm-config from a target sysroot.
+
+Signed-off-by: Martin Kelly <[email protected]>
+Signed-off-by: Khem Raj <[email protected]>
+---
+ tools/llvm-config/llvm-config.cpp | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+--- a/tools/llvm-config/llvm-config.cpp
++++ b/tools/llvm-config/llvm-config.cpp
+@@ -226,6 +226,13 @@ Typical components:\n\
+ 
+ /// Compute the path to the main executable.
+ std::string GetExecutablePath(const char *Argv0) {
++  // Hack for Yocto: we need to override the root path when we are using
++  // llvm-config from within a target sysroot.
++  const char *Sysroot = std::getenv("YOCTO_ALTERNATE_EXE_PATH");
++  if (Sysroot != nullptr) {
++    return Sysroot;
++  }
++
+   // This just needs to be some symbol in the binary; C++ doesn't
+   // allow taking the address of ::main however.
+   void *P = (void *)(intptr_t)GetExecutablePath;
meta/recipes-devtools/rust/rust-llvm_1.34.2.bb new file +16 -0
new file mode 100644
index 0000000000..d41fa28477
@@ -0,0 +1,16 @@
+require rust-source-${PV}.inc
+require rust-llvm.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648"
+
+do_install_prepend () {
+	# the install does a sed on this without installing the file
+	# we don't need it for anything
+	mkdir -p "${D}/usr/share/llvm/cmake"
+	touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake"
+}
+
+do_install_append () {
+	# we don't need any of this stuff to build Rust
+	rm -rf "${D}/usr/lib/cmake"
+}
meta/recipes-devtools/rust/rust-llvm_1.36.0.bb new file +16 -0
new file mode 100644
index 0000000000..d41fa28477
@@ -0,0 +1,16 @@
+require rust-source-${PV}.inc
+require rust-llvm.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648"
+
+do_install_prepend () {
+	# the install does a sed on this without installing the file
+	# we don't need it for anything
+	mkdir -p "${D}/usr/share/llvm/cmake"
+	touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake"
+}
+
+do_install_append () {
+	# we don't need any of this stuff to build Rust
+	rm -rf "${D}/usr/lib/cmake"
+}
meta/recipes-devtools/rust/rust-llvm_1.37.0.bb new file +16 -0
new file mode 100644
index 0000000000..d41fa28477
@@ -0,0 +1,16 @@
+require rust-source-${PV}.inc
+require rust-llvm.inc
+
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648"
+
+do_install_prepend () {
+	# the install does a sed on this without installing the file
+	# we don't need it for anything
+	mkdir -p "${D}/usr/share/llvm/cmake"
+	touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake"
+}
+
+do_install_append () {
+	# we don't need any of this stuff to build Rust
+	rm -rf "${D}/usr/lib/cmake"
+}
meta/recipes-devtools/rust/rust-snapshot-1.34.2.inc new file +24 -0
new file mode 100644
index 0000000000..d0209bb864
@@ -0,0 +1,24 @@
+## This is information on the rust-snapshot (binary) used to build our current release.
+## snapshot info is taken from rust/src/stage0.txt
+## TODO: find a way to add additional SRC_URIs based on the contents of an
+##       earlier SRC_URI.
+RS_VERSION = "1.33.0"
+
+RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+CARGO_VERSION = "0.34.0"
+CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+
+SRC_URI += " \
+	https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.gz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.gz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	"
+
+# TODO: Add hashes for other architecture toolchains as well. Make a script?
+SRC_URI[rustc-snapshot-x86_64.md5sum] = "c1ec989c1965dce754dda1e54274a68c"
+SRC_URI[rustc-snapshot-x86_64.sha256sum] = "54a342f718b712d8a17fd7878ebd37d22a82ebc70b59c421168cd4153fd04c2b"
+SRC_URI[rust-std-snapshot-x86_64.md5sum] = "d573c5bd3a965c973734c1606968a91e"
+SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "661c2ba717ae1502f002b4c6e7aeb8941685c7ea8fe7ac26ed9ede26f615b7af"
+SRC_URI[cargo-snapshot-x86_64.md5sum] = "de0e635afa9bf495cefecea476bfce36"
+SRC_URI[cargo-snapshot-x86_64.sha256sum] = "4795ae5ca3bb8c7c83ca338676bb02b670efa1eb474e346284b629dc872bcce8"
meta/recipes-devtools/rust/rust-snapshot-1.36.0.inc new file +24 -0
new file mode 100644
index 0000000000..e4b6813e84
@@ -0,0 +1,24 @@
+## This is information on the rust-snapshot (binary) used to build our current release.
+## snapshot info is taken from rust/src/stage0.txt
+## TODO: find a way to add additional SRC_URIs based on the contents of an
+##       earlier SRC_URI.
+RS_VERSION = "1.35.0"
+
+RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+CARGO_VERSION = "0.36.0"
+CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+
+SRC_URI += " \
+	https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	"
+
+# TODO: Add hashes for other architecture toolchains as well. Make a script?
+SRC_URI[rustc-snapshot-x86_64.md5sum] = "47ea78f6b3f68e30f24b9c94e465d6bd"
+SRC_URI[rustc-snapshot-x86_64.sha256sum] = "5d6dc216ba429ddf3a1657e70f3e5e380549b546fe56de897677a11d72aa4e07"
+SRC_URI[rust-std-snapshot-x86_64.md5sum] = "348ec23ca8e47fc65079bc80e63cca5f"
+SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "ccff05d0e2d88499505b10f8e33e8b1645df057f918edc81f8acb0fcee9f90b2"
+SRC_URI[cargo-snapshot-x86_64.md5sum] = "93a375e771f3d9b3a139e612dd4730ee"
+SRC_URI[cargo-snapshot-x86_64.sha256sum] = "ab5a6ff1947463dbd2477ca5dac2012494dae821112098ae0c54add652adfdc3"
meta/recipes-devtools/rust/rust-snapshot-1.37.0.inc new file +24 -0
new file mode 100644
index 0000000000..8d4c1801ed
@@ -0,0 +1,24 @@
+## This is information on the rust-snapshot (binary) used to build our current release.
+## snapshot info is taken from rust/src/stage0.txt
+## TODO: find a way to add additional SRC_URIs based on the contents of an
+##       earlier SRC_URI.
+RS_VERSION = "1.36.0"
+
+RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+CARGO_VERSION = "0.37.0"
+CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+
+SRC_URI += " \
+	https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+	"
+
+# TODO: Add hashes for other architecture toolchains as well. Make a script?
+SRC_URI[rustc-snapshot-x86_64.md5sum] = "ec27794c94cc1df1a0a69f7244a09176"
+SRC_URI[rustc-snapshot-x86_64.sha256sum] = "fff0158da6f5af2a89936dc3e0c361077c06c2983eb310615e02f81ebbde1416"
+SRC_URI[rust-std-snapshot-x86_64.md5sum] = "b71a6fd6f44527c3bf09584e89ad8958"
+SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "ce8e12684b568a8a4f7d346a743383429849cf3f028f5712ad3d3e31590c8db3"
+SRC_URI[cargo-snapshot-x86_64.md5sum] = "8c661276a0da7a1aa48affbe33b347e6"
+SRC_URI[cargo-snapshot-x86_64.sha256sum] = "d20fa121951339d5492cf8862f8a7af59efc99d18f3c27b95ab6d4658b6a7d67"
meta/recipes-devtools/rust/rust-source-1.34.2.inc new file +11 -0
new file mode 100644
index 0000000000..5c83f6f000
@@ -0,0 +1,11 @@
+SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust"
+
+SRC_URI[rust.md5sum] = "7c85e6a60dda740295f7e004a1fb15e1"
+SRC_URI[rust.sha256sum] = "c69a4a85a1c464368597df8878cb9e1121aae93e215616d45ad7d23af3052f56"
+
+# later versions of rust change the directory that they unextract to
+RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
+# set this as our default
+S = "${RUSTSRC}"
+
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust-source-1.36.0.inc new file +11 -0
new file mode 100644
index 0000000000..1a1d07c72f
@@ -0,0 +1,11 @@
+SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust"
+
+SRC_URI[rust.md5sum] = "78ffc0b029aaed216b45c3fe24747d46"
+SRC_URI[rust.sha256sum] = "f51645b9f787af4a5d94db17f6af39db0c55980ed24fe366cad55b57900f8f2d"
+
+# later versions of rust change the directory that they unextract to
+RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
+# set this as our default
+S = "${RUSTSRC}"
+
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust-source-1.37.0.inc new file +11 -0
new file mode 100644
index 0000000000..0169cd3fbd
@@ -0,0 +1,11 @@
+SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust"
+
+SRC_URI[rust.md5sum] = "ee6300b1d7e5767115492915c4c0d8ef"
+SRC_URI[rust.sha256sum] = "10abffac50a729cf74cef6dd03193a2f4647541bd19ee9281be9e5b12ca8cdfd"
+
+# later versions of rust change the directory that they unextract to
+RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
+# set this as our default
+S = "${RUSTSRC}"
+
+LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust.inc new file +509 -0

509 lines not on this page · raw message

meta/recipes-devtools/rust/rust_1.34.2.bb new file +12 -0
new file mode 100644
index 0000000000..c7f9f4fd87
@@ -0,0 +1,12 @@
+require rust.inc
+require rust-source-${PV}.inc
+require rust-snapshot-${PV}.inc
+
+DEPENDS += "rust-llvm (=${PV})"
+
+# Otherwise we'll depend on what we provide
+INHIBIT_DEFAULT_RUST_DEPS_class-native = "1"
+# We don't need to depend on gcc-native because yocto assumes it exists
+PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust"
+
+BBCLASSEXTEND = "native"
meta/recipes-devtools/rust/rust_1.36.0.bb new file +12 -0
new file mode 100644
index 0000000000..c7f9f4fd87
@@ -0,0 +1,12 @@
+require rust.inc
+require rust-source-${PV}.inc
+require rust-snapshot-${PV}.inc
+
+DEPENDS += "rust-llvm (=${PV})"
+
+# Otherwise we'll depend on what we provide
+INHIBIT_DEFAULT_RUST_DEPS_class-native = "1"
+# We don't need to depend on gcc-native because yocto assumes it exists
+PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust"
+
+BBCLASSEXTEND = "native"
meta/recipes-devtools/rust/rust_1.37.0.bb new file +12 -0
new file mode 100644
index 0000000000..c7f9f4fd87
@@ -0,0 +1,12 @@
+require rust.inc
+require rust-source-${PV}.inc
+require rust-snapshot-${PV}.inc
+
+DEPENDS += "rust-llvm (=${PV})"
+
+# Otherwise we'll depend on what we provide
+INHIBIT_DEFAULT_RUST_DEPS_class-native = "1"
+# We don't need to depend on gcc-native because yocto assumes it exists
+PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust"
+
+BBCLASSEXTEND = "native"
meta/recipes-example/rust-hello-world/rust-hello-world_git.bb new file +13 -0
new file mode 100644
index 0000000000..ba8854849d
@@ -0,0 +1,13 @@
+inherit cargo
+
+SRC_URI = "git://github.com/jmesmon/rust-hello-world.git;protocol=https"
+SRCREV="e0fa23f1a3cb1eb1407165bd2fc36d2f6e6ad728"
+LIC_FILES_CHKSUM="file://COPYRIGHT;md5=e6b2207ac3740d2d01141c49208c2147"
+
+SUMMARY = "Hello World by Cargo for Rust"
+HOMEPAGE = "https://github.com/jmesmon/rust-hello-world"
+LICENSE = "MIT | Apache-2.0"
+
+S = "${WORKDIR}/git"
+
+BBCLASSEXTEND = "native"
meta/recipes-example/rustfmt/rustfmt_0.8.0.bb new file +67 -0

67 lines not on this page · raw message

scripts/build.sh new file +19 -0
new file mode 100755
index 0000000000..cfff7c1ba8
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+# Grab the MACHINE from the environment; otherwise, set it to a sane default
+export MACHINE="${MACHINE-qemux86-64}"
+
+# What to build
+BUILD_TARGETS="\
+    rustfmt \
+    "
+
+die() {
+    echo "$*" >&2
+    exit 1
+}
+
+rm -f build/conf/bblayers.conf || die "failed to nuke bblayers.conf"
+rm -f build/conf/local.conf || die "failed to nuke local.conf"
+
+./scripts/containerize.sh bitbake ${BUILD_TARGETS} || die "failed to build"
scripts/cleanup-env.sh new file +14 -0
new file mode 100755
index 0000000000..d2d57295b2
@@ -0,0 +1,14 @@
+#!/bin/bash -x
+
+sudo fuser -m `pwd`/build
+
+# Only attempt to unmount if the directory is already mounted
+if mountpoint -q `pwd`/build; then
+    sudo umount `pwd`/build
+fi
+
+sudo fuser -m `pwd`/build
+
+ps -ef
+
+exit 0
scripts/containerize.sh new file +54 -0

54 lines not on this page · raw message

scripts/fetch.sh new file +103 -0

103 lines not on this page · raw message

scripts/publish-build-cache.sh new file +13 -0
new file mode 100755
index 0000000000..e3a0a1829a
@@ -0,0 +1,13 @@
+#!/bin/bash -x
+
+if [[ $# -lt 1 ]]; then
+    echo "No Yocto branch specified, defaulting to master"
+    echo "To change this pass a Yocto branch name as an argument to this script"
+fi
+branch=${1-master}
+
+rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/downloads [email protected]:/srv/yocto-cache/
+
+rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/sstate-cache [email protected]:/srv/yocto-cache/${branch}/
+
+exit 0
scripts/setup-env.sh new file +12 -0
new file mode 100755
index 0000000000..dbed06111b
@@ -0,0 +1,12 @@
+#!/bin/bash -e
+
+mkdir -p build
+
+total_mem=`grep MemTotal /proc/meminfo | awk '{print $2}'`
+
+# Only have the slaves with large amounts of RAM mount the tmpfs
+if [ "$total_mem" -ge "67108864" ]; then
+    sudo mount -t tmpfs -o size=64G,mode=755,uid=${UID} tmpfs build
+fi
+
+exit 0
Signature · 1 line
2.27.0
#3 lore raw

PATCH 2/7 rust: mv README.md to recipes-devtools/rust/README-rust.md

In reply to Randy MacLeod

Import the meta-rust/README.md but relocate and rename it.

---
 meta/recipes-devtools/rust/README-rust.md | 69 +++++++++++++++++++++++
 1 file changed, 69 insertions(+)
 create mode 100644 meta/recipes-devtools/rust/README-rust.md
meta/recipes-devtools/rust/README-rust.md new file +69 -0
new file mode 100644
index 0000000000..329d59ab7b
@@ -0,0 +1,69 @@
+## Introduction
+
+This OpenEmbedded layer provides the rust compiler, tools for building packages
+(cargo), and a few example projects.
+
+## What works:
+
+ - Building `rust-native` and `cargo-native`
+ - Building Rust based projects with Cargo for the TARGET
+   - e.g. `rustfmt` which is used by the CI system
+ - `-buildsdk` and `-crosssdk` packages
+
+## What doesn't:
+
+ - Using anything but x86_64 as the build environment
+ - rust (built for target) issue #81
+
+## What's untested:
+
+ - cargo (built for target)
+
+## Building a rust package
+
+When building a rust package in bitbake, it's usually easiest to build with
+cargo using cargo.bbclass.  If the package already has a Cargo.toml file (most
+rust packages do), then it's especially easy.  Otherwise you should probably
+get the code building in cargo first.
+
+Once your package builds in cargo, you can use
+[cargo-bitbake](https://github.com/cardoe/cargo-bitbake) to generate a bitbake
+recipe for it.  This allows bitbake to fetch all the necessary dependent
+crates, as well as a pegged version of the crates.io index, to ensure maximum
+reproducibility.
+
+NOTE: You will have to edit the generated recipe based on the comments
+contained within it
+
+## TODO
+
+## Pitfalls
+
+ - 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.
+
+## Dependencies
+
+On the host:
+ - Any `-sys` packages your project might need must have RDEPENDs for
+ the native library.
+
+On the target:
+ - Any `-sys` packages your project might need must have RDEPENDs for
+ the native library.
+
+## Maintainer(s) & Patch policy
+
+Open a Pull Request.
+
+The 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.
+
+All new patches against rust, rust-llvm, and cargo must have referenced
+upstream issues or PRs opened or an explanation why the patch cannot be
+upstreamed. This cooresponds to the OpenEmbedded policy for other meta layers.
+
+More info can be seen on the wiki.
+
+## Copyright
+
+MIT OR Apache-2.0 - Same as rust
+
Signature · 1 line
2.27.0
#4 lore raw

PATCH 3/7 meta-rust: merge commits

In reply to Randy MacLeod

Merge most of:
git log --oneline --no-merges 5cda04c..029f1ea
with two layer.conf exceptions explained below.

f8b9103 Remove checks for Rust versions we don't build anymore.
920328c rust-native shouldn't depend on TARGET variables
4e96013 Factor in CARGO_SRC_DIR when setting MANIFEST_PATH.
87e8d50 Keep only the most recent two Rust versions.
53c9aab rust: Drop v8.1a tune for aarch64
7feed5d recipes-example/rust-hello-world: move to new url in meta-rust org
1b94401 readme: fix url and link issue number
26609f4 rust.inc: use 'v8.1a' feature when building for aarch64 instead of 'v8' 71538c8 rust_versions.inc: switch the default version to 1.49.0
c976184 {cargo,rust}-1.49.0: simplify as in https://github.com/meta-rust/meta-rust/pull/299
0025ceb Fix *-native cargo builds
3ab7542 rust-source, rust-snaphost: drop md5sums
b163a89 rust-source, rust-snapshot: simplify as well
0ee328a add rust 1.49.0
3e73030 rust-target.inc: add new include file to simplify all rust_*.bb
9c0a105 rust_versions.inc: add include for easy switching between versions
a31a407 cargo: move LIC_FILES_CHKSUM from cargo_*.bb to cargo.inc where LICENSE is set 1d64f90 rust: move LIC_FILES_CHKSUM from rust-source-*.inc to rust.inc where LICENSE is set 80c30c3 rust-llvm-ncsa.inc: reorder to actually set LICENSE and LIC_FILES_CHKSUM 1cb40bd Revert "rust-llvm: Use early variable assignment for the license checksum in rust-llvm.inc" d5ab20d rust-hello-world: enable LTO in the build
b7eacc0 libstd-rs: embed bitcode for LTO
1936904 cargo: Mark the cargo-native dependency specific to target
5dda6c4 rust-llvm: Use early variable assignment for the license checksum in rust-llvm.inc 47de35e libstd-rs: Remove libunwind on riscv
e297948 rust: Add riscv32/riscv64 support
a679b6f rust: Build rust backend
a59ddd9 rust: Correct the data layout for riscv32
e5ee880 cargo_common: Make output more readable
a673320 cargo: Enable build separation
cb4f829 Use proper llvm-target for armv7
4b151fa add rust 1.47.0
8cfc3c9 clean up some common definitions across rust versions
aec6519 cargo: add missing version 1.46.0
7afffa0 rust-bin.bbclass: Do not use append and += together
2822b50 layer.conf: Add gatesgarth to LAYERSERIES_COMPAT
skip the layer compat change but keep
rust-llvm.inc: export YOCTO_ALTERNATE_EXE_PATH
8a44bae Disable LIBGIT2_SYS_USE_PKG_CONFIG due to incompatibility with 0.28.x b7f9c1d Add rust 1.46.0
647b976 rust: use PARALLEL_MAKE instead of BB_NUMBER_THREADS
8d3f79f rust.inc: whitelist BB_NUMBER_THREADS in do_compile
2c7321d Bump to Rust version 1.43
b84c61e Revert "cargo: fix progress output"
dd0fc89 cargo: fix progress output
afcb58e rust.inc: cut build time in half
40a6bd8 rust.inc: run bootstrap.py in parallel
c023edd rust.inc: make max-atomic-width an integer
3b78365 rust-native shouldn't depend on TARGET variables
8ef8b39 rustfmt: Upgrade to 1.4.2
e4d25b9 layer.conf: Mark it 3.1 release compatible
skip the layer compat change so this commit was omitted
ea97549 Avoid extra sh process from shell wrapper
4a763a2 Update 0001-Disable-http2.patch for cargo 1.41.0
5c7f51b Update to Rust 1.41.0
837b635 cargo: Refresh http2 disable patch
2668f6a Update 0001-Disable-http2.patch for Cargo shipped with Rust 1.40.0
e5c2a40 Update to Rust and Cargo 1.40.0.
72aa4ef rust: Use Python3 native for build
186ec59 rust: Improve TUNE_FEATURE parsing
71895ec Update to Rust and Cargo 1.39.0

---
 meta/classes/cargo.bbclass                    |  13 +-
 meta/classes/cargo_common.bbclass             |  63 +++++--
 meta/classes/rust-bin.bbclass                 |   2 +-
 meta/classes/rust-common.bbclass              |  27 ++-
 meta/conf/distro/include/rust_versions.inc    |  13 ++
 .../cargo-1.37.0/0001-Disable-http2.patch     |  29 ---
 .../0001-Disable-http2.patch                  |  22 +--
 .../0001-Disable-http2.patch                  |  24 +--
 meta/recipes-devtools/cargo/cargo.inc         |  18 +-
 meta/recipes-devtools/cargo/cargo_1.34.2.bb   |   8 -
 meta/recipes-devtools/cargo/cargo_1.36.0.bb   |   8 -
 meta/recipes-devtools/cargo/cargo_1.37.0.bb   |   8 -
 meta/recipes-devtools/cargo/cargo_1.47.0.bb   |   3 +
 meta/recipes-devtools/cargo/cargo_1.49.0.bb   |   3 +
 meta/recipes-devtools/rust/README-rust.md     |   6 +-
 meta/recipes-devtools/rust/libstd-rs.inc      |   9 +
 .../recipes-devtools/rust/libstd-rs_1.34.2.bb |   8 -
 .../recipes-devtools/rust/libstd-rs_1.36.0.bb |   8 -
 .../recipes-devtools/rust/libstd-rs_1.37.0.bb |   8 -
 .../recipes-devtools/rust/libstd-rs_1.47.0.bb |   5 +
 .../recipes-devtools/rust/libstd-rs_1.49.0.bb |   5 +
 meta/recipes-devtools/rust/rust-cross.inc     |  19 ++
 ...t-cross_1.34.2.bb => rust-cross_1.47.0.bb} |   1 -
 ...t-cross_1.36.0.bb => rust-cross_1.49.0.bb} |   1 -
 meta/recipes-devtools/rust/rust-llvm.inc      |  16 +-
 .../recipes-devtools/rust/rust-llvm_1.34.2.bb |  16 --
 .../recipes-devtools/rust/rust-llvm_1.36.0.bb |  16 --
 .../recipes-devtools/rust/rust-llvm_1.37.0.bb |  16 --
 ...st-cross_1.37.0.bb => rust-llvm_1.47.0.bb} |   3 +-
 .../recipes-devtools/rust/rust-llvm_1.49.0.bb |   2 +
 .../rust/rust-snapshot-1.34.2.inc             |  24 ---
 .../rust/rust-snapshot-1.36.0.inc             |  24 ---
 .../rust/rust-snapshot-1.37.0.inc             |  24 ---
 .../rust/rust-snapshot-1.47.0.inc             |  13 ++
 .../rust/rust-snapshot-1.49.0.inc             |  13 ++
 meta/recipes-devtools/rust/rust-snapshot.inc  |   9 +
 .../rust/rust-source-1.34.2.inc               |  11 --
 .../rust/rust-source-1.36.0.inc               |  11 --
 .../rust/rust-source-1.37.0.inc               |  11 --
 .../rust/rust-source-1.47.0.inc               |   3 +
 .../rust/rust-source-1.49.0.inc               |   3 +
 meta/recipes-devtools/rust/rust-source.inc    |   3 +
 .../rust/{rust_1.36.0.bb => rust-target.inc}  |   2 -
 meta/recipes-devtools/rust/rust.inc           | 117 ++++++------
 ...-dash-vs-underscore-mismatches-in-op.patch |  75 ++++++++
 meta/recipes-devtools/rust/rust_1.34.2.bb     |  12 --
 meta/recipes-devtools/rust/rust_1.37.0.bb     |  12 --
 meta/recipes-devtools/rust/rust_1.47.0.bb     |   9 +
 meta/recipes-devtools/rust/rust_1.49.0.bb     |  15 ++
 .../rust-hello-world/0001-enable-LTO.patch    |  23 +++
 .../rust-hello-world/rust-hello-world_git.bb  |   8 +-
 meta/recipes-example/rustfmt/rustfmt_0.8.0.bb |  67 -------
 meta/recipes-example/rustfmt/rustfmt_1.4.2.bb | 171 ++++++++++++++++++
 53 files changed, 591 insertions(+), 449 deletions(-)
 create mode 100644 meta/conf/distro/include/rust_versions.inc
 delete mode 100644 meta/recipes-devtools/cargo/cargo-1.37.0/0001-Disable-http2.patch
 rename meta/recipes-devtools/cargo/{cargo-1.36.0 => cargo-1.47.0}/0001-Disable-http2.patch (53%)
 rename meta/recipes-devtools/cargo/{cargo-1.34.2 => cargo-1.49.0}/0001-Disable-http2.patch (53%)
 delete mode 100644 meta/recipes-devtools/cargo/cargo_1.34.2.bb
 delete mode 100644 meta/recipes-devtools/cargo/cargo_1.36.0.bb
 delete mode 100644 meta/recipes-devtools/cargo/cargo_1.37.0.bb
 create mode 100644 meta/recipes-devtools/cargo/cargo_1.47.0.bb
 create mode 100644 meta/recipes-devtools/cargo/cargo_1.49.0.bb
 delete mode 100644 meta/recipes-devtools/rust/libstd-rs_1.34.2.bb
 delete mode 100644 meta/recipes-devtools/rust/libstd-rs_1.36.0.bb
 delete mode 100644 meta/recipes-devtools/rust/libstd-rs_1.37.0.bb
 create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.47.0.bb
 create mode 100644 meta/recipes-devtools/rust/libstd-rs_1.49.0.bb
 rename meta/recipes-devtools/rust/{rust-cross_1.34.2.bb => rust-cross_1.47.0.bb} (98%)
 rename meta/recipes-devtools/rust/{rust-cross_1.36.0.bb => rust-cross_1.49.0.bb} (98%)
 delete mode 100644 meta/recipes-devtools/rust/rust-llvm_1.34.2.bb
 delete mode 100644 meta/recipes-devtools/rust/rust-llvm_1.36.0.bb
 delete mode 100644 meta/recipes-devtools/rust/rust-llvm_1.37.0.bb
 rename meta/recipes-devtools/rust/{rust-cross_1.37.0.bb => rust-llvm_1.47.0.bb} (55%)
 create mode 100644 meta/recipes-devtools/rust/rust-llvm_1.49.0.bb
 delete mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.34.2.inc
 delete mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.36.0.inc
 delete mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.37.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.47.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-snapshot-1.49.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-snapshot.inc
 delete mode 100644 meta/recipes-devtools/rust/rust-source-1.34.2.inc
 delete mode 100644 meta/recipes-devtools/rust/rust-source-1.36.0.inc
 delete mode 100644 meta/recipes-devtools/rust/rust-source-1.37.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-source-1.47.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-source-1.49.0.inc
 create mode 100644 meta/recipes-devtools/rust/rust-source.inc
 rename meta/recipes-devtools/rust/{rust_1.36.0.bb => rust-target.inc} (82%)
 create mode 100644 meta/recipes-devtools/rust/rust/0001-rustc_target-Fix-dash-vs-underscore-mismatches-in-op.patch
 delete mode 100644 meta/recipes-devtools/rust/rust_1.34.2.bb
 delete mode 100644 meta/recipes-devtools/rust/rust_1.37.0.bb
 create mode 100644 meta/recipes-devtools/rust/rust_1.47.0.bb
 create mode 100644 meta/recipes-devtools/rust/rust_1.49.0.bb
 create mode 100644 meta/recipes-example/rust-hello-world/rust-hello-world/0001-enable-LTO.patch
 delete mode 100644 meta/recipes-example/rustfmt/rustfmt_0.8.0.bb
 create mode 100644 meta/recipes-example/rustfmt/rustfmt_1.4.2.bb
meta/classes/cargo.bbclass +10 -3
index c321e6bf70..c2eee101bd 100644
@@ -15,16 +15,23 @@ BASEDEPENDS_append = " cargo-native"
 DEPENDS_append_class-target = " virtual/${TARGET_PREFIX}rust ${RUSTLIB_DEP}"
 DEPENDS_append_class-native = " rust-native"
 
-# Cargo only supports in-tree builds at the moment
-B = "${S}"
+# Enable build separation
+B = "${WORKDIR}/build"
 
 # In case something fails in the build process, give a bit more feedback on
 # where the issue occured
 export RUST_BACKTRACE = "1"
 
+# The directory of the Cargo.toml relative to the root directory, per default
+# assume there's a Cargo.toml directly in the root directory
+CARGO_SRC_DIR ??= ""
+
+# The actual path to the Cargo.toml
+MANIFEST_PATH ??= "${S}/${CARGO_SRC_DIR}/Cargo.toml"
+
 RUSTFLAGS ??= ""
 BUILD_MODE = "${@['--release', ''][d.getVar('DEBUG_BUILD') == '1']}"
-CARGO_BUILD_FLAGS = "-v --target ${HOST_SYS} ${BUILD_MODE}"
+CARGO_BUILD_FLAGS = "-v --target ${HOST_SYS} ${BUILD_MODE} --manifest-path=${MANIFEST_PATH}"
 
 # This is based on the content of CARGO_BUILD_FLAGS and generally will need to
 # change if CARGO_BUILD_FLAGS changes.
meta/classes/cargo_common.bbclass +43 -20

91 lines not on this page · raw message

meta/classes/rust-bin.bbclass +1 -1
index a13fbafb56..6819c9e061 100644
@@ -1,6 +1,6 @@
 inherit rust
 
-RDEPENDS_${PN}_append_class-target += "${RUSTLIB_DEP}"
+RDEPENDS_${PN}_append_class-target = " ${RUSTLIB_DEP}"
 
 RUSTC_ARCHFLAGS += "-C opt-level=3 -g -L ${STAGING_DIR_HOST}/${rustlibdir} -C linker=${RUST_TARGET_CCLD}"
 EXTRA_OEMAKE += 'RUSTC_ARCHFLAGS="${RUSTC_ARCHFLAGS}"'
meta/classes/rust-common.bbclass +25 -2
index cbc7d3cfe6..ff7b9da8f3 100644
@@ -31,6 +31,24 @@ def determine_libc(d, thing):
 
     return libc
 
+def target_is_armv7(d):
+    '''Determine if target is armv7'''
+    # TUNE_FEATURES may include arm* even if the target is not arm
+    # in the case of *-native packages
+    if d.getVar('TARGET_ARCH') != 'arm':
+        return False
+
+    feat = d.getVar('TUNE_FEATURES')
+    feat = frozenset(feat.split())
+    mach_overrides = d.getVar('MACHINEOVERRIDES')
+    mach_overrides = frozenset(mach_overrides.split(':'))
+
+    v7=frozenset(['armv7a', 'armv7r', 'armv7m', 'armv7ve'])
+    if mach_overrides.isdisjoint(v7) and feat.isdisjoint(v7):
+        return False
+    else:
+        return True
+
 # Responsible for taking Yocto triples and converting it to Rust triples
 def rust_base_triple(d, thing):
     '''
@@ -40,7 +58,12 @@ def rust_base_triple(d, thing):
     Note that os is assumed to be some linux form
     '''
 
-    arch = d.getVar('{}_ARCH'.format(thing))
+    # The llvm-target for armv7 is armv7-unknown-linux-gnueabihf
+    if thing == "TARGET" and target_is_armv7(d):
+        arch = "armv7"
+    else:
+        arch = d.getVar('{}_ARCH'.format(thing))
+
     # All the Yocto targets are Linux and are 'unknown'
     vendor = "-unknown"
     os = d.getVar('{}_OS'.format(thing))
@@ -110,7 +133,7 @@ create_wrapper () {
 
 	cat <<- EOF > "${file}"
 	#!/bin/sh
-	$@ "\$@"
+	exec $@ "\$@"
 	EOF
 	chmod +x "${file}"
 }
meta/conf/distro/include/rust_versions.inc new file +13 -0
new file mode 100644
index 0000000000..8e328a720f
@@ -0,0 +1,13 @@
+# include this in your distribution to easily switch between versions
+# just by changing RUST_VERSION variable
+
+RUST_VERSION ?= "1.49.0"
+
+PREFERRED_VERSION_cargo ?= "${RUST_VERSION}"
+PREFERRED_VERSION_cargo-native ?= "${RUST_VERSION}"
+PREFERRED_VERSION_libstd-rs ?= "${RUST_VERSION}"
+PREFERRED_VERSION_rust ?= "${RUST_VERSION}"
+PREFERRED_VERSION_rust-cross-${TARGET_ARCH} ?= "${RUST_VERSION}"
+PREFERRED_VERSION_rust-llvm ?= "${RUST_VERSION}"
+PREFERRED_VERSION_rust-llvm-native ?= "${RUST_VERSION}"
+PREFERRED_VERSION_rust-native ?= "${RUST_VERSION}"
meta/recipes-devtools/cargo/cargo-1.37.0/0001-Disable-http2.patch deleted +0 -29
deleted file mode 100644
index c804297d48..0000000000
@@ -1,29 +0,0 @@
-From 0e2384133664ebeb548b782ad763c3a627c1bc66 Mon Sep 17 00:00:00 2001
-From: Johan Anderholm <[email protected]>
-Date: Sun, 27 Jan 2019 10:19:00 +0100
-Subject: [PATCH] Disable http2
-
-http2 requires that curl is build with nghttp2 which in turn depends on
-many dependencies and ultimately a dependency loop in the case of
-curl-native. As long as multiplexing is disabled in cargo this should
-be fine.
-
-Upstream-Status: Inappropriate
-
----
- src/tools/cargo/Cargo.toml | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/Cargo.toml b/Cargo.toml
-index d15aa2513..ba9c77d25 100644
---- a/Cargo.toml
-+++ b/Cargo.toml
-@@ -24,7 +24,7 @@ bytesize = "1.0"
- crates-io = { path = "crates/crates-io", version = "0.26" }
- crossbeam-utils = "0.6"
- crypto-hash = "0.3.1"
--curl = { version = "0.4.21", features = ['http2'] }
-+curl = { version = "0.4.21" }
- curl-sys = "0.4.18"
- env_logger = "0.6.0"
- pretty_env_logger = { version = "0.3", optional = true }
meta/recipes-devtools/cargo/cargo-1.47.0/0001-Disable-http2.patch renamed from meta/recipes-devtools/cargo/cargo-1.36.0/0001-Disable-http2.patch +11 -11
similarity index 53%
rename from meta/recipes-devtools/cargo/cargo-1.36.0/0001-Disable-http2.patch
rename to meta/recipes-devtools/cargo/cargo-1.47.0/0001-Disable-http2.patch
index 9794ec05f9..b08f7ac133 100644
@@ -1,4 +1,4 @@
-From 42e65192b6f7520b7a05924856e00600961f6758 Mon Sep 17 00:00:00 2001
+From 40802c3a42fab9cfcd27fda8d00e98f8cc30016a Mon Sep 17 00:00:00 2001
 From: Johan Anderholm <[email protected]>
 Date: Sun, 27 Jan 2019 10:19:00 +0100
 Subject: [PATCH] Disable http2
@@ -14,18 +14,18 @@ Upstream-Status: Inappropriate
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Cargo.toml b/Cargo.toml
-index c3fcacf5..bd6ec50b 100644
+index 95cea90c4..56211532f 100644
 --- a/Cargo.toml
 +++ b/Cargo.toml
-@@ -24,7 +24,7 @@ bytesize = "1.0"
- crates-io = { path = "src/crates-io", version = "0.25" }
- crossbeam-utils = "0.6"
+@@ -25,7 +25,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1.1" }
+ crates-io = { path = "crates/crates-io", version = "0.31.1" }
+ crossbeam-utils = "0.7"
  crypto-hash = "0.3.1"
--curl = { version = "0.4.21", features = ['http2'] }
-+curl = { version = "0.4.21" }
- curl-sys = "0.4.18"
- env_logger = "0.6.0"
- pretty_env_logger = { version = "0.3", optional = true }
+-curl = { version = "0.4.23", features = ["http2"] }
++curl = { version = "0.4.23" }
+ curl-sys = "0.4.22"
+ env_logger = "0.7.0"
+ pretty_env_logger = { version = "0.4", optional = true }
 -- 
-2.11.0
+2.28.0
 
meta/recipes-devtools/cargo/cargo-1.49.0/0001-Disable-http2.patch renamed from meta/recipes-devtools/cargo/cargo-1.34.2/0001-Disable-http2.patch +13 -11
similarity index 53%
rename from meta/recipes-devtools/cargo/cargo-1.34.2/0001-Disable-http2.patch
rename to meta/recipes-devtools/cargo/cargo-1.49.0/0001-Disable-http2.patch
index a44482a112..51f37d3b51 100644
@@ -1,4 +1,4 @@
-From 44cf21036646e4849e9f8566db7decb7da917394 Mon Sep 17 00:00:00 2001
+From 7f8a197af9c33d0575187663f796f882064136dc Mon Sep 17 00:00:00 2001
 From: Johan Anderholm <[email protected]>
 Date: Sun, 27 Jan 2019 10:19:00 +0100
 Subject: [PATCH] Disable http2
@@ -9,21 +9,23 @@ curl-native. As long as multiplexing is disabled in cargo this should
 be fine.
 
 Upstream-Status: Inappropriate
-
 ---
  Cargo.toml | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/Cargo.toml b/Cargo.toml
-index 8238380861d9..ced1defea459 100644
+index fde0a3188..a4a51939a 100644
 --- a/Cargo.toml
 +++ b/Cargo.toml
-@@ -24,7 +24,7 @@ bytesize = "1.0"
- crates-io = { path = "src/crates-io", version = "0.23" }
- crossbeam-utils = "0.6"
+@@ -25,7 +25,7 @@ cargo-platform = { path = "crates/cargo-platform", version = "0.1.1" }
+ crates-io = { path = "crates/crates-io", version = "0.31.1" }
+ crossbeam-utils = "0.8"
  crypto-hash = "0.3.1"
--curl = { version = "0.4.19", features = ['http2'] }
-+curl = { version = "0.4.19" }
- curl-sys = "0.4.15"
- env_logger = "0.6.0"
- pretty_env_logger = { version = "0.3", optional = true }
+-curl = { version = "0.4.23", features = ["http2"] }
++curl = { version = "0.4.23" }
+ curl-sys = "0.4.22"
+ env_logger = "0.8.1"
+ pretty_env_logger = { version = "0.4", optional = true }
+-- 
+2.28.0
+
meta/recipes-devtools/cargo/cargo.inc +13 -5
index 48012520d9..9645b90df6 100644
@@ -3,10 +3,12 @@ HOMEPAGE = "https://crates.io"
 LICENSE = "MIT | Apache-2.0"
 SECTION = "devel"
 
-DEPENDS = "openssl zlib libgit2 curl ca-certificates libssh2"
+DEPENDS = "openssl zlib curl ca-certificates libssh2"
 
 LIC_FILES_CHKSUM = " \
     file://LICENSE-MIT;md5=b377b220f43d747efdec40d69fcaa69d \
+    file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \
+    file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \
 "
 
 SRC_URI += "file://0001-Disable-http2.patch"
@@ -29,15 +31,21 @@ do_compile_prepend () {
 
 do_install () {
 	install -d "${D}${bindir}"
-	install -m 755 "${RUSTSRC}/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}"
+	install -m 755 "${B}/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}"
 }
 
+# Disabled due to incompatibility with libgit2 0.28.x (https://github.com/rust-lang/git2-rs/issues/458, https://bugs.gentoo.org/707746#c1)
+# as shipped by Yocto Dunfell.
+# According to https://github.com/rust-lang/git2-rs/issues/458#issuecomment-522567539, there are no compatibility guarantees between
+# libgit2-sys and arbitrary system libgit2 versions, so better keep this turned off.
+#export LIBGIT2_SYS_USE_PKG_CONFIG = "1"
+
 # Needed for pkg-config to be used
-export LIBGIT2_SYS_USE_PKG_CONFIG = "1"
 export LIBSSH2_SYS_USE_PKG_CONFIG = "1"
 
 BBCLASSEXTEND = "native"
 
-# When building cargo-native we don't have a built cargo to use so we must use
-# the snapshot to bootstrap the build of cargo
+# When building cargo-native we don't have cargo-native to use and depend on,
+# so we must use the locally set up snapshot to bootstrap the build.
+BASEDEPENDS_remove_class-native = "cargo-native"
 CARGO_class-native = "${WORKDIR}/${CARGO_SNAPSHOT}/bin/cargo"
meta/recipes-devtools/cargo/cargo_1.34.2.bb deleted +0 -8
deleted file mode 100644
index d79f958c6e..0000000000
@@ -1,8 +0,0 @@
-require recipes-devtools/rust/rust-source-${PV}.inc
-require recipes-devtools/rust/rust-snapshot-${PV}.inc
-require cargo.inc
-
-LIC_FILES_CHKSUM += " \
-    file://LICENSE-APACHE;md5=1836efb2eb779966696f473ee8540542 \
-    file://LICENSE-THIRD-PARTY;md5=892ea68b169e69cfe75097fc38a15b56 \
-"
meta/recipes-devtools/cargo/cargo_1.36.0.bb deleted +0 -8
deleted file mode 100644
index f048779aae..0000000000
@@ -1,8 +0,0 @@
-require recipes-devtools/rust/rust-source-${PV}.inc
-require recipes-devtools/rust/rust-snapshot-${PV}.inc
-require cargo.inc
-
-LIC_FILES_CHKSUM += " \
-    file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \
-    file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \
-"
meta/recipes-devtools/cargo/cargo_1.37.0.bb deleted +0 -8
deleted file mode 100644
index f048779aae..0000000000
@@ -1,8 +0,0 @@
-require recipes-devtools/rust/rust-source-${PV}.inc
-require recipes-devtools/rust/rust-snapshot-${PV}.inc
-require cargo.inc
-
-LIC_FILES_CHKSUM += " \
-    file://LICENSE-APACHE;md5=71b224ca933f0676e26d5c2e2271331c \
-    file://LICENSE-THIRD-PARTY;md5=f257ad009884cb88a3a87d6920e7180a \
-"
meta/recipes-devtools/cargo/cargo_1.47.0.bb new file +3 -0
new file mode 100644
index 0000000000..dd050a82a0
@@ -0,0 +1,3 @@
+require recipes-devtools/rust/rust-source-${PV}.inc
+require recipes-devtools/rust/rust-snapshot-${PV}.inc
+require cargo.inc
meta/recipes-devtools/cargo/cargo_1.49.0.bb new file +3 -0
new file mode 100644
index 0000000000..dd050a82a0
@@ -0,0 +1,3 @@
+require recipes-devtools/rust/rust-source-${PV}.inc
+require recipes-devtools/rust/rust-snapshot-${PV}.inc
+require cargo.inc
meta/recipes-devtools/rust/README-rust.md +3 -3
index 329d59ab7b..400baf700d 100644
@@ -13,7 +13,7 @@ This OpenEmbedded layer provides the rust compiler, tools for building packages
 ## What doesn't:
 
  - Using anything but x86_64 as the build environment
- - rust (built for target) issue #81
+ - rust (built for target) [issue #81](https://github.com/meta-rust/meta-rust/issues/81)
 
 ## What's untested:
 
@@ -27,7 +27,7 @@ rust packages do), then it's especially easy.  Otherwise you should probably
 get the code building in cargo first.
 
 Once your package builds in cargo, you can use
-[cargo-bitbake](https://github.com/cardoe/cargo-bitbake) to generate a bitbake
+[cargo-bitbake](https://github.com/meta-rust/cargo-bitbake) to generate a bitbake
 recipe for it.  This allows bitbake to fetch all the necessary dependent
 crates, as well as a pegged version of the crates.io index, to ensure maximum
 reproducibility.
@@ -39,7 +39,7 @@ contained within it
 
 ## Pitfalls
 
- - 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.
+ - 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](https://github.com/rust-lang/cargo/issues/3349).
 
 ## Dependencies
 
meta/recipes-devtools/rust/libstd-rs.inc +9 -0
index 5298c00706..1bf2dab0a5 100644
@@ -2,17 +2,26 @@ SUMMARY = "Rust standard libaries"
 HOMEPAGE = "http://www.rust-lang.org"
 SECTION = "devel"
 LICENSE = "MIT | Apache-2.0"
+LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
 
 RUSTLIB_DEP = ""
 inherit cargo
 
 DEPENDS_append_libc-musl = " libunwind"
+# rv32 does not have libunwind ported yet
+DEPENDS_remove_riscv32 = "libunwind"
+DEPENDS_remove_riscv64 = "libunwind"
+
+# Embed bitcode in order to allow compiling both with and without LTO
+RUSTFLAGS += "-Cembed-bitcode=yes"
 # Needed so cargo can find libbacktrace
 RUSTFLAGS += "-L ${STAGING_LIBDIR} -C link-arg=-Wl,-soname,libstd.so"
 
 S = "${RUSTSRC}/src/libstd"
 
+CARGO_FEATURES ?= "panic-unwind backtrace"
 CARGO_BUILD_FLAGS += "--features '${CARGO_FEATURES}'"
+CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
 
 do_compile_prepend () {
     export CARGO_TARGET_DIR="${B}"
meta/recipes-devtools/rust/libstd-rs_1.34.2.bb deleted +0 -8
deleted file mode 100644
index 69cb48ad07..0000000000
@@ -1,8 +0,0 @@
-require rust-source-${PV}.inc
-require libstd-rs.inc
-
-LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
-
-CARGO_FEATURES ?= "panic-unwind backtrace"
-
-CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/libstd-rs_1.36.0.bb deleted +0 -8
deleted file mode 100644
index 69cb48ad07..0000000000
@@ -1,8 +0,0 @@
-require rust-source-${PV}.inc
-require libstd-rs.inc
-
-LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
-
-CARGO_FEATURES ?= "panic-unwind backtrace"
-
-CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/libstd-rs_1.37.0.bb deleted +0 -8
deleted file mode 100644
index 69cb48ad07..0000000000
@@ -1,8 +0,0 @@
-require rust-source-${PV}.inc
-require libstd-rs.inc
-
-LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
-
-CARGO_FEATURES ?= "panic-unwind backtrace"
-
-CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
meta/recipes-devtools/rust/libstd-rs_1.47.0.bb new file +5 -0
new file mode 100644
index 0000000000..4398a22986
@@ -0,0 +1,5 @@
+require rust-source-${PV}.inc
+require libstd-rs.inc
+
+# libstd moved from src/libstd to library/std in 1.47+
+S = "${RUSTSRC}/library/std"
meta/recipes-devtools/rust/libstd-rs_1.49.0.bb new file +5 -0
new file mode 100644
index 0000000000..4398a22986
@@ -0,0 +1,5 @@
+require rust-source-${PV}.inc
+require libstd-rs.inc
+
+# libstd moved from src/libstd to library/std in 1.47+
+S = "${RUSTSRC}/library/std"
meta/recipes-devtools/rust/rust-cross.inc +19 -0
index 4869b85c03..b3698cdb20 100644
@@ -1,6 +1,25 @@
 require rust.inc
 inherit cross
 
+python do_rust_gen_targets () {
+    wd = d.getVar('WORKDIR') + '/targets/'
+    # It is important 'TARGET' is last here so that it overrides our less
+    # informed choices for BUILD & HOST if TARGET happens to be the same as
+    # either of them.
+    for thing in ['BUILD', 'HOST', 'TARGET']:
+        bb.debug(1, "rust_gen_target for " + thing)
+        features = ""
+        cpu = "generic"
+        arch = d.getVar('{}_ARCH'.format(thing))
+        if thing is "TARGET":
+            # arm and armv7 have different targets in llvm
+            if arch == "arm" and target_is_armv7(d):
+                arch = 'armv7'
+            features = d.getVar('TARGET_LLVM_FEATURES') or ""
+            cpu = d.getVar('TARGET_LLVM_CPU')
+        rust_gen_target(d, thing, wd, features, cpu, arch)
+}
+
 # Otherwise we'll depend on what we provide
 INHIBIT_DEFAULT_RUST_DEPS = "1"
 
meta/recipes-devtools/rust/rust-cross_1.47.0.bb renamed from meta/recipes-devtools/rust/rust-cross_1.34.2.bb +0 -1
similarity index 98%
rename from meta/recipes-devtools/rust/rust-cross_1.34.2.bb
rename to meta/recipes-devtools/rust/rust-cross_1.47.0.bb
index bb92b99ccc..ddc25d36b5 100644
@@ -1,3 +1,2 @@
 require rust-cross.inc
 require rust-source-${PV}.inc
-
meta/recipes-devtools/rust/rust-cross_1.49.0.bb renamed from meta/recipes-devtools/rust/rust-cross_1.36.0.bb +0 -1
similarity index 98%
rename from meta/recipes-devtools/rust/rust-cross_1.36.0.bb
rename to meta/recipes-devtools/rust/rust-cross_1.49.0.bb
index bb92b99ccc..ddc25d36b5 100644
@@ -1,3 +1,2 @@
 require rust-cross.inc
 require rust-source-${PV}.inc
-
meta/recipes-devtools/rust/rust-llvm.inc +9 -7
index b4bef3875c..53ae87ed0f 100644
@@ -1,13 +1,13 @@
 SUMMARY = "LLVM compiler framework (packaged with rust)"
-LICENSE = "NCSA"
+LICENSE ?= "Apache-2.0-with-LLVM-exception"
 
 SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch"
 
 S = "${RUSTSRC}/src/llvm-project/llvm"
 
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa"
+LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
 
-inherit cmake pythonnative
+inherit cmake python3native
 
 DEPENDS += "ninja-native rust-llvm-native"
 
@@ -19,7 +19,7 @@ LLVM_DIR = "llvm${LLVM_RELEASE}"
 
 EXTRA_OECMAKE = " \
     -DCMAKE_BUILD_TYPE=Release \
-    -DLLVM_TARGETS_TO_BUILD='X86;ARM;AArch64;PowerPC;Mips' \
+    -DLLVM_TARGETS_TO_BUILD='ARM;AArch64;Mips;PowerPC;RISCV;X86' \
     -DLLVM_BUILD_DOCS=OFF \
     -DLLVM_ENABLE_TERMINFO=OFF \
     -DLLVM_ENABLE_ZLIB=OFF \
@@ -44,9 +44,11 @@ EXTRA_OECMAKE_append_class-target = "\
 # provide almost no value. If you really need them then override this
 INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
 
-do_install_append_class-target() {
-    # Disable checks on the native tools, since these should came from the native recipe
-    sed -i -e 's/\(.*APPEND.*_IMPORT_CHECK_FILES_FOR_.*{_IMPORT_PREFIX}\/bin\/.*\)/#\1/' ${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake
+export YOCTO_ALTERNATE_EXE_PATH = "${STAGING_LIBDIR}/llvm-rust/bin/llvm-config"
+
+do_install_append () {
+    # we don't need any of this stuff to build Rust
+    rm -rf "${D}/usr/lib/cmake"
 }
 
 PACKAGES =+ "${PN}-bugpointpasses ${PN}-llvmhello ${PN}-liblto"
meta/recipes-devtools/rust/rust-llvm_1.34.2.bb deleted +0 -16
deleted file mode 100644
index d41fa28477..0000000000
@@ -1,16 +0,0 @@
-require rust-source-${PV}.inc
-require rust-llvm.inc
-
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648"
-
-do_install_prepend () {
-	# the install does a sed on this without installing the file
-	# we don't need it for anything
-	mkdir -p "${D}/usr/share/llvm/cmake"
-	touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake"
-}
-
-do_install_append () {
-	# we don't need any of this stuff to build Rust
-	rm -rf "${D}/usr/lib/cmake"
-}
meta/recipes-devtools/rust/rust-llvm_1.36.0.bb deleted +0 -16
deleted file mode 100644
index d41fa28477..0000000000
@@ -1,16 +0,0 @@
-require rust-source-${PV}.inc
-require rust-llvm.inc
-
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648"
-
-do_install_prepend () {
-	# the install does a sed on this without installing the file
-	# we don't need it for anything
-	mkdir -p "${D}/usr/share/llvm/cmake"
-	touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake"
-}
-
-do_install_append () {
-	# we don't need any of this stuff to build Rust
-	rm -rf "${D}/usr/lib/cmake"
-}
meta/recipes-devtools/rust/rust-llvm_1.37.0.bb deleted +0 -16
deleted file mode 100644
index d41fa28477..0000000000
@@ -1,16 +0,0 @@
-require rust-source-${PV}.inc
-require rust-llvm.inc
-
-LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c6b766a4e85dd28301eeed54a6684648"
-
-do_install_prepend () {
-	# the install does a sed on this without installing the file
-	# we don't need it for anything
-	mkdir -p "${D}/usr/share/llvm/cmake"
-	touch "${D}/usr/share/llvm/cmake/LLVMExports-noconfig.cmake"
-}
-
-do_install_append () {
-	# we don't need any of this stuff to build Rust
-	rm -rf "${D}/usr/lib/cmake"
-}
meta/recipes-devtools/rust/rust-llvm_1.47.0.bb renamed from meta/recipes-devtools/rust/rust-cross_1.37.0.bb +1 -2
similarity index 55%
rename from meta/recipes-devtools/rust/rust-cross_1.37.0.bb
rename to meta/recipes-devtools/rust/rust-llvm_1.47.0.bb
index bb92b99ccc..1dca22bd60 100644
@@ -1,3 +1,2 @@
-require rust-cross.inc
 require rust-source-${PV}.inc
-
+require rust-llvm.inc
meta/recipes-devtools/rust/rust-llvm_1.49.0.bb new file +2 -0
new file mode 100644
index 0000000000..1dca22bd60
@@ -0,0 +1,2 @@
+require rust-source-${PV}.inc
+require rust-llvm.inc
meta/recipes-devtools/rust/rust-snapshot-1.34.2.inc deleted +0 -24
deleted file mode 100644
index d0209bb864..0000000000
@@ -1,24 +0,0 @@
-## This is information on the rust-snapshot (binary) used to build our current release.
-## snapshot info is taken from rust/src/stage0.txt
-## TODO: find a way to add additional SRC_URIs based on the contents of an
-##       earlier SRC_URI.
-RS_VERSION = "1.33.0"
-
-RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-CARGO_VERSION = "0.34.0"
-CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-
-SRC_URI += " \
-	https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.gz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.gz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.gz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	"
-
-# TODO: Add hashes for other architecture toolchains as well. Make a script?
-SRC_URI[rustc-snapshot-x86_64.md5sum] = "c1ec989c1965dce754dda1e54274a68c"
-SRC_URI[rustc-snapshot-x86_64.sha256sum] = "54a342f718b712d8a17fd7878ebd37d22a82ebc70b59c421168cd4153fd04c2b"
-SRC_URI[rust-std-snapshot-x86_64.md5sum] = "d573c5bd3a965c973734c1606968a91e"
-SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "661c2ba717ae1502f002b4c6e7aeb8941685c7ea8fe7ac26ed9ede26f615b7af"
-SRC_URI[cargo-snapshot-x86_64.md5sum] = "de0e635afa9bf495cefecea476bfce36"
-SRC_URI[cargo-snapshot-x86_64.sha256sum] = "4795ae5ca3bb8c7c83ca338676bb02b670efa1eb474e346284b629dc872bcce8"
meta/recipes-devtools/rust/rust-snapshot-1.36.0.inc deleted +0 -24
deleted file mode 100644
index e4b6813e84..0000000000
@@ -1,24 +0,0 @@
-## This is information on the rust-snapshot (binary) used to build our current release.
-## snapshot info is taken from rust/src/stage0.txt
-## TODO: find a way to add additional SRC_URIs based on the contents of an
-##       earlier SRC_URI.
-RS_VERSION = "1.35.0"
-
-RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-CARGO_VERSION = "0.36.0"
-CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-
-SRC_URI += " \
-	https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	"
-
-# TODO: Add hashes for other architecture toolchains as well. Make a script?
-SRC_URI[rustc-snapshot-x86_64.md5sum] = "47ea78f6b3f68e30f24b9c94e465d6bd"
-SRC_URI[rustc-snapshot-x86_64.sha256sum] = "5d6dc216ba429ddf3a1657e70f3e5e380549b546fe56de897677a11d72aa4e07"
-SRC_URI[rust-std-snapshot-x86_64.md5sum] = "348ec23ca8e47fc65079bc80e63cca5f"
-SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "ccff05d0e2d88499505b10f8e33e8b1645df057f918edc81f8acb0fcee9f90b2"
-SRC_URI[cargo-snapshot-x86_64.md5sum] = "93a375e771f3d9b3a139e612dd4730ee"
-SRC_URI[cargo-snapshot-x86_64.sha256sum] = "ab5a6ff1947463dbd2477ca5dac2012494dae821112098ae0c54add652adfdc3"
meta/recipes-devtools/rust/rust-snapshot-1.37.0.inc deleted +0 -24
deleted file mode 100644
index 8d4c1801ed..0000000000
@@ -1,24 +0,0 @@
-## This is information on the rust-snapshot (binary) used to build our current release.
-## snapshot info is taken from rust/src/stage0.txt
-## TODO: find a way to add additional SRC_URIs based on the contents of an
-##       earlier SRC_URI.
-RS_VERSION = "1.36.0"
-
-RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-CARGO_VERSION = "0.37.0"
-CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
-
-SRC_URI += " \
-	https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
-	"
-
-# TODO: Add hashes for other architecture toolchains as well. Make a script?
-SRC_URI[rustc-snapshot-x86_64.md5sum] = "ec27794c94cc1df1a0a69f7244a09176"
-SRC_URI[rustc-snapshot-x86_64.sha256sum] = "fff0158da6f5af2a89936dc3e0c361077c06c2983eb310615e02f81ebbde1416"
-SRC_URI[rust-std-snapshot-x86_64.md5sum] = "b71a6fd6f44527c3bf09584e89ad8958"
-SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "ce8e12684b568a8a4f7d346a743383429849cf3f028f5712ad3d3e31590c8db3"
-SRC_URI[cargo-snapshot-x86_64.md5sum] = "8c661276a0da7a1aa48affbe33b347e6"
-SRC_URI[cargo-snapshot-x86_64.sha256sum] = "d20fa121951339d5492cf8862f8a7af59efc99d18f3c27b95ab6d4658b6a7d67"
meta/recipes-devtools/rust/rust-snapshot-1.47.0.inc new file +13 -0
new file mode 100644
index 0000000000..cdd52f6d3a
@@ -0,0 +1,13 @@
+require rust-snapshot.inc
+
+## This is information on the rust-snapshot (binary) used to build our current release.
+## snapshot info is taken from rust/src/stage0.txt
+## TODO: find a way to add additional SRC_URIs based on the contents of an
+##       earlier SRC_URI.
+RS_VERSION = "1.46.0"
+CARGO_VERSION = "0.47.0"
+
+# TODO: Add hashes for other architecture toolchains as well. Make a script?
+SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "e631d80cb03539769c041ee4566e94e36a271d4b3cdd149e1447d1f77fda979c"
+SRC_URI[rustc-snapshot-x86_64.sha256sum] = "6edcec5367f9fcaee78cbcabfb1f6757fa95d7fd2c0853913223fe20ad534f12"
+SRC_URI[cargo-snapshot-x86_64.sha256sum] = "9da5c4888c6025fa174eaef330337e49666ca9562f876a34d40c03a80d432b8d"
meta/recipes-devtools/rust/rust-snapshot-1.49.0.inc new file +13 -0
new file mode 100644
index 0000000000..18f2b7c25e
@@ -0,0 +1,13 @@
+require rust-snapshot.inc
+
+## This is information on the rust-snapshot (binary) used to build our current release.
+## snapshot info is taken from rust/src/stage0.txt
+## TODO: find a way to add additional SRC_URIs based on the contents of an
+##       earlier SRC_URI.
+RS_VERSION = "1.48.0"
+CARGO_VERSION = "1.48.0"
+
+# TODO: Add hashes for other architecture toolchains as well. Make a script?
+SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "1c00a6a0dabbf6290728b09f9307d9fa6cc985487f727075c68acd4a600ef3f8"
+SRC_URI[rustc-snapshot-x86_64.sha256sum] = "fc4d292a52cbb6b84fb9f065d0d7596064a9b957381d639d5a750d6e2bf02483"
+SRC_URI[cargo-snapshot-x86_64.sha256sum] = "b11d595581e2580c069b5039214e1031a0e4f87ff6490ac39f92f77857e37055"
meta/recipes-devtools/rust/rust-snapshot.inc new file +9 -0
new file mode 100644
index 0000000000..79d03afd1b
@@ -0,0 +1,9 @@
+SRC_URI += " \
+    https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+    https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+    https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${BUILD_ARCH};subdir=rust-snapshot-components \
+"
+
+RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
+CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${BUILD_ARCH}-unknown-linux-gnu"
meta/recipes-devtools/rust/rust-source-1.34.2.inc deleted +0 -11
deleted file mode 100644
index 5c83f6f000..0000000000
@@ -1,11 +0,0 @@
-SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust"
-
-SRC_URI[rust.md5sum] = "7c85e6a60dda740295f7e004a1fb15e1"
-SRC_URI[rust.sha256sum] = "c69a4a85a1c464368597df8878cb9e1121aae93e215616d45ad7d23af3052f56"
-
-# later versions of rust change the directory that they unextract to
-RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
-# set this as our default
-S = "${RUSTSRC}"
-
-LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust-source-1.36.0.inc deleted +0 -11
deleted file mode 100644
index 1a1d07c72f..0000000000
@@ -1,11 +0,0 @@
-SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust"
-
-SRC_URI[rust.md5sum] = "78ffc0b029aaed216b45c3fe24747d46"
-SRC_URI[rust.sha256sum] = "f51645b9f787af4a5d94db17f6af39db0c55980ed24fe366cad55b57900f8f2d"
-
-# later versions of rust change the directory that they unextract to
-RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
-# set this as our default
-S = "${RUSTSRC}"
-
-LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust-source-1.37.0.inc deleted +0 -11
deleted file mode 100644
index 0169cd3fbd..0000000000
@@ -1,11 +0,0 @@
-SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust"
-
-SRC_URI[rust.md5sum] = "ee6300b1d7e5767115492915c4c0d8ef"
-SRC_URI[rust.sha256sum] = "10abffac50a729cf74cef6dd03193a2f4647541bd19ee9281be9e5b12ca8cdfd"
-
-# later versions of rust change the directory that they unextract to
-RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
-# set this as our default
-S = "${RUSTSRC}"
-
-LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0"
meta/recipes-devtools/rust/rust-source-1.47.0.inc new file +3 -0
new file mode 100644
index 0000000000..6bf6e726b1
@@ -0,0 +1,3 @@
+require rust-source.inc
+
+SRC_URI[rust.sha256sum] = "ec2c81d2d34890486094a6407589be96161e4e301c238332d32c6dbae4f38ea2"
meta/recipes-devtools/rust/rust-source-1.49.0.inc new file +3 -0
new file mode 100644
index 0000000000..645fa2819b
@@ -0,0 +1,3 @@
+require rust-source.inc
+
+SRC_URI[rust.sha256sum] = "ebe910edc824a0a037a10be443446a0511923ba8342fa3c331ec8a22481d5d15"
meta/recipes-devtools/rust/rust-source.inc new file +3 -0
new file mode 100644
index 0000000000..52502fb49f
@@ -0,0 +1,3 @@
+SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust"
+
+RUSTSRC = "${WORKDIR}/rustc-${PV}-src"
meta/recipes-devtools/rust/rust-target.inc renamed from meta/recipes-devtools/rust/rust_1.36.0.bb +0 -2
similarity index 82%
rename from meta/recipes-devtools/rust/rust_1.36.0.bb
rename to meta/recipes-devtools/rust/rust-target.inc
index c7f9f4fd87..0a5b127f3c 100644
@@ -1,6 +1,4 @@
 require rust.inc
-require rust-source-${PV}.inc
-require rust-snapshot-${PV}.inc
 
 DEPENDS += "rust-llvm (=${PV})"
 
meta/recipes-devtools/rust/rust.inc +60 -57

270 lines not on this page · raw message

meta/recipes-devtools/rust/rust/0001-rustc_target-Fix-dash-vs-underscore-mismatches-in-op.patch new file +75 -0

75 lines not on this page · raw message

meta/recipes-devtools/rust/rust_1.34.2.bb deleted +0 -12
deleted file mode 100644
index c7f9f4fd87..0000000000
@@ -1,12 +0,0 @@
-require rust.inc
-require rust-source-${PV}.inc
-require rust-snapshot-${PV}.inc
-
-DEPENDS += "rust-llvm (=${PV})"
-
-# Otherwise we'll depend on what we provide
-INHIBIT_DEFAULT_RUST_DEPS_class-native = "1"
-# We don't need to depend on gcc-native because yocto assumes it exists
-PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust"
-
-BBCLASSEXTEND = "native"
meta/recipes-devtools/rust/rust_1.37.0.bb deleted +0 -12
deleted file mode 100644
index c7f9f4fd87..0000000000
@@ -1,12 +0,0 @@
-require rust.inc
-require rust-source-${PV}.inc
-require rust-snapshot-${PV}.inc
-
-DEPENDS += "rust-llvm (=${PV})"
-
-# Otherwise we'll depend on what we provide
-INHIBIT_DEFAULT_RUST_DEPS_class-native = "1"
-# We don't need to depend on gcc-native because yocto assumes it exists
-PROVIDES_class-native = "virtual/${TARGET_PREFIX}rust"
-
-BBCLASSEXTEND = "native"
meta/recipes-devtools/rust/rust_1.47.0.bb new file +9 -0
new file mode 100644
index 0000000000..894f715e16
@@ -0,0 +1,9 @@
+require rust-target.inc
+require rust-source-${PV}.inc
+require rust-snapshot-${PV}.inc
+
+# The default behaviour of x.py changed in 1.47+ so now we need to
+# explicitly ask for the stage 2 compiler to be assembled.
+do_compile () {
+    rust_runx build --stage 2 src/rustc
+}
meta/recipes-devtools/rust/rust_1.49.0.bb new file +15 -0
new file mode 100644
index 0000000000..96d625f6c3
@@ -0,0 +1,15 @@
+require rust-target.inc
+require rust-source-${PV}.inc
+require rust-snapshot-${PV}.inc
+
+SRC_URI += "\
+    file://0001-rustc_target-Fix-dash-vs-underscore-mismatches-in-op.patch \
+    "
+
+do_compile () {
+    rust_runx build --stage 2
+}
+
+rust_do_install() {
+    rust_runx install
+}
meta/recipes-example/rust-hello-world/rust-hello-world/0001-enable-LTO.patch new file +23 -0
new file mode 100644
index 0000000000..56ef9e73e6
@@ -0,0 +1,23 @@
+From fa40b874f6470ec11a8fd7b0c9909d0cdd2d6feb Mon Sep 17 00:00:00 2001
+From: Dan Callaghan <[email protected]>
+Date: Fri, 5 Feb 2021 08:56:34 +1000
+Subject: [PATCH] enable LTO
+
+---
+ Cargo.toml | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/Cargo.toml b/Cargo.toml
+index 7a2f6c8..cdb6b5d 100644
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -3,3 +3,6 @@
+ name = "rust-hello-world"
+ version = "0.0.1"
+ authors = ["Cody P Schafer <[email protected]>"]
++
++[profile.release]
++lto = true
+-- 
+2.28.0
+
meta/recipes-example/rust-hello-world/rust-hello-world_git.bb +6 -2
index ba8854849d..c29eac34e5 100644
@@ -1,11 +1,15 @@
 inherit cargo
 
-SRC_URI = "git://github.com/jmesmon/rust-hello-world.git;protocol=https"
+SRC_URI = "git://github.com/meta-rust/rust-hello-world.git;protocol=https"
 SRCREV="e0fa23f1a3cb1eb1407165bd2fc36d2f6e6ad728"
 LIC_FILES_CHKSUM="file://COPYRIGHT;md5=e6b2207ac3740d2d01141c49208c2147"
 
+SRC_URI += "\
+    file://0001-enable-LTO.patch \
+    "
+
 SUMMARY = "Hello World by Cargo for Rust"
-HOMEPAGE = "https://github.com/jmesmon/rust-hello-world"
+HOMEPAGE = "https://github.com/meta-rust/rust-hello-world"
 LICENSE = "MIT | Apache-2.0"
 
 S = "${WORKDIR}/git"
meta/recipes-example/rustfmt/rustfmt_0.8.0.bb deleted +0 -67

67 lines not on this page · raw message

meta/recipes-example/rustfmt/rustfmt_1.4.2.bb new file +171 -0

171 lines not on this page · raw message

Signature · 1 line
2.27.0
#5 lore raw

PATCH 4/7 rust: update the README to conform to being in oe-core

In reply to Randy MacLeod
---
 meta/recipes-devtools/rust/README-rust.md | 23 ++++++-----------------
 1 file changed, 6 insertions(+), 17 deletions(-)
meta/recipes-devtools/rust/README-rust.md +6 -17
index 400baf700d..68540b478d 100644
@@ -1,7 +1,7 @@
 ## Introduction
 
-This OpenEmbedded layer provides the rust compiler, tools for building packages
-(cargo), and a few example projects.
+This provides the Rust compiler, tools for building packages (cargo), and 
+a few example projects.
 
 ## What works:
 
@@ -12,7 +12,7 @@ This OpenEmbedded layer provides the rust compiler, tools for building packages
 
 ## What doesn't:
 
- - Using anything but x86_64 as the build environment
+ - Using anything but x86_64 or arm64 as the build environment
  - rust (built for target) [issue #81](https://github.com/meta-rust/meta-rust/issues/81)
 
 ## What's untested:
@@ -24,13 +24,14 @@ This OpenEmbedded layer provides the rust compiler, tools for building packages
 When building a rust package in bitbake, it's usually easiest to build with
 cargo using cargo.bbclass.  If the package already has a Cargo.toml file (most
 rust packages do), then it's especially easy.  Otherwise you should probably
-get the code building in cargo first.
+get the code building in cargo first. 
 
 Once your package builds in cargo, you can use
 [cargo-bitbake](https://github.com/meta-rust/cargo-bitbake) to generate a bitbake
 recipe for it.  This allows bitbake to fetch all the necessary dependent
 crates, as well as a pegged version of the crates.io index, to ensure maximum
-reproducibility.
+reproducibility. Once the Rust SDK support is added to oe-core, cargo-bitbake
+may also be added to the SDK.
 
 NOTE: You will have to edit the generated recipe based on the comments
 contained within it
@@ -51,18 +52,6 @@ On the target:
  - Any `-sys` packages your project might need must have RDEPENDs for
  the native library.
 
-## Maintainer(s) & Patch policy
-
-Open a Pull Request.
-
-The 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.
-
-All new patches against rust, rust-llvm, and cargo must have referenced
-upstream issues or PRs opened or an explanation why the patch cannot be
-upstreamed. This cooresponds to the OpenEmbedded policy for other meta layers.
-
-More info can be seen on the wiki.
-
 ## Copyright
 
 MIT OR Apache-2.0 - Same as rust
Signature · 1 line
2.27.0
#6 lore raw

PATCH 5/7 rust: remove container build scripts used by meta-rust

In reply to Randy MacLeod

Remove:
scripts/build.sh
scripts/cleanup-env.sh
scripts/containerize.sh
scripts/fetch.sh
scripts/publish-build-cache.sh
scripts/setup-env.sh
since they are only used to do container based builds for meta-rust.

---
 scripts/build.sh               |  19 ------
 scripts/cleanup-env.sh         |  14 -----
 scripts/containerize.sh        |  54 -----------------
 scripts/fetch.sh               | 103 ---------------------------------
 scripts/publish-build-cache.sh |  13 -----
 scripts/setup-env.sh           |  12 ----
 6 files changed, 215 deletions(-)
 delete mode 100755 scripts/build.sh
 delete mode 100755 scripts/cleanup-env.sh
 delete mode 100755 scripts/containerize.sh
 delete mode 100755 scripts/fetch.sh
 delete mode 100755 scripts/publish-build-cache.sh
 delete mode 100755 scripts/setup-env.sh
scripts/build.sh deleted +0 -19
deleted file mode 100755
index cfff7c1ba8..0000000000
@@ -1,19 +0,0 @@
-#!/bin/bash
-
-# Grab the MACHINE from the environment; otherwise, set it to a sane default
-export MACHINE="${MACHINE-qemux86-64}"
-
-# What to build
-BUILD_TARGETS="\
-    rustfmt \
-    "
-
-die() {
-    echo "$*" >&2
-    exit 1
-}
-
-rm -f build/conf/bblayers.conf || die "failed to nuke bblayers.conf"
-rm -f build/conf/local.conf || die "failed to nuke local.conf"
-
-./scripts/containerize.sh bitbake ${BUILD_TARGETS} || die "failed to build"
scripts/cleanup-env.sh deleted +0 -14
deleted file mode 100755
index d2d57295b2..0000000000
@@ -1,14 +0,0 @@
-#!/bin/bash -x
-
-sudo fuser -m `pwd`/build
-
-# Only attempt to unmount if the directory is already mounted
-if mountpoint -q `pwd`/build; then
-    sudo umount `pwd`/build
-fi
-
-sudo fuser -m `pwd`/build
-
-ps -ef
-
-exit 0
scripts/containerize.sh deleted +0 -54

54 lines not on this page · raw message

scripts/fetch.sh deleted +0 -103

103 lines not on this page · raw message

scripts/publish-build-cache.sh deleted +0 -13
deleted file mode 100755
index e3a0a1829a..0000000000
@@ -1,13 +0,0 @@
-#!/bin/bash -x
-
-if [[ $# -lt 1 ]]; then
-    echo "No Yocto branch specified, defaulting to master"
-    echo "To change this pass a Yocto branch name as an argument to this script"
-fi
-branch=${1-master}
-
-rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/downloads [email protected]:/srv/yocto-cache/
-
-rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress build/sstate-cache [email protected]:/srv/yocto-cache/${branch}/
-
-exit 0
scripts/setup-env.sh deleted +0 -12
deleted file mode 100755
index dbed06111b..0000000000
@@ -1,12 +0,0 @@
-#!/bin/bash -e
-
-mkdir -p build
-
-total_mem=`grep MemTotal /proc/meminfo | awk '{print $2}'`
-
-# Only have the slaves with large amounts of RAM mount the tmpfs
-if [ "$total_mem" -ge "67108864" ]; then
-    sudo mount -t tmpfs -o size=64G,mode=755,uid=${UID} tmpfs build
-fi
-
-exit 0
Signature · 1 line
2.27.0
#7 lore raw

PATCH 6/7 cargo/rust/rustfmt: exclude from world

In reply to Randy MacLeod

cargo, rust, and rustfmt can't be built for the targets yet so exclude them from world builds.

---
 meta/recipes-devtools/cargo/cargo.inc         | 1 +
 meta/recipes-example/rustfmt/rustfmt_1.4.2.bb | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
meta/recipes-devtools/cargo/cargo.inc +1 -0
index 9645b90df6..5118cc1ab1 100644
@@ -15,6 +15,7 @@ SRC_URI += "file://0001-Disable-http2.patch"
 
 S = "${RUSTSRC}/src/tools/cargo"
 CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
+EXCLUDE_FROM_WORLD = "1"
 
 inherit cargo
 
meta/recipes-example/rustfmt/rustfmt_1.4.2.bb +1 -1
index ecced49049..b7deb4097c 100644
@@ -11,7 +11,7 @@ SRC_URI += "git://github.com/rust-lang/rustfmt/;protocol=https;nobranch=1"
 SRCREV = "aeb3496f31a0dfa90fc511520d2023634e885260"
 S = "${WORKDIR}/git"
 CARGO_SRC_DIR = ""
-
+EXCLUDE_FROM_WORLD = "1"
 
 # please note if you have entries that do not begin with crate://
 # you must change them to how that package can be fetched
Signature · 1 line
2.27.0
#8 lore raw

PATCH 7/7 maintainers: Add myself as maintainer for rust pkgs

In reply to Randy MacLeod

I'm willing to do the rust package maintenance but if anyone else wants to sign up, that would be welcome.

---
 meta/conf/distro/include/maintainers.inc | 7 +++++++
 1 file changed, 7 insertions(+)
meta/conf/distro/include/maintainers.inc +7 -0
index 3d8e3d5de0..bb76d5412a 100644
@@ -89,6 +89,7 @@ RECIPE_MAINTAINER_pn-busybox-inittab = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER_pn-bzip2 = "Denys Dmytriyenko <[email protected]>"
 RECIPE_MAINTAINER_pn-ca-certificates = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER_pn-cairo = "Anuj Mittal <[email protected]>"
+RECIPE_MAINTAINER_pn-cargo = "Randy MacLeod <[email protected]>"
 RECIPE_MAINTAINER_pn-cantarell-fonts = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER_pn-ccache = "Robert Yang <[email protected]>"
 RECIPE_MAINTAINER_pn-cdrtools-native = "Yi Zhao <[email protected]>"
@@ -382,6 +383,7 @@ RECIPE_MAINTAINER_pn-libsndfile1 = "Unassigned <[email protected]>"
 RECIPE_MAINTAINER_pn-libsolv = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER_pn-libsoup-2.4 = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER_pn-libssp-nonshared = "Khem Raj <[email protected]>"
+RECIPE_MAINTAINER_pn-libstd-rs = "Randy MacLeod <[email protected]>"
 RECIPE_MAINTAINER_pn-libtasn1 = "Anuj Mittal <[email protected]>"
 RECIPE_MAINTAINER_pn-libtest-needs-perl = "Tim Orling <[email protected]>"
 RECIPE_MAINTAINER_pn-libtheora = "Alexander Kanavin <[email protected]>"
@@ -649,6 +651,11 @@ RECIPE_MAINTAINER_pn-rsync = "Yi Zhao <[email protected]>"
 RECIPE_MAINTAINER_pn-rt-tests = "Alexander Kanavin <[email protected]>"
 RECIPE_MAINTAINER_pn-ruby = "Ross Burton <[email protected]>"
 RECIPE_MAINTAINER_pn-run-postinsts = "Ross Burton <[email protected]>"
+RECIPE_MAINTAINER_pn-rustc = "Randy MacLeod <[email protected]>"
+RECIPE_MAINTAINER_pn-rustfmt = "Randy MacLeod <[email protected]>"
+RECIPE_MAINTAINER_pn-rust-cross = "Randy MacLeod <[email protected]>"
+RECIPE_MAINTAINER_pn-rust-hello-world = "Randy MacLeod <[email protected]>"
+RECIPE_MAINTAINER_pn-rust-llvm = "Randy MacLeod <[email protected]>"
 RECIPE_MAINTAINER_pn-rxvt-unicode = "Armin Kuster <[email protected]>"
 RECIPE_MAINTAINER_pn-sato-screenshot = "Ross Burton <[email protected]>"
 RECIPE_MAINTAINER_pn-sbc = "Unassigned <[email protected]>"
Signature · 1 line
2.27.0
#9 lore raw
In reply to Randy MacLeod
Quoted 22 lines · Randy MacLeod

Added or updated these commits:

   86109491bc maintainers: Add myself as maintainer for rust pkgs
   ...
   b411e322b3 rust: remove container build scripts used by meta-rust c646d47ebc rust: update the README to conform to being in oe-core e19d823567 meta-rust: merge commits

The last commit update was just squashing a new commit from meta-rust:
   f8b9103 Remove checks for Rust versions we don't build anymore.

To Do List
==========

1) cargo-bitbake - the README suggest adding this using desktop cargo but once we get the SDK merged, it should be added there. Someone suggested using devtool for this rather than cargo-bitbake.

2) Fix the SDK libcrypto, libstdc++ glibc-2.33 problem. I'm running a git bisect using poky, meta-oe/master, meta-rust+SDK patches.

Quoted 6 lines

3) Add a test case to either:
   - just build rust-hello-world or
   - run it in qemu

N) Fix *some* of the remaining bugs in:
      https://github.com/meta-rust/meta-rust/issues

I put this into master-next to see how it looked. The build hasn't completed yet but so far:

rust-native doesn't build on debian8:
https://autobuilder.yoctoproject.org/typhoon/#/builders/116/builds/40/steps/13/logs/stdio

oe-selftest:
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1855/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/1887
(others will likely show the same issues)

which is basically three tests failing:

oe-selftest -r sstatetests.SStateTests.test_sstate_noop_samesigs oe-selftest -r sstatetests.SStateTests.test_sstate_sametune_samesigs oe-selftest -r distrodata.Distrodata.test_maintainers

so the maintainers entries aren't quite right which is easy to fix and the sstate signatures aren't behaving correctly which may be more fun, depends what is wrong. Those tests explain they're broken (which is what we have the tests for) but more investigation would be needed to understand how/why.

Cheers,

Richard

#10 lore raw
Quoted 41 lines · Richard Purdie
Quoted 22 lines · Randy MacLeod

Added or updated these commits:

   86109491bc maintainers: Add myself as maintainer for rust pkgs
   ...
   b411e322b3 rust: remove container build scripts used by meta-rust c646d47ebc rust: update the README to conform to being in oe-core e19d823567 meta-rust: merge commits

The last commit update was just squashing a new commit from meta-rust:
   f8b9103 Remove checks for Rust versions we don't build anymore.

To Do List
==========

1) cargo-bitbake - the README suggest adding this using desktop cargo but once we get the SDK merged, it should be added there. Someone suggested using devtool for this rather than cargo-bitbake.

2) Fix the SDK libcrypto, libstdc++ glibc-2.33 problem. I'm running a git bisect using poky, meta-oe/master, meta-rust+SDK patches.

Quoted 6 lines

3) Add a test case to either:
   - just build rust-hello-world or
   - run it in qemu

N) Fix *some* of the remaining bugs in:
      https://github.com/meta-rust/meta-rust/issues

I put this into master-next to see how it looked. The build hasn't completed yet but so far:

rust-native doesn't build on debian8:
https://autobuilder.yoctoproject.org/typhoon/#/builders/116/builds/40/steps/13/logs/stdio

oe-selftest:
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1855/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/1887
(others will likely show the same issues)

Quoted 4 lines

which is basically three tests failing:

oe-selftest -r sstatetests.SStateTests.test_sstate_noop_samesigs oe-selftest -r sstatetests.SStateTests.test_sstate_sametune_samesigs

Not sure how to read these, but it might be fixed in upstream by:
https://github.com/meta-rust/meta-rust/commit/920328c8d8dd553e69309733d874229af4fa159f
the sstate-diff-machines.sh doesn't show with an issue for rust-native with this one applied.

And it did show an error without it:
=== Comparing signatures for task do_populate_sysroot.sigdata between qemux86 and qemuarm ===
ERROR: rust-native different signature for task do_populate_sysroot.sigdata between qemux86 and qemuarm
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: OE/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 46469, PID: 57036
Hash for dependent task rust/rust_1.49.0.bb:do_install:virtual:native changed from 7334d76a4757c1b893a8c2b8c85ada005788b3adeff5a33fe509c43f994d91c1 to 162ccf6462851630b0816fdb5fbe68f6b158b81f4ce3ed45ec4c1f258f93212c Unable to find matching sigdata for virtual:native:OE/meta-rust/recipes-devtools/rust/rust_1.49.0.bb:do_install with hashes 7334d76a4757c1b893a8c2b8c85ada005788b3adeff5a33fe509c43f994d91c1 or 162ccf6462851630b0816fdb5fbe68f6b158b81f4ce3ed45ec4c1f258f93212c

ERROR: 1 errors found in BUILD/sstate-diff/1614274412/signatures.qemuarm.do_populate_sysroot.sigdata.log

Quoted 20 lines

oe-selftest -r distrodata.Distrodata.test_maintainers

so the maintainers entries aren't quite right which is easy to fix and the sstate signatures aren't behaving correctly which may be more fun, depends what is wrong. Those tests explain they're broken (which is what we have the tests for) but more investigation would be needed to understand how/why.

Cheers,

Richard

#11 lore raw

Richard,
I won't have a v3 today.

I'm adding some of the people have worked on meta-rust as an FYI. Sorry that I haven't been CCing y'all earlier.

If you'd like to be dropped from the thread say so on list or to me privately.

One brief comment below but I haven't had much time to work on this today yet.

Quoted 57 lines · Martin Jansa
Quoted 40 lines · Richard Purdie
Quoted 22 lines · Randy MacLeod

Added or updated these commits:

   86109491bc maintainers: Add myself as maintainer for rust pkgs
   ...
   b411e322b3 rust: remove container build scripts used by meta-rust c646d47ebc rust: update the README to conform to being in oe-core e19d823567 meta-rust: merge commits

The last commit update was just squashing a new commit from meta-rust:
   f8b9103 Remove checks for Rust versions we don't build anymore.

To Do List
==========

1) cargo-bitbake - the README suggest adding this using desktop cargo but once we get the SDK merged, it should be added there. Someone suggested using devtool for this rather than cargo-bitbake.

2) Fix the SDK libcrypto, libstdc++ glibc-2.33 problem. I'm running a git bisect using poky, meta-oe/master, meta-rust+SDK patches.

Quoted 6 lines

3) Add a test case to either:
   - just build rust-hello-world or
   - run it in qemu

N) Fix *some* of the remaining bugs in:
      https://github.com/meta-rust/meta-rust/issues

I put this into master-next to see how it looked. The build hasn't completed yet but so far:

rust-native doesn't build on debian8:
https://autobuilder.yoctoproject.org/typhoon/#/builders/116/builds/40/steps/13/logs/stdio

oe-selftest:
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1855/steps/14/logs/stdio
https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/1887
(others will likely show the same issues)

Quoted 4 lines

which is basically three tests failing:

oe-selftest -r sstatetests.SStateTests.test_sstate_noop_samesigs oe-selftest -r sstatetests.SStateTests.test_sstate_sametune_samesigs

Not sure how to read these, but it might be fixed in upstream by:
https://github.com/meta-rust/meta-rust/commit/920328c8d8dd553e69309733d874229af4fa159f
the sstate-diff-machines.sh doesn't show with an issue for rust-native with this one applied.

And it did show an error without it:
=== Comparing signatures for task do_populate_sysroot.sigdata between qemux86 and qemuarm ===
ERROR: rust-native different signature for task do_populate_sysroot.sigdata between qemux86 and qemuarm
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: OE/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 46469, PID: 57036
Hash for dependent task rust/rust_1.49.0.bb:do_install:virtual:native changed from 7334d76a4757c1b893a8c2b8c85ada005788b3adeff5a33fe509c43f994d91c1 to 162ccf6462851630b0816fdb5fbe68f6b158b81f4ce3ed45ec4c1f258f93212c Unable to find matching sigdata for virtual:native:OE/meta-rust/recipes-devtools/rust/rust_1.49.0.bb:do_install with hashes 7334d76a4757c1b893a8c2b8c85ada005788b3adeff5a33fe509c43f994d91c1 or 162ccf6462851630b0816fdb5fbe68f6b158b81f4ce3ed45ec4c1f258f93212c

Quoted 1 line

ERROR: 1 errors found in BUILD/sstate-diff/1614274412/signatures.qemuarm.do_populate_sysroot.sigdata.log

I have that in my patchset locally:

commit e19d82356755a42a46221cb1a0fbacf6339560a1
Author: Randy MacLeod <[email protected]> Date:   Tue Feb 23 21:26:23 2021

    meta-rust: merge commits

    Merge most of:
      git log --oneline --no-merges 5cda04c..029f1ea with two layer.conf exceptions explained below.

    f8b9103 Remove checks for Rust versions we don't build anymore. 920328c rust-native shouldn't depend on TARGET variables

and I confirmed that it's in master-next.

../Randy

Quoted 19 lines
Quoted 19 lines

oe-selftest -r distrodata.Distrodata.test_maintainers

so the maintainers entries aren't quite right which is easy to fix and the sstate signatures aren't behaving correctly which may be more fun, depends what is wrong. Those tests explain they're broken (which is what we have the tests for) but more investigation would be needed to understand how/why.

Cheers,

Richard

Signature · 2 lines
# Randy MacLeod
# Wind River Linux
#12 lore raw
Quoted 10 lines · Randy MacLeod

Richard,
I won't have a v3 today.

I'm adding some of the people have worked on meta-rust as an FYI. Sorry that I haven't been CCing y'all earlier.

If you'd like to be dropped from the thread say so on list or to me privately.

One brief comment below but I haven't had much time to work on this today yet.

FYI, the Rust merge to oe-core was discussed at yesterday's monthly Yocto technical call and there was unanimous agreement that we would NOT merge Rust in 3.3 but rather wait until the next release.

We're waiting because there are still a few bugs to be resolved and so far only librsvg is blocked on the lack of Rust. When we uprev python-cryptography, that will also need Rust so we really need to get the known problems fixed in the coming weeks so that we can be ready to merge early in 3.4. That will leave us plenty of time discover any new issues and then have a well-tested release including Rust in the autumn of 2021.

I'll continue merging patches from meta-rust and publishing updates in my poky-contrib branches every week or so until 3.4 opens up.

Thanks everyone,
../Randy

Quoted 105 lines · Martin Jansa
Quoted 60 lines · Richard Purdie
Quoted 39 lines · Randy MacLeod
Quoted 22 lines

Added or updated these commits:

    86109491bc maintainers: Add myself as maintainer for rust pkgs
    ...
    b411e322b3 rust: remove container build scripts used by meta-rust c646d47ebc rust: update the README to conform to being in oe-core e19d823567 meta-rust: merge commits

The last commit update was just squashing a new commit from meta-rust:
    f8b9103 Remove checks for Rust versions we don't build anymore.

To Do List
==========

1) cargo-bitbake - the README suggest adding this using desktop cargo but once we get the SDK merged, it should be added there. Someone suggested using devtool for this rather than cargo-bitbake.

2) Fix the SDK libcrypto, libstdc++ glibc-2.33 problem. I'm running a git bisect using poky, meta-oe/master, meta-rust+SDK patches.

Quoted 6 lines

3) Add a test case to either:
    - just build rust-hello-world or
    - run it in qemu

N) Fix *some* of the remaining bugs in:
       https://github.com/meta-rust/meta-rust/issues

I put this into master-next to see how it looked. The build hasn't completed yet but so far:

rust-native doesn't build on debian8:
https://autobuilder.yoctoproject.org/typhoon/#/builders/116/builds/40/steps/13/logs/stdio

oe-selftest:
https://autobuilder.yoctoproject.org/typhoon/#/builders/86/builds/1855/steps/14/logs/stdio

Quoted 7 lines

https://autobuilder.yoctoproject.org/typhoon/#/builders/87/builds/1887
(others will likely show the same issues)

which is basically three tests failing:

oe-selftest -r sstatetests.SStateTests.test_sstate_noop_samesigs oe-selftest -r sstatetests.SStateTests.test_sstate_sametune_samesigs

Not sure how to read these, but it might be fixed in upstream by:
https://github.com/meta-rust/meta-rust/commit/920328c8d8dd553e69309733d874229af4fa159f

the sstate-diff-machines.sh doesn't show with an issue for rust-native with this one applied.

And it did show an error without it:
  === Comparing signatures for task do_populate_sysroot.sigdata between qemux86 and qemuarm ===
ERROR: rust-native different signature for task do_populate_sysroot.sigdata between qemux86 and qemuarm
NOTE: Starting bitbake server...
NOTE: Started PRServer with DBfile: OE/cache/prserv.sqlite3, IP: 127.0.0.1, PORT: 46469, PID: 57036
Hash for dependent task rust/rust_1.49.0.bb:do_install:virtual:native changed from 7334d76a4757c1b893a8c2b8c85ada005788b3adeff5a33fe509c43f994d91c1 to 162ccf6462851630b0816fdb5fbe68f6b158b81f4ce3ed45ec4c1f258f93212c Unable to find matching sigdata for virtual:native:OE/meta-rust/recipes-devtools/rust/rust_1.49.0.bb:do_install with hashes 7334d76a4757c1b893a8c2b8c85ada005788b3adeff5a33fe509c43f994d91c1 or 162ccf6462851630b0816fdb5fbe68f6b158b81f4ce3ed45ec4c1f258f93212c

Quoted 2 lines

ERROR: 1 errors found in BUILD/sstate-diff/1614274412/signatures.qemuarm.do_populate_sysroot.sigdata.log

I have that in my patchset locally:

commit e19d82356755a42a46221cb1a0fbacf6339560a1
Author: Randy MacLeod <[email protected]> Date:   Tue Feb 23 21:26:23 2021

    meta-rust: merge commits

    Merge most of:
      git log --oneline --no-merges 5cda04c..029f1ea with two layer.conf exceptions explained below.

    f8b9103 Remove checks for Rust versions we don't build anymore. 920328c rust-native shouldn't depend on TARGET variables

and I confirmed that it's in master-next.

../Randy

Quoted 19 lines
Quoted 19 lines

oe-selftest -r distrodata.Distrodata.test_maintainers

so the maintainers entries aren't quite right which is easy to fix and the sstate signatures aren't behaving correctly which may be more fun, depends what is wrong. Those tests explain they're broken (which is what we have the tests for) but more investigation would be needed to understand how/why.

Cheers,

Richard

Signature · 2 lines
# Randy MacLeod
# Wind River Linux
#13 lore raw
In reply to Richard Purdie
Quoted 3 lines · Richard Purdie

oe-selftest -r distrodata.Distrodata.test_maintainers

so the maintainers entries aren't quite right which is easy to fix and

Yes fixing the rust/cargo maintainers entries was easy.

Of course there here was a 'simple' libdnf/dnf problem remaining and what's odd is that it only shows up when using oe-core. Unable to find recipes for the following entries in maintainers.inc:
    dnf
    libdnf

These two recipes are not being returned from:
               for fn in tinfoil.all_recipe_files(variants=False):

Oddly enough, when using poky, there is no such error!

Have you seen such a problem before?
Any tips other than move onto the other issues?

../Randy

2021-03-01 20:35:52,119 -
oe-selftest - INFO - ======================================================================
2021-03-01 20:35:52,119 - oe-selftest - INFO - FAIL: test_maintainers (distrodata.Distrodata)
2021-03-01 20:35:52,119 - oe-selftest - INFO - ----------------------------------------------------------------------
2021-03-01 20:35:52,119 - oe-selftest - INFO - Traceback (most recent call last):

File "/home/src/distro/yocto/oe-core.git/meta/lib/oeqa/selftest/cases/distrodata.py", line 122, in test_maintainers self.fail("""
AssertionError:
Unable to find recipes for the following entries in maintainers.inc:
dnf
libdnf

Stdout:
WARNING: Duplicate inclusion for /home/src/distro/yocto/oe-core.git/meta/conf/distro/include/maintainers.inc in /home/src/distro/yocto/oe-core.git/meta/conf/distro/defaultsetup.conf
Loading cache...done.
Loaded 0 entries from dependency cache.
Parsing recipes...done.
Parsing of 850 .bb files complete (0 cached, 850 parsed). 1478 targets, 24 skipped, 0 masked, 0 errors.

Summary: There was 1 WARNING message shown.

The tinfoil is remarkably hard to bash (or strace) my head though! I'm learning how to do that albeit slowly.

Oh, I tried the obvious hammer approach of strace -f and see that libdnf_ is opened in both logs:

 grep libdnf_ /tmp/*log
/tmp/oe-selftest-dd-poky.log:46926 stat("/home/src/distro/yocto/poky.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", <unfinished ...> /tmp/oe-selftest-dd-poky.log:46926 stat("/home/src/distro/yocto/poky.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", <unfinished ...> /tmp/oe-selftest-dd-poky.log:46926 openat(AT_FDCWD, "/home/src/distro/yocto/poky.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", O_RDONLY|O_CLOEXEC <unfinished ...> /tmp/oe-selftest-dd-poky.log:46904 stat("/home/src/distro/yocto/poky.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", {st_mode=S_IFREG|0664, st_size=1945, ...}) = 0 /tmp/oe-selftest-dd-poky.log:46904 stat("/home/src/distro/yocto/poky.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", {st_mode=S_IFREG|0664, st_size=1945, ...}) = 0 /tmp/oe-selftest-dd-poky.log:46904 openat(AT_FDCWD, "/home/src/distro/yocto/poky.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", O_RDONLY|O_CLOEXEC) = 20 /tmp/oe-st-maint.log:13543 stat("/home/src/distro/yocto/oe-core.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", <unfinished ...> /tmp/oe-st-maint.log:13543 stat("/home/src/distro/yocto/oe-core.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", <unfinished ...> /tmp/oe-st-maint.log:13543 openat(AT_FDCWD, "/home/src/distro/yocto/oe-core.git/meta/recipes-devtools/libdnf/libdnf_0.55.2.bb", O_RDONLY|O_CLOEXEC <unfinished ...>

I also put a new recipe in the same dir as libdnf and of course the test complains about it.

Signature · 2 lines
# Randy MacLeod
# Wind River Linux