summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/rust/rust-snapshot.inc
diff options
context:
space:
mode:
authorAlejandro Hernandez Samaniego <alejandro@enedino.org>2022-12-17 09:20:57 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2022-12-21 10:16:25 +0000
commit807a52686682d0d0a151ea3dadd99880feb67cc0 (patch)
treedad938a785cf9c59794533bf3d1c685e8d3d2f55 /meta/recipes-devtools/rust/rust-snapshot.inc
parentd5c38964a4458aa31ec37810773ecc4f5d410dbe (diff)
downloadopenembedded-core-contrib-807a52686682d0d0a151ea3dadd99880feb67cc0.tar.gz
rust: Enable building rust from stable, beta and nightly channels
Rust follows the train release model via the stable, beta and nightly channels, by default we build rust from the stable channel, however there are certain features which are only available in the beta or nightly channels. Make these channels available by setting a RUST_CHANNEL variable which defaults to stable making this change transparent to the user. The snapshot version used by rust during its compilation wont necessarily match the version being built, specially if were building from an unstable channel, to avoid confusion rename this to SNAPSHOT_VERSION and use RUST_VERSION for the version to be built, which is automatically defined to PV. Append -beta or -nightly to rusts PV for signature awareness. It is important to note that this does not build rust from the beta/nightly published tarball (which today build rust v1.67.0 and v1.68.0 respectively), instead this builds rust from the current selected version (1.66.0) and enables the beta/nightly features for that version. Setting the variable RUST_CHANNEL=nightly results in the following: $ rustc -Vv rustc 1.66.0-nightly Signed-off-by: Alejandro Hernandez Samaniego <alejandro@enedino.org> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools/rust/rust-snapshot.inc')
-rw-r--r--meta/recipes-devtools/rust/rust-snapshot.inc7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/recipes-devtools/rust/rust-snapshot.inc b/meta/recipes-devtools/rust/rust-snapshot.inc
index 222f34f9a8..6420bcff55 100644
--- a/meta/recipes-devtools/rust/rust-snapshot.inc
+++ b/meta/recipes-devtools/rust/rust-snapshot.inc
@@ -5,7 +5,8 @@
## The version is replicated here.
## TODO: find a way to add additional SRC_URIs based on the contents of an
## earlier SRC_URI.
-RS_VERSION = "1.65.0"
+
+SNAPSHOT_VERSION = "1.65.0"
CARGO_VERSION = "1.65.0"
# TODO: Add hashes for other architecture toolchains as well. Make a script?
@@ -27,6 +28,6 @@ SRC_URI += " \
https://static.rust-lang.org/dist/${CARGO_SNAPSHOT}.tar.xz;name=cargo-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \
"
-RUST_STD_SNAPSHOT = "rust-std-${RS_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
-RUSTC_SNAPSHOT = "rustc-${RS_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
+RUST_STD_SNAPSHOT = "rust-std-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
+RUSTC_SNAPSHOT = "rustc-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"
CARGO_SNAPSHOT = "cargo-${CARGO_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu"