Skip to content

Commit

Permalink
meta-balena-rust: Bump Rust toolchain to v1.73.0
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
majorz authored and jaomaloy committed Jan 17, 2024
1 parent d4e8094 commit 8a68734
Show file tree
Hide file tree
Showing 17 changed files with 62 additions and 30 deletions.
15 changes: 9 additions & 6 deletions meta-balena-rust/conf/distro/include/balena-os-rust-version.inc
Original file line number Diff line number Diff line change
@@ -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}"
1 change: 0 additions & 1 deletion meta-balena-rust/recipes-devtools/rust/libstd-rs.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
8 changes: 5 additions & 3 deletions meta-balena-rust/recipes-devtools/rust/rust-common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand All @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
1 change: 1 addition & 0 deletions meta-balena-rust/recipes-devtools/rust/rust-llvm.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
30 changes: 15 additions & 15 deletions meta-balena-rust/recipes-devtools/rust/rust-snapshot.inc
Original file line number Diff line number Diff line change
@@ -1,32 +1,32 @@
## 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 \
https://static.rust-lang.org/dist/${RUSTC_SNAPSHOT}.tar.xz;name=rustc-snapshot-${RUST_BUILD_ARCH};subdir=rust-snapshot-components \
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"
2 changes: 1 addition & 1 deletion meta-balena-rust/recipes-devtools/rust/rust-source.inc
Original file line number Diff line number Diff line change
@@ -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"

Expand Down
7 changes: 6 additions & 1 deletion meta-balena-rust/recipes-devtools/rust/rust.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down

0 comments on commit 8a68734

Please sign in to comment.