From a1ca1ed06d649efd28d9d4ba9e45954d128fbb5c Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 31 Oct 2016 11:52:58 -0500 Subject: [PATCH 1/5] rust-llvm: stop using shared source Convert rust-llvm to not use the shared source setup and instead use its own extracted directory. Include the version info in the bitbake file so that in the future we can support multiple versions via a PREFERRED_VERSIONS variable. --- recipes-devtools/rust/rust-llvm.bb | 9 --------- recipes-devtools/rust/rust-llvm.inc | 11 ++++++++--- recipes-devtools/rust/rust-llvm_1.10.0.bb | 10 ++++++++++ 3 files changed, 18 insertions(+), 12 deletions(-) delete mode 100644 recipes-devtools/rust/rust-llvm.bb create mode 100644 recipes-devtools/rust/rust-llvm_1.10.0.bb diff --git a/recipes-devtools/rust/rust-llvm.bb b/recipes-devtools/rust/rust-llvm.bb deleted file mode 100644 index 62fb3d4..0000000 --- a/recipes-devtools/rust/rust-llvm.bb +++ /dev/null @@ -1,9 +0,0 @@ -require rust-llvm.inc - -LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" - -do_install_append () { - cd "${B}" - install -d "${D}${bindir}" - install -m755 "Release/bin/FileCheck" "${D}${bindir}" -} diff --git a/recipes-devtools/rust/rust-llvm.inc b/recipes-devtools/rust/rust-llvm.inc index 0ed6096..3c94492 100644 --- a/recipes-devtools/rust/rust-llvm.inc +++ b/recipes-devtools/rust/rust-llvm.inc @@ -1,9 +1,14 @@ -require rust-shared-source.inc - SUMMARY = "LLVM compiler framework (packaged with rust)" LICENSE = "NCSA" -S .= "/src/llvm" +SRC_URI = "\ + https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \ + file://rust-llvm/0001-Don-t-build-unittests.patch \ +" + +S = "${WORKDIR}/rustc-${PV}/src/llvm" + +LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=4c0bc17c954e99fd547528d938832bfa" inherit autotools diff --git a/recipes-devtools/rust/rust-llvm_1.10.0.bb b/recipes-devtools/rust/rust-llvm_1.10.0.bb new file mode 100644 index 0000000..36a8212 --- /dev/null +++ b/recipes-devtools/rust/rust-llvm_1.10.0.bb @@ -0,0 +1,10 @@ +require rust-llvm.inc + +SRC_URI[rust.md5sum] = "a48fef30353fc9daa70b484b690ce5db" +SRC_URI[rust.sha256sum] = "a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869" + +do_install_append () { + cd "${B}" + install -d "${D}${bindir}" + install -m755 "Release/bin/FileCheck" "${D}${bindir}" +} From 7f7b3cd652587d6e3774ba9c35e99ef271392ae2 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Mon, 31 Oct 2016 22:44:01 -0500 Subject: [PATCH 2/5] rust: stop using shared source Convert rust to not use the shared source setup and instead use its own extracted directory. Include the version info in the bitbake file so that in the future we can support multiple versions via a PREFERRED_VERSIONS variable. --- .../{rust-cross.bb => rust-cross_1.10.0.bb} | 3 ++ recipes-devtools/rust/rust.bb | 11 ------- recipes-devtools/rust/rust.inc | 28 +++++++----------- recipes-devtools/rust/rust_1.10.0.bb | 29 +++++++++++++++++++ 4 files changed, 43 insertions(+), 28 deletions(-) rename recipes-devtools/rust/{rust-cross.bb => rust-cross_1.10.0.bb} (92%) delete mode 100644 recipes-devtools/rust/rust.bb create mode 100644 recipes-devtools/rust/rust_1.10.0.bb diff --git a/recipes-devtools/rust/rust-cross.bb b/recipes-devtools/rust/rust-cross_1.10.0.bb similarity index 92% rename from recipes-devtools/rust/rust-cross.bb rename to recipes-devtools/rust/rust-cross_1.10.0.bb index c350014..d745404 100644 --- a/recipes-devtools/rust/rust-cross.bb +++ b/recipes-devtools/rust/rust-cross_1.10.0.bb @@ -1,6 +1,9 @@ require rust.inc inherit cross +SRC_URI[rust.md5sum] = "a48fef30353fc9daa70b484b690ce5db" +SRC_URI[rust.sha256sum] = "a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869" + # Otherwise we'll depend on what we provide INHIBIT_DEFAULT_RUST_DEPS = "1" diff --git a/recipes-devtools/rust/rust.bb b/recipes-devtools/rust/rust.bb deleted file mode 100644 index ab61226..0000000 --- a/recipes-devtools/rust/rust.bb +++ /dev/null @@ -1,11 +0,0 @@ -inherit rust-installer -require rust.inc - -DEPENDS += "rust-llvm" - -# 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" diff --git a/recipes-devtools/rust/rust.inc b/recipes-devtools/rust/rust.inc index b886e2a..e8e7fad 100644 --- a/recipes-devtools/rust/rust.inc +++ b/recipes-devtools/rust/rust.inc @@ -1,15 +1,17 @@ -# ex: sts=4 et sw=4 ts=8 -inherit rust -require rust-shared-source.inc -require rust-snapshot-2016-05-24.inc - -LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8" - SUMMARY = "Rust compiler and runtime libaries" HOMEPAGE = "http://www.rust-lang.org" SECTION = "devel" +LICENSE = "MIT | Apache-2.0" +LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8" -B = "${WORKDIR}/build" +inherit rust +require rust-snapshot-2016-05-24.inc + +SRC_URI = "\ + https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \ + " + +S = "${WORKDIR}/rustc-${PV}" DEPENDS += "file-native" @@ -385,14 +387,6 @@ llvmdir = "${STAGING_DIR_NATIVE}/${prefix_native}" export CFG_DISABLE_LDCONFIG="notempty" do_configure () { - # Note: when we adjust the generated targets, rust doesn't rebuild (even - # when it should), so for now we need to remove the build dir to keep - # things in sync. - cd "${WORKDIR}" - rm -rf "${B}/" - mkdir -p "${B}/" - cd "${B}" - # FIXME: target_prefix vs prefix, see cross.bbclass # FIXME: this path to rustc (via `which rustc`) may not be quite right in the case @@ -484,4 +478,4 @@ rust_do_install () { do_install () { rust_do_install } - +# ex: sts=4 et sw=4 ts=8 diff --git a/recipes-devtools/rust/rust_1.10.0.bb b/recipes-devtools/rust/rust_1.10.0.bb new file mode 100644 index 0000000..be35dbf --- /dev/null +++ b/recipes-devtools/rust/rust_1.10.0.bb @@ -0,0 +1,29 @@ +inherit rust-installer +require rust.inc + +SRC_URI += " \ + file://rust/0001-Add-config-for-musl-based-arm-builds.patch \ + file://rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ + file://rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ + file://rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ + file://rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ + file://rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ + file://rust/0007-mk-install-use-disable-rewrite-paths.patch \ + file://rust/0008-Allow-overriding-crate_hash-with-C-crate_hash.patch \ + file://rust/0009-mk-platform.mk-pass-C-crate_hash-to-builds.patch \ + file://rust/0010-mk-allow-changing-the-platform-configuration-source-.patch \ + file://rust/0011-Get-rid-of-the-.note-interpretation-of-rustc-dylib-m.patch \ + file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ + " + +SRC_URI[rust.md5sum] = "a48fef30353fc9daa70b484b690ce5db" +SRC_URI[rust.sha256sum] = "a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869" + +DEPENDS += "rust-llvm" + +# 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" From 1f903865b42b8fb82943bb524caa509cdfb62125 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Tue, 1 Nov 2016 11:16:59 -0500 Subject: [PATCH 3/5] compiler-rt: stop using shared source Convert compiler-rt to not use the shared source setup and instead use its own extracted directory. Include the version info in the bitbake file so that in the future we can support multiple versions via a PREFERRED_VERSIONS variable. --- .../rust/{compiler-rt.bb => compiler-rt_1.10.0.bb} | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) rename recipes-devtools/rust/{compiler-rt.bb => compiler-rt_1.10.0.bb} (63%) diff --git a/recipes-devtools/rust/compiler-rt.bb b/recipes-devtools/rust/compiler-rt_1.10.0.bb similarity index 63% rename from recipes-devtools/rust/compiler-rt.bb rename to recipes-devtools/rust/compiler-rt_1.10.0.bb index d0dc987..fabe0e2 100644 --- a/recipes-devtools/rust/compiler-rt.bb +++ b/recipes-devtools/rust/compiler-rt_1.10.0.bb @@ -2,12 +2,15 @@ SUMMARY = "Rust compiler run-time" HOMEPAGE = "http://www.rust-lang.org" SECTION = "devel" LICENSE = "MIT" - -require rust-shared-source.inc LIC_FILES_CHKSUM = "file://LICENSE.TXT;md5=27b14ab4ce08d04c3a9a5f0ed7997362" -S .= "/src/compiler-rt" -B = "${WORKDIR}/build" +SRC_URI = "\ + https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \ + " +SRC_URI[rust.md5sum] = "a48fef30353fc9daa70b484b690ce5db" +SRC_URI[rust.sha256sum] = "a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869" + +S = "${WORKDIR}/rustc-${PV}/src/compiler-rt" # Pick up $CC from the environment EXTRA_OEMAKE += "-e" From 2536080e0bb41079d2d0438a085abd0062e1e29e Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Tue, 1 Nov 2016 11:18:15 -0500 Subject: [PATCH 4/5] libstd-rs: stop using shared source Convert libstd-rs to not use the shared source setup and instead use its own extracted directory. Include the version info in the bitbake file so that in the future we can support multiple versions via a PREFERRED_VERSIONS variable. --- .../rust/{libstd-rs.bb => libstd-rs_1.10.0.bb} | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) rename recipes-devtools/rust/{libstd-rs.bb => libstd-rs_1.10.0.bb} (71%) diff --git a/recipes-devtools/rust/libstd-rs.bb b/recipes-devtools/rust/libstd-rs_1.10.0.bb similarity index 71% rename from recipes-devtools/rust/libstd-rs.bb rename to recipes-devtools/rust/libstd-rs_1.10.0.bb index 45229e2..c2ce9eb 100644 --- a/recipes-devtools/rust/libstd-rs.bb +++ b/recipes-devtools/rust/libstd-rs_1.10.0.bb @@ -2,9 +2,15 @@ SUMMARY = "Rust standard libaries" HOMEPAGE = "http://www.rust-lang.org" SECTION = "devel" LICENSE = "MIT | Apache-2.0" - LIC_FILES_CHKSUM ="file://COPYRIGHT;md5=43e1f1fb9c0ee3af66693d8c4fecafa8" -require rust-shared-source.inc + +SRC_URI = "\ + https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \ + " +SRC_URI[rust.md5sum] = "a48fef30353fc9daa70b484b690ce5db" +SRC_URI[rust.sha256sum] = "a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869" + +S = "${WORKDIR}/rustc-${PV}" CARGO_INDEX_COMMIT = "6127fc24b0b6fe73fe4d339817fbf000b9a798a2" @@ -21,7 +27,7 @@ inherit cargo # Needed so cargo can find libbacktrace RUSTFLAGS += "-L ${STAGING_LIBDIR}" -B = "${WORKDIR}/build" +S = "${WORKDIR}/rustc-${PV}" do_compile_prepend () { cd ${S}/src/rustc/std_shim From a97f66224ab05e4b96acca350ee3cf75a93bcbe3 Mon Sep 17 00:00:00 2001 From: Doug Goldstein Date: Tue, 1 Nov 2016 11:19:34 -0500 Subject: [PATCH 5/5] drop files supporting shared source --- classes/shared-source-provide.bbclass | 38 -------------------- classes/shared-source-use.bbclass | 23 ------------ recipes-devtools/rust/rust-release.inc | 6 ---- recipes-devtools/rust/rust-shared-source.inc | 3 -- recipes-devtools/rust/rust-source.bb | 29 --------------- recipes-devtools/rust/rust-version.inc | 6 ---- 6 files changed, 105 deletions(-) delete mode 100644 classes/shared-source-provide.bbclass delete mode 100644 classes/shared-source-use.bbclass delete mode 100644 recipes-devtools/rust/rust-release.inc delete mode 100644 recipes-devtools/rust/rust-shared-source.inc delete mode 100644 recipes-devtools/rust/rust-source.bb delete mode 100644 recipes-devtools/rust/rust-version.inc diff --git a/classes/shared-source-provide.bbclass b/classes/shared-source-provide.bbclass deleted file mode 100644 index fc0cad2..0000000 --- a/classes/shared-source-provide.bbclass +++ /dev/null @@ -1,38 +0,0 @@ -# In order to share the same source between multiple packages (.bb files), we -# unpack and patch the X source here into a shared dir. -# -# Take a look at gcc-source.inc for the general structure of this - -# We require that "SOURCE_NAME" be set - -# nopackages.bbclass { -deltask do_package -deltask do_package_write_rpm -deltask do_package_write_ipk -deltask do_package_write_deb -deltask do_package_qa -deltask do_packagedata -#} - -deltask do_configure -deltask do_compile -deltask do_install -deltask do_populate_sysroot -deltask do_populate_lic -deltask do_rm_work - - -# override to get rid of '-native' or other misc -# XXX: consider ${PR} -PN = "${SOURCE_NAME}-source-${PV}" -WORKDIR = "${TMPDIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}" -SSTATE_SWSPEC = "sstate:${SOURCE_NAME}::${PV}:${PR}::${SSTATE_VERSION}:" - -STAMP = "${STAMPS_DIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}" -STAMPCLEAN = "${STAMPS_DIR}/work-shared/${SOURCE_NAME}-${PV}-*" - -INHIBIT_DEFAULT_DEPS = "1" -DEPENDS = "" -PACKAGES = "" - -EXCLUDE_FROM_WORLD = "1" diff --git a/classes/shared-source-use.bbclass b/classes/shared-source-use.bbclass deleted file mode 100644 index 884ee53..0000000 --- a/classes/shared-source-use.bbclass +++ /dev/null @@ -1,23 +0,0 @@ -# gcc's shared source code disables fetch (via the commented code below). We -# can't do that because rust.bb currently fetches a rustc-snapshot archive itself. -#do_fetch() { -# : -#} -#do_fetch[noexec] = "1" - -# gcc does `deltask` do_unpack. We avoid this so that the depends work sanely -# (things that need source code can still be ordered after do_unpack). -# As a side effect, we can also unpack things that aren't shared. -# Note: just setting this normally doesn't work. Use of python() is required. -python () { - d.setVarFlag('do_unpack', 'cleandirs', '') -} -# Avoid disabling do_patch for the same reason. -#deltask do_patch - -SRC_URI = "" - -S = "${TMPDIR}/work-shared/${SOURCE_NAME}-${PV}-${PR}" - -do_unpack[depends] += "${SOURCE_NAME}-source-${PV}:do_patch" -do_populate_lic[depends] += "${SOURCE_NAME}-source-${PV}:do_unpack" diff --git a/recipes-devtools/rust/rust-release.inc b/recipes-devtools/rust/rust-release.inc deleted file mode 100644 index 7ece6e1..0000000 --- a/recipes-devtools/rust/rust-release.inc +++ /dev/null @@ -1,6 +0,0 @@ -SRC_URI = "\ - https://static.rust-lang.org/dist/rustc-${PV}-src.tar.gz;name=rust \ -" - -S = "${WORKDIR}/rustc-${PV}" - diff --git a/recipes-devtools/rust/rust-shared-source.inc b/recipes-devtools/rust/rust-shared-source.inc deleted file mode 100644 index eeb066c..0000000 --- a/recipes-devtools/rust/rust-shared-source.inc +++ /dev/null @@ -1,3 +0,0 @@ -inherit shared-source-use -require rust-version.inc -S .= "/rustc-${PV}" diff --git a/recipes-devtools/rust/rust-source.bb b/recipes-devtools/rust/rust-source.bb deleted file mode 100644 index ebf5eb4..0000000 --- a/recipes-devtools/rust/rust-source.bb +++ /dev/null @@ -1,29 +0,0 @@ -# In order to share the same source between multiple packages (.bb files), we -# unpack and patch the rustc source here into a shared dir. -# -# Take a look at gcc-source.inc for the general structure of this - -inherit shared-source-provide - -require rust-version.inc -require rust-release.inc - -SRC_URI[rust.md5sum] = "a48fef30353fc9daa70b484b690ce5db" -SRC_URI[rust.sha256sum] = "a4015aacf4f6d8a8239253c4da46e7abaa8584f8214d1828d2ff0a8f56176869" -LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=eb87dba71cb424233bcce88db3ae2f1a" - -SRC_URI_append = "\ - file://rust/0001-Add-config-for-musl-based-arm-builds.patch \ - file://rust/0002-Target-add-default-target.json-path-libdir-rust-targ.patch \ - file://rust/0003-mk-for-stage0-use-RUSTFLAGS-to-override-target-libs-.patch \ - file://rust/0004-mk-add-missing-CFG_LIBDIR_RELATIVE.patch \ - file://rust/0005-configure-support-bindir-and-extend-libdir-to-non-bl.patch \ - file://rust/0006-std-thread_local-workaround-for-NULL-__dso_handle.patch \ - file://rust/0007-mk-install-use-disable-rewrite-paths.patch \ - file://rust/0008-Allow-overriding-crate_hash-with-C-crate_hash.patch \ - file://rust/0009-mk-platform.mk-pass-C-crate_hash-to-builds.patch \ - file://rust/0010-mk-allow-changing-the-platform-configuration-source-.patch \ - file://rust/0011-Get-rid-of-the-.note-interpretation-of-rustc-dylib-m.patch \ - file://rust-llvm/0001-Don-t-build-unittests.patch;patchdir=src/llvm \ - file://rust-installer/0001-add-option-to-disable-rewriting-of-install-paths.patch;patchdir=src/rust-installer \ -" diff --git a/recipes-devtools/rust/rust-version.inc b/recipes-devtools/rust/rust-version.inc deleted file mode 100644 index 53ea335..0000000 --- a/recipes-devtools/rust/rust-version.inc +++ /dev/null @@ -1,6 +0,0 @@ -# Note: if you adjust this, you'll also need to change the hashes in -# rust-source.bb -SOURCE_NAME = "rust" -PV = "1.10.0" - -LICENSE = "MIT | Apache-2.0"