Update to Rust and Cargo 1.40.0.

This commit is contained in:
Colin Finck
2020-01-06 10:03:13 +01:00
committed by Colin Finck
parent 72aa4ef3ab
commit e5c2a4085f
8 changed files with 110 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
From 0e2384133664ebeb548b782ad763c3a627c1bc66 Mon Sep 17 00:00:00 2001
From: Johan Anderholm <johan.anderholm@gmail.com>
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 }

View File

@@ -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 \
"

View File

@@ -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"

View File

@@ -0,0 +1,2 @@
require rust-cross.inc
require rust-source-${PV}.inc

View File

@@ -0,0 +1,16 @@
require rust-source-${PV}.inc
require rust-llvm.inc
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=8a15a0759ef07f2682d2ba4b893c9afe"
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"
}

View File

@@ -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.39.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.40.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] = "aa10585498675e44be219d3644c15853"
SRC_URI[rustc-snapshot-x86_64.sha256sum] = "5b2a435a4c034615d70cfc383abe9924cbd1ffd4669caa55ce6539f22ed979ed"
SRC_URI[rust-std-snapshot-x86_64.md5sum] = "d8b8e6f1a5a255d22b9f86c97a65049f"
SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "b629952ec9e3e750137d7b8a922de145c97c1dc372dd616e86e4e501da13910b"
SRC_URI[cargo-snapshot-x86_64.md5sum] = "a51643b8980bcaefa9043715a8e9a2ba"
SRC_URI[cargo-snapshot-x86_64.sha256sum] = "7b9ba52c252964724f49aab49e42bec62fca929297ef058412c7e727b0794620"

View File

@@ -0,0 +1,11 @@
SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust"
SRC_URI[rust.md5sum] = "1725f67a1d92ab843a71fbbefef06db9"
SRC_URI[rust.sha256sum] = "6e2aa3a91697f4b225c6b394cbae6b97666f061dba491f666a5281698fe2aace"
# 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"

View File

@@ -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"