Update to rust version 1.32.0

This commit is contained in:
Johan Anderholm
2019-01-17 16:29:43 +01:00
parent cb383b0d90
commit b3d1b589ee
10 changed files with 89 additions and 5 deletions
+2 -2
View File
@@ -12,7 +12,7 @@ LIC_FILES_CHKSUM = " \
" "
S = "${RUSTSRC}/src/tools/cargo" S = "${RUSTSRC}/src/tools/cargo"
CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/src/vendor" CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
inherit cargo inherit cargo
@@ -29,7 +29,7 @@ do_compile_prepend () {
do_install () { do_install () {
install -d "${D}${bindir}" install -d "${D}${bindir}"
install -m 755 "${RUSTSRC}/src/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}" install -m 755 "${RUSTSRC}/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}"
} }
# Needed for pkg-config to be used # Needed for pkg-config to be used
+7
View File
@@ -1,3 +1,10 @@
require recipes-devtools/rust/rust-source-${PV}.inc require recipes-devtools/rust/rust-source-${PV}.inc
require recipes-devtools/rust/rust-snapshot-${PV}.inc require recipes-devtools/rust/rust-snapshot-${PV}.inc
require cargo.inc require cargo.inc
# From 1.32.0, the vendor and target directory has moved.
CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/src/vendor"
do_install () {
install -d "${D}${bindir}"
install -m 755 "${RUSTSRC}/src/target/${CARGO_TARGET_SUBDIR}/cargo" "${D}${bindir}"
}
+3
View File
@@ -0,0 +1,3 @@
require recipes-devtools/rust/rust-source-${PV}.inc
require recipes-devtools/rust/rust-snapshot-${PV}.inc
require cargo.inc
@@ -0,0 +1,8 @@
require rust-source-${PV}.inc
require libstd-rs.inc
LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=66ddc8ecd998476b7cd5732e8c3a6c1d"
CARGO_FEATURES ?= "panic-unwind backtrace"
CARGO_VENDORING_DIRECTORY = "${RUSTSRC}/vendor"
@@ -0,0 +1,3 @@
require rust-cross.inc
require rust-source-${PV}.inc
+16
View File
@@ -0,0 +1,16 @@
require rust-source-${PV}.inc
require rust-llvm.inc
LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=c520ed40e11887bb1d24d86f7f5b1f05"
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"
}
@@ -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.31.1"
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.32.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] = "83f3f130e9a1c7e855a0c1eed8ac3508"
SRC_URI[rustc-snapshot-x86_64.sha256sum] = "77d47ce7e27a146e4301f11befd43f3fc5ac195ace0dfc07ac8154f130b057ea"
SRC_URI[rust-std-snapshot-x86_64.md5sum] = "3115e11612a882713978279635116881"
SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "699664b3a64959a2d75e486e19e7cc9934cbcbf2c57a977dd2a2b33cff367da1"
SRC_URI[cargo-snapshot-x86_64.md5sum] = "9ae6d258781870591450ea33d3b1bed9"
SRC_URI[cargo-snapshot-x86_64.sha256sum] = "b3d3dc57182fb173ecf367f7884dceb855a096d9b9b32eba994e3359ddc68cd4"
@@ -0,0 +1,11 @@
SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust"
SRC_URI[rust.md5sum] = "366f049777e00d0d6f15d25895485efb"
SRC_URI[rust.sha256sum] = "4c594c7712a0e7e8eae6526c464bf6ea1d82f77b4f61717c3fc28fb27ba2224a"
# 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=66ddc8ecd998476b7cd5732e8c3a6c1d"
+3 -3
View File
@@ -374,6 +374,7 @@ do_rust_setup_snapshot[dirs] += "${WORKDIR}/rust-snapshot"
python do_configure() { python do_configure() {
import json import json
from distutils.version import LooseVersion
try: try:
import configparser import configparser
except ImportError: except ImportError:
@@ -412,9 +413,8 @@ python do_configure() {
config.set("rust", "rpath", e(True)) config.set("rust", "rpath", e(True))
config.set("rust", "channel", e("stable")) config.set("rust", "channel", e("stable"))
# Don't use jemalloc as it doesn't work for many targets. if LooseVersion(d.getVar("PV")) < LooseVersion("1.32.0"):
# https://github.com/rust-lang/rust/pull/37392 config.set("rust", "use-jemalloc", e(False))
config.set("rust", "use-jemalloc", e(False))
# Whether or not to optimize the compiler and standard library # Whether or not to optimize the compiler and standard library
config.set("rust", "optimize", e(True)) config.set("rust", "optimize", e(True))
+12
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"