From a6cd1a4dbdd87e3716319e426d6f4a296f66ef0b Mon Sep 17 00:00:00 2001 From: Zahari Petkov Date: Mon, 11 Dec 2023 13:50:11 +0200 Subject: [PATCH] meta-balena-rust: Bump Rust toolchain to v1.73.0 Included are different small adjustments that were made in meta-rust in the period between Rust v1.62.0 and v1.73.0 Change-type: patch Signed-off-by: Zahari Petkov --- .../distro/include/balena-os-rust-version.inc | 15 ++++++---- ...62.0.bb => cargo-cross-canadian_1.73.0.bb} | 0 .../{cargo_1.62.0.bb => cargo_1.73.0.bb} | 0 .../recipes-devtools/rust/libstd-rs.inc | 1 - ...ibstd-rs_1.62.0.bb => libstd-rs_1.73.0.bb} | 2 ++ .../recipes-devtools/rust/rust-common.inc | 8 +++-- .../rust/rust-cross-canadian-common.inc | 20 +++++++++++-- ....62.0.bb => rust-cross-canadian_1.73.0.bb} | 0 ...t-cross_1.62.0.bb => rust-cross_1.73.0.bb} | 4 +++ ...ssdk_1.62.0.bb => rust-crosssdk_1.73.0.bb} | 0 .../recipes-devtools/rust/rust-llvm.inc | 1 + ...ust-llvm_1.62.0.bb => rust-llvm_1.73.0.bb} | 0 .../recipes-devtools/rust/rust-snapshot.inc | 30 +++++++++---------- .../recipes-devtools/rust/rust-source.inc | 2 +- ...bb => rust-tools-cross-canadian_1.73.0.bb} | 0 .../recipes-devtools/rust/rust.inc | 7 ++++- .../rust/{rust_1.62.0.bb => rust_1.73.0.bb} | 2 ++ 17 files changed, 62 insertions(+), 30 deletions(-) rename meta-balena-rust/recipes-devtools/cargo/{cargo-cross-canadian_1.62.0.bb => cargo-cross-canadian_1.73.0.bb} (100%) rename meta-balena-rust/recipes-devtools/cargo/{cargo_1.62.0.bb => cargo_1.73.0.bb} (100%) rename meta-balena-rust/recipes-devtools/rust/{libstd-rs_1.62.0.bb => libstd-rs_1.73.0.bb} (66%) rename meta-balena-rust/recipes-devtools/rust/{rust-cross-canadian_1.62.0.bb => rust-cross-canadian_1.73.0.bb} (100%) rename meta-balena-rust/recipes-devtools/rust/{rust-cross_1.62.0.bb => rust-cross_1.73.0.bb} (59%) rename meta-balena-rust/recipes-devtools/rust/{rust-crosssdk_1.62.0.bb => rust-crosssdk_1.73.0.bb} (100%) rename meta-balena-rust/recipes-devtools/rust/{rust-llvm_1.62.0.bb => rust-llvm_1.73.0.bb} (100%) rename meta-balena-rust/recipes-devtools/rust/{rust-tools-cross-canadian_1.62.0.bb => rust-tools-cross-canadian_1.73.0.bb} (100%) rename meta-balena-rust/recipes-devtools/rust/{rust_1.62.0.bb => rust_1.73.0.bb} (84%) diff --git a/meta-balena-rust/conf/distro/include/balena-os-rust-version.inc b/meta-balena-rust/conf/distro/include/balena-os-rust-version.inc index 6c34165fe6..59c25e0ec8 100644 --- a/meta-balena-rust/conf/distro/include/balena-os-rust-version.inc +++ b/meta-balena-rust/conf/distro/include/balena-os-rust-version.inc @@ -1,7 +1,10 @@ -PREFERRED_VERSION_rust = "1.62.0" -PREFERRED_VERSION_rust-native = "1.62.0" -PREFERRED_VERSION_rust-cross-${TARGET_ARCH} = "1.62.0" -PREFERRED_VERSION_rust-llvm-native = "1.62.0" -PREFERRED_VERSION_cargo-native = "1.62.0" -PREFERRED_VERSION_libstd-rs = "1.62.0" +RUST_VERSION ?= "1.73.0" +PREFERRED_VERSION_cargo ?= "${RUST_VERSION}" +PREFERRED_VERSION_cargo-native ?= "${RUST_VERSION}" +PREFERRED_VERSION_libstd-rs ?= "${RUST_VERSION}" +PREFERRED_VERSION_rust ?= "${RUST_VERSION}" +PREFERRED_VERSION_rust-cross-${TARGET_ARCH} ?= "${RUST_VERSION}" +PREFERRED_VERSION_rust-llvm ?= "${RUST_VERSION}" +PREFERRED_VERSION_rust-llvm-native ?= "${RUST_VERSION}" +PREFERRED_VERSION_rust-native ?= "${RUST_VERSION}" diff --git a/meta-balena-rust/recipes-devtools/cargo/cargo-cross-canadian_1.62.0.bb b/meta-balena-rust/recipes-devtools/cargo/cargo-cross-canadian_1.73.0.bb similarity index 100% rename from meta-balena-rust/recipes-devtools/cargo/cargo-cross-canadian_1.62.0.bb rename to meta-balena-rust/recipes-devtools/cargo/cargo-cross-canadian_1.73.0.bb diff --git a/meta-balena-rust/recipes-devtools/cargo/cargo_1.62.0.bb b/meta-balena-rust/recipes-devtools/cargo/cargo_1.73.0.bb similarity index 100% rename from meta-balena-rust/recipes-devtools/cargo/cargo_1.62.0.bb rename to meta-balena-rust/recipes-devtools/cargo/cargo_1.73.0.bb diff --git a/meta-balena-rust/recipes-devtools/rust/libstd-rs.inc b/meta-balena-rust/recipes-devtools/rust/libstd-rs.inc index 987956344a..db2a4d68f7 100644 --- a/meta-balena-rust/recipes-devtools/rust/libstd-rs.inc +++ b/meta-balena-rust/recipes-devtools/rust/libstd-rs.inc @@ -2,7 +2,6 @@ SUMMARY = "Rust standard libaries" HOMEPAGE = "http://www.rust-lang.org" SECTION = "devel" LICENSE = "MIT | Apache-2.0" -LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=93a95682d51b4cb0a633a97046940ef0" RUSTLIB_DEP = "" inherit cargo diff --git a/meta-balena-rust/recipes-devtools/rust/libstd-rs_1.62.0.bb b/meta-balena-rust/recipes-devtools/rust/libstd-rs_1.73.0.bb similarity index 66% rename from meta-balena-rust/recipes-devtools/rust/libstd-rs_1.62.0.bb rename to meta-balena-rust/recipes-devtools/rust/libstd-rs_1.73.0.bb index eec0245ae1..4a5533740b 100644 --- a/meta-balena-rust/recipes-devtools/rust/libstd-rs_1.62.0.bb +++ b/meta-balena-rust/recipes-devtools/rust/libstd-rs_1.73.0.bb @@ -1,6 +1,8 @@ require rust-source.inc require libstd-rs.inc +LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=c2cccf560306876da3913d79062a54b9" + # libstd moved from src/libstd to library/std in 1.47+ S = "${RUSTSRC}/library/std" diff --git a/meta-balena-rust/recipes-devtools/rust/rust-common.inc b/meta-balena-rust/recipes-devtools/rust/rust-common.inc index dffebd006e..37b402e2ae 100644 --- a/meta-balena-rust/recipes-devtools/rust/rust-common.inc +++ b/meta-balena-rust/recipes-devtools/rust/rust-common.inc @@ -24,9 +24,6 @@ def llvm_features_from_tune(d): if 'vfpv2' in feat or 'vfp' in feat: f.append("+vfp2") - if 'neon' in feat: - f.append("+neon") - if 'mips32' in feat: f.append("+mips32") @@ -36,6 +33,11 @@ def llvm_features_from_tune(d): if target_is_armv7(d): f.append('+v7') + if 'neon' in feat: + f.append("+neon") + else: + f.append("-neon") + if ('armv6' in mach_overrides) or ('armv6' in feat): f.append("+v6") if 'armv5te' in feat: diff --git a/meta-balena-rust/recipes-devtools/rust/rust-cross-canadian-common.inc b/meta-balena-rust/recipes-devtools/rust/rust-cross-canadian-common.inc index 1f21c8af26..2b33b6a1d5 100644 --- a/meta-balena-rust/recipes-devtools/rust/rust-cross-canadian-common.inc +++ b/meta-balena-rust/recipes-devtools/rust/rust-cross-canadian-common.inc @@ -27,9 +27,23 @@ DEBUG_PREFIX_MAP = "-fdebug-prefix-map=${WORKDIR}=/usr/src/debug/${PN}/${EXTENDP python do_rust_gen_targets () { wd = d.getVar('WORKDIR') + '/targets/' - rust_gen_target(d, 'TARGET', wd, d.getVar('TARGET_LLVM_FEATURES') or "", d.getVar('TARGET_LLVM_CPU'), d.getVar('TARGET_ARCH')) - rust_gen_target(d, 'HOST', wd, "", "generic", d.getVar('HOST_ARCH')) - rust_gen_target(d, 'BUILD', wd, "", "generic", d.getVar('BUILD_ARCH')) + # It is important 'TARGET' is last here so that it overrides our less + # informed choices for BUILD & HOST if TARGET happens to be the same as + # either of them. + for thing in ['BUILD', 'HOST', 'TARGET']: + bb.debug(1, "rust_gen_target for " + thing) + features = "" + cpu = "generic" + arch = d.getVar('{}_ARCH'.format(thing)) + abi = "" + if thing is "TARGET": + abi = d.getVar('ABIEXTENSION') + # arm and armv7 have different targets in llvm + if arch == "arm" and target_is_armv7(d): + arch = 'armv7' + features = d.getVar('TARGET_LLVM_FEATURES') or "" + cpu = d.getVar('TARGET_LLVM_CPU') + rust_gen_target(d, thing, wd, features, cpu, arch, abi) } INHIBIT_DEFAULT_RUST_DEPS = "1" diff --git a/meta-balena-rust/recipes-devtools/rust/rust-cross-canadian_1.62.0.bb b/meta-balena-rust/recipes-devtools/rust/rust-cross-canadian_1.73.0.bb similarity index 100% rename from meta-balena-rust/recipes-devtools/rust/rust-cross-canadian_1.62.0.bb rename to meta-balena-rust/recipes-devtools/rust/rust-cross-canadian_1.73.0.bb diff --git a/meta-balena-rust/recipes-devtools/rust/rust-cross_1.62.0.bb b/meta-balena-rust/recipes-devtools/rust/rust-cross_1.73.0.bb similarity index 59% rename from meta-balena-rust/recipes-devtools/rust/rust-cross_1.62.0.bb rename to meta-balena-rust/recipes-devtools/rust/rust-cross_1.73.0.bb index 5358d98da8..95e478a122 100644 --- a/meta-balena-rust/recipes-devtools/rust/rust-cross_1.62.0.bb +++ b/meta-balena-rust/recipes-devtools/rust/rust-cross_1.73.0.bb @@ -6,3 +6,7 @@ require rust-source.inc DEPENDS += "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc" PROVIDES = "virtual/${TARGET_PREFIX}rust" PN = "rust-cross-${TUNE_PKGARCH}-${TCLIBC}" + +# License file checksum needed for do_populate_lic when including a +# Rust app in an image. +LIC_FILES_CHKSUM="file://LICENSE-APACHE;md5=22a53954e4e0ec258dfce4391e905dac" diff --git a/meta-balena-rust/recipes-devtools/rust/rust-crosssdk_1.62.0.bb b/meta-balena-rust/recipes-devtools/rust/rust-crosssdk_1.73.0.bb similarity index 100% rename from meta-balena-rust/recipes-devtools/rust/rust-crosssdk_1.62.0.bb rename to meta-balena-rust/recipes-devtools/rust/rust-crosssdk_1.73.0.bb diff --git a/meta-balena-rust/recipes-devtools/rust/rust-llvm.inc b/meta-balena-rust/recipes-devtools/rust/rust-llvm.inc index 9baad12dc8..ca61e0a87d 100644 --- a/meta-balena-rust/recipes-devtools/rust/rust-llvm.inc +++ b/meta-balena-rust/recipes-devtools/rust/rust-llvm.inc @@ -30,6 +30,7 @@ EXTRA_OECMAKE = " \ -DLLVM_BUILD_DOCS=OFF \ -DLLVM_ENABLE_TERMINFO=OFF \ -DLLVM_ENABLE_ZLIB=OFF \ + -DLLVM_ENABLE_ZSTD=OFF \ -DLLVM_ENABLE_LIBXML2=OFF \ -DLLVM_ENABLE_FFI=OFF \ -DLLVM_INSTALL_UTILS=ON \ diff --git a/meta-balena-rust/recipes-devtools/rust/rust-llvm_1.62.0.bb b/meta-balena-rust/recipes-devtools/rust/rust-llvm_1.73.0.bb similarity index 100% rename from meta-balena-rust/recipes-devtools/rust/rust-llvm_1.62.0.bb rename to meta-balena-rust/recipes-devtools/rust/rust-llvm_1.73.0.bb diff --git a/meta-balena-rust/recipes-devtools/rust/rust-snapshot.inc b/meta-balena-rust/recipes-devtools/rust/rust-snapshot.inc index 3bd7b07cef..82da0bca87 100644 --- a/meta-balena-rust/recipes-devtools/rust/rust-snapshot.inc +++ b/meta-balena-rust/recipes-devtools/rust/rust-snapshot.inc @@ -1,25 +1,25 @@ ## This is information on the rust-snapshot (binary) used to build our current release. -## snapshot info is taken from rust/src/stage0.txt +## snapshot info is taken from rust/src/stage0.json ## Rust is self-hosting and bootstraps itself with a pre-built previous version of itself. ## The exact (previous) version that has been used is specified in the source tarball. ## 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.61.0" -CARGO_VERSION = "1.61.0" + +SNAPSHOT_VERSION = "1.72.0" # TODO: Add hashes for other architecture toolchains as well. Make a script? -SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "270b07aa5f2de52255a117e1e587138d77375ce0d09a1d7fead085f29b3977e9" -SRC_URI[rustc-snapshot-x86_64.sha256sum] = "21c4613f389ed130fbaaf88f1e984319f72b5fc10734569a5ba19e22ebb03abd" -SRC_URI[cargo-snapshot-x86_64.sha256sum] = "9461727d754f865ef2a87479d40bbe4c5176f80963b7c50b7797bc8940d7a0a0" +SRC_URI[rust-std-snapshot-x86_64.sha256sum] = "36f27513a6e4381f15b0cd14097c885af537f990cb6193cec3337c429367bf23" +SRC_URI[rustc-snapshot-x86_64.sha256sum] = "5b5d7854a0d73368f15146c1aa47e4dbccf12762c93282f410a09a605929ce09" +SRC_URI[cargo-snapshot-x86_64.sha256sum] = "4a401dfe7b3056dc0d42acbcd380b2b90f936577706ca74ef5327af0f5abd0a0" -SRC_URI[rust-std-snapshot-aarch64.sha256sum] = "57d60a519dbce12146849f7e72d55f3cffe9cdcbff8d58e90bb62d3c016bb5c0" -SRC_URI[rustc-snapshot-aarch64.sha256sum] = "c996de6391e3ea94629fbc09b03bce186fcde345159f43ec95a82c500adb5e94" -SRC_URI[cargo-snapshot-aarch64.sha256sum] = "a055e6cfd9b5f8938780db6179d2ef92990c714ce64278337d7edf3d29c8ab62" +SRC_URI[rust-std-snapshot-aarch64.sha256sum] = "41d259c6f84280fd0e7719fea03a7583ba54e33e8ac32a2a7b703ffb0aebb7d9" +SRC_URI[rustc-snapshot-aarch64.sha256sum] = "1948a80453956d494457dcced1942e2e204fb26d4e57e718ef1c7aa378efbedb" +SRC_URI[cargo-snapshot-aarch64.sha256sum] = "95741a4cd2073adbd74a7c5596bb912abf4b2dfe00d70a9919cba4a836b7a0ff" -SRC_URI[rust-std-snapshot-powerpc64le.sha256sum] = "36c0ccff14c80419507561db050f9533f0abd43fc50f3ddb859c10df74b1c351" -SRC_URI[rustc-snapshot-powerpc64le.sha256sum] = "dc54893d747e4f3330515caa75e404f78c6c5475a1216d1428f5e7ce1c2e9602" -SRC_URI[cargo-snapshot-powerpc64le.sha256sum] = "09817011ff1ef4b7006387c7cabb6a059731792a9372533dec7d87e7f014444b" +SRC_URI[rust-std-snapshot-powerpc64le.sha256sum] = "b6ef684ebf77063dbc1ff0abfe1316651fa73bbb95b023255b301b415867ff8b" +SRC_URI[rustc-snapshot-powerpc64le.sha256sum] = "20ed9ec0599e6582a218dae544566ddf7e2af46341705f35de874c90d7eecc0c" +SRC_URI[cargo-snapshot-powerpc64le.sha256sum] = "f659bf3ab70c376c736b7d7112d1fcee32a56dbfa66f6ef4fc039652f66c99e7" SRC_URI += " \ https://static.rust-lang.org/dist/${RUST_STD_SNAPSHOT}.tar.xz;name=rust-std-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \ @@ -27,6 +27,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" -CARGO_SNAPSHOT = "cargo-${CARGO_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-${SNAPSHOT_VERSION}-${RUST_BUILD_ARCH}-unknown-linux-gnu" diff --git a/meta-balena-rust/recipes-devtools/rust/rust-source.inc b/meta-balena-rust/recipes-devtools/rust/rust-source.inc index fda26534e8..fb304ac229 100644 --- a/meta-balena-rust/recipes-devtools/rust/rust-source.inc +++ b/meta-balena-rust/recipes-devtools/rust/rust-source.inc @@ -1,5 +1,5 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${PV}-src.tar.xz;name=rust" -SRC_URI[rust.sha256sum] = "6c00ef115c894c2645e60b5049a4f5dacf1dc0c993f3074f7ae4fdf4c755dd5e" +SRC_URI[rust.sha256sum] = "6eaf672dbea2e6596af8c999f5e6924b9af4bb8b02166bfe0b928e68aa75ae62" RUSTSRC = "${WORKDIR}/rustc-${PV}-src" diff --git a/meta-balena-rust/recipes-devtools/rust/rust-tools-cross-canadian_1.62.0.bb b/meta-balena-rust/recipes-devtools/rust/rust-tools-cross-canadian_1.73.0.bb similarity index 100% rename from meta-balena-rust/recipes-devtools/rust/rust-tools-cross-canadian_1.62.0.bb rename to meta-balena-rust/recipes-devtools/rust/rust-tools-cross-canadian_1.73.0.bb diff --git a/meta-balena-rust/recipes-devtools/rust/rust.inc b/meta-balena-rust/recipes-devtools/rust/rust.inc index 262e5b6d26..01c046911b 100644 --- a/meta-balena-rust/recipes-devtools/rust/rust.inc +++ b/meta-balena-rust/recipes-devtools/rust/rust.inc @@ -2,7 +2,6 @@ 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=93a95682d51b4cb0a633a97046940ef0" inherit rust inherit cargo_common @@ -139,6 +138,12 @@ python do_configure() { # nothing about when trying to build some stage0 tools (like fabricate) config.set("build", "build", e(d.getVar("SNAPSHOT_BUILD_SYS", True))) + # Explicitly disable all tools. + # This is done because some tools (e.g. rust-analyzer-proc-macro-srv) + # require the build.build target to be included in build.target which we + # don't want to do. + config.set("build", "tools", e([])) + # [install] config.add_section("install") # ./x.py install doesn't have any notion of "destdir" diff --git a/meta-balena-rust/recipes-devtools/rust/rust_1.62.0.bb b/meta-balena-rust/recipes-devtools/rust/rust_1.73.0.bb similarity index 84% rename from meta-balena-rust/recipes-devtools/rust/rust_1.62.0.bb rename to meta-balena-rust/recipes-devtools/rust/rust_1.73.0.bb index b505ad46ca..ca13790c86 100644 --- a/meta-balena-rust/recipes-devtools/rust/rust_1.62.0.bb +++ b/meta-balena-rust/recipes-devtools/rust/rust_1.73.0.bb @@ -2,6 +2,8 @@ require rust-target.inc require rust-source.inc require rust-snapshot.inc +LIC_FILES_CHKSUM = "file://COPYRIGHT;md5=c2cccf560306876da3913d79062a54b9" + INSANE_SKIP:${PN}:class-native = "already-stripped" do_compile () {