From 2c7321dac6614560885d05cb567caef3913e6b96 Mon Sep 17 00:00:00 2001 From: Alistair Francis Date: Wed, 13 May 2020 19:06:53 -0700 Subject: [PATCH] Bump to Rust version 1.43 Signed-off-by: Alistair Francis --- .../cargo-1.43.0/0001-Disable-http2.patch | 29 +++++++++++++++++++ recipes-devtools/cargo/cargo_1.43.0.bb | 8 +++++ recipes-devtools/rust/libstd-rs_1.43.0.bb | 8 +++++ recipes-devtools/rust/rust-cross_1.43.0.bb | 2 ++ recipes-devtools/rust/rust-llvm_1.43.0.bb | 16 ++++++++++ .../rust/rust-snapshot-1.43.0.inc | 21 ++++++++++++++ recipes-devtools/rust/rust-source-1.43.0.inc | 10 +++++++ recipes-devtools/rust/rust_1.43.0.bb | 12 ++++++++ 8 files changed, 106 insertions(+) create mode 100644 recipes-devtools/cargo/cargo-1.43.0/0001-Disable-http2.patch create mode 100644 recipes-devtools/cargo/cargo_1.43.0.bb create mode 100644 recipes-devtools/rust/libstd-rs_1.43.0.bb create mode 100644 recipes-devtools/rust/rust-cross_1.43.0.bb create mode 100644 recipes-devtools/rust/rust-llvm_1.43.0.bb create mode 100644 recipes-devtools/rust/rust-snapshot-1.43.0.inc create mode 100644 recipes-devtools/rust/rust-source-1.43.0.inc create mode 100644 recipes-devtools/rust/rust_1.43.0.bb diff --git a/recipes-devtools/cargo/cargo-1.43.0/0001-Disable-http2.patch b/recipes-devtools/cargo/cargo-1.43.0/0001-Disable-http2.patch new file mode 100644 index 0000000..00f657d --- /dev/null +++ b/recipes-devtools/cargo/cargo-1.43.0/0001-Disable-http2.patch @@ -0,0 +1,29 @@ +From cfc0be69235cbed098f616eb12de81396afb5863 Mon Sep 17 00:00:00 2001 +From: Johan Anderholm +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/src/tools/cargo/Cargo.toml b/src/tools/cargo/Cargo.toml +index 07f88b3c2..be70d0abd 100644 +--- a/Cargo.toml ++++ b/Cargo.toml +@@ -26,7 +26,7 @@ crates-io = { path = "crates/crates-io", version = "0.31" } + crossbeam-channel = "0.4" + crossbeam-utils = "0.7" + crypto-hash = "0.3.1" +-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 } diff --git a/recipes-devtools/cargo/cargo_1.43.0.bb b/recipes-devtools/cargo/cargo_1.43.0.bb new file mode 100644 index 0000000..f048779 --- /dev/null +++ b/recipes-devtools/cargo/cargo_1.43.0.bb @@ -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 \ +" diff --git a/recipes-devtools/rust/libstd-rs_1.43.0.bb b/recipes-devtools/rust/libstd-rs_1.43.0.bb new file mode 100644 index 0000000..69cb48a --- /dev/null +++ b/recipes-devtools/rust/libstd-rs_1.43.0.bb @@ -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" diff --git a/recipes-devtools/rust/rust-cross_1.43.0.bb b/recipes-devtools/rust/rust-cross_1.43.0.bb new file mode 100644 index 0000000..ddc25d3 --- /dev/null +++ b/recipes-devtools/rust/rust-cross_1.43.0.bb @@ -0,0 +1,2 @@ +require rust-cross.inc +require rust-source-${PV}.inc diff --git a/recipes-devtools/rust/rust-llvm_1.43.0.bb b/recipes-devtools/rust/rust-llvm_1.43.0.bb new file mode 100644 index 0000000..ac77a4b --- /dev/null +++ b/recipes-devtools/rust/rust-llvm_1.43.0.bb @@ -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" +} diff --git a/recipes-devtools/rust/rust-snapshot-1.43.0.inc b/recipes-devtools/rust/rust-snapshot-1.43.0.inc new file mode 100644 index 0000000..f64630c --- /dev/null +++ b/recipes-devtools/rust/rust-snapshot-1.43.0.inc @@ -0,0 +1,21 @@ +## 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.43.1" + +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.43.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.sha256sum] = "a18b89572ff2e55eb9e0428efcdb60eacd82fe28c4d825d169b0ffc9e3c55ceb" +SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "dabc62db53c2e7ffeba2824d4c52a938486b04c01a93ecba00c5d529868f6cfc" +SRC_URI[cargo-snapshot-x86_64.sha256sum] = "fe7e40786f6e013d471f2f8ed51ba268611122065930a6d5a10bf20146997270" diff --git a/recipes-devtools/rust/rust-source-1.43.0.inc b/recipes-devtools/rust/rust-source-1.43.0.inc new file mode 100644 index 0000000..ff673c1 --- /dev/null +++ b/recipes-devtools/rust/rust-source-1.43.0.inc @@ -0,0 +1,10 @@ +SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust" + +SRC_URI[rust.sha256sum] = "d0899933840369f07394b211cb0b53a5cd4634907633f0bee541133c8b75e309" + +# 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" diff --git a/recipes-devtools/rust/rust_1.43.0.bb b/recipes-devtools/rust/rust_1.43.0.bb new file mode 100644 index 0000000..c7f9f4f --- /dev/null +++ b/recipes-devtools/rust/rust_1.43.0.bb @@ -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"