rust: Fix bloat issue in recent rust updates
PATCH 1/5 rust: Fix bloat issue in recent rust updates
From: Deepesh Varatharajan <[email protected]>
Remove the "src/gcc" directory from the Rust source code to reduce the filesystem build space.
In Rust 1.83 (and 1.84), a full GCC-14 tree was included, which caused the tar.xz archive to increase by 128 MB and the unpacked sources to grow by 1.3 GB. This was an upstream error that has been resolved in Rust 1.85.
After updating to Rust 1.85 we can revert this removal of "gcc/src"
--- meta/recipes-devtools/rust/rust_1.83.0.bb | 10 ++++++++++ 1 file changed, 10 insertions(+)
meta/recipes-devtools/rust/rust_1.83.0.bb +10 -0
@@ -50,6 +50,16 @@ setup_cargo_environment () { inherit rust-target-config +do_unpack:append() { + import os + import shutil + + # Remove gcc directory after unpacking + gcc_dir = os.path.join(d.getVar('S'), 'src', 'gcc') + if os.path.isdir(gcc_dir): + shutil.rmtree(gcc_dir) +} + do_rust_setup_snapshot () { for installer in "${UNPACKDIR}/rust-snapshot-components/"*"/install.sh"; do "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig
Signature · 1 line
2.43.0
PATCH 2/5 rust: Fix build failure when multilibs are enabled
From: Deepesh Varatharajan <[email protected]>
When multilibs are enabled, rustc could not find dynamic libraries in the lib64 directory due to the bootstrapping process searching in the lib directory. This commit exports both lib and lib64 paths to ensure correct library detection.
dropped:
revert-Zdual-proc-macros-additional-check.patch
We reverted the previous commit to prevent errors when rustc cannot find dynamic libraries. Since the issue has been resolved by exporting the lib paths, this revert is no longer necessary, as it won't cause any errors moving forward.
--- ...t-Zdual-proc-macros-additional-check.patch | 43 ------------------- meta/recipes-devtools/rust/rust-source.inc | 1 - meta/recipes-devtools/rust/rust_1.83.0.bb | 3 ++ 3 files changed, 3 insertions(+), 44 deletions(-) delete mode 100644 meta/recipes-devtools/rust/files/revert-Zdual-proc-macros-additional-check.patch
meta/recipes-devtools/rust/files/revert-Zdual-proc-macros-additional-check.patch deleted +0 -43
@@ -1,43 +0,0 @@ -rust: Fix build failure for v1.83 when lib32 enabled - -Because of the following commit , -https://github.com/rust-lang/rust/commit/68034f837a39387e49fc7d7c5b088f5372a1127e -when we enable lib32, getting build failure because there is a check for target -support for "-Zdual-proc-macros" flag not functioning properly when lib32 is -enabled in the build environment. So for now reverting this commit and bring -back the previous behavior, where the "-Zdual-proc-macros" flag is always -added for building proc macros, regardless of the target architecture's support. -This would bypass the check introduced in the patch, allowing the build to -proceed without error, even when building for a 64-bit architecture with lib32 enabled. - -Upstream-Status: Pending - -Signed-off-by: Deepesh Varatharajan <[email protected]> -diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs -index 9ac0b0a01f..b1374042fb 100644 ---- a/src/bootstrap/src/core/builder.rs -+++ b/src/bootstrap/src/core/builder.rs -@@ -1701,21 +1701,8 @@ impl<'a> Builder<'a> { - // Build proc macros both for the host and the target unless proc-macros are not - // supported by the target. - if target != compiler.host && cmd_kind != Kind::Check { -- let error = command(self.rustc(compiler)) -- .arg("--target") -- .arg(target.rustc_target_arg()) -- .arg("--print=file-names") -- .arg("--crate-type=proc-macro") -- .arg("-") -- .run_capture(self) -- .stderr(); -- let not_supported = error -- .lines() -- .any(|line| line.contains("unsupported crate type `proc-macro`")); -- if !not_supported { -- cargo.arg("-Zdual-proc-macros"); -- rustflags.arg("-Zdual-proc-macros"); -- } -+ cargo.arg("-Zdual-proc-macros"); -+ rustflags.arg("-Zdual-proc-macros"); - } - } - }
meta/recipes-devtools/rust/rust-source.inc +0 -1
@@ -7,7 +7,6 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n file://oeqa-selftest-Increase-timeout-in-process-sigpipe-ru.patch;patchdir=${RUSTSRC} \ file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \ file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \ - file://revert-Zdual-proc-macros-additional-check.patch;patchdir=${RUSTSRC} \ " SRC_URI[rust.sha256sum] = "7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11735760f97df"
meta/recipes-devtools/rust/rust_1.83.0.bb +3 -0
@@ -223,6 +223,9 @@ rust_runx () { oe_cargo_fix_env + # When multilibs are enabled, rustc can't find dynamic libraries in "lib64" because the bootstrapping process looks in "lib". To fix this, export both paths: + export LD_LIBRARY_PATH=${S}/build/${RUST_BUILD_SYS}/stage1/lib:${S}/build/${RUST_BUILD_SYS}/stage1/lib64:$LD_LIBRARY_PATH + python3 src/bootstrap/bootstrap.py ${@oe.utils.parallel_make_argument(d, '-j %d')} "$@" --verbose } rust_runx[vardepsexclude] += "PARALLEL_MAKE"
Signature · 1 line
2.43.0
Re: [OE-core] [PATCH 2/5] rust: Fix build failure when multilibs are enabled
Quoted 7 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan <[email protected]>
When multilibs are enabled, rustc could not find dynamic libraries in the lib64 directory due to the bootstrapping process searching in the lib directory. This commit exports both lib and lib64 paths to ensure correct library detection.
What is creating and populating this lib64 directory then, and how does it decide that it should be named 'lib64'? Shouldn't either that, or the code that looks in 'lib' be fixed so they match each other?
This looks like an incomplete fix, as it does not get to the bottom of the mismatch problem.
Alex
Re: [OE-core] [PATCH 2/5] rust: Fix build failure when multilibs are enabled
Quoted 9 lines · Alexander Kanavin via lists.openembedded.org
Quoted 6 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan<[email protected]>
When multilibs are enabled, rustc could not find dynamic libraries in the lib64 directory due to the bootstrapping process searching in the lib directory. This commit exports both lib and lib64 paths to ensure correct library detection.
Quoted 6 lines
What is creating and populating this lib64 directory then, and how does it decide that it should be named 'lib64'? Shouldn't either that, or the code that looks in 'lib' be fixed so they match each other?
This looks like an incomplete fix, as it does not get to the bottom of the mismatch problem.
FYI:
This will block the 1.84 update until we understand the root cause. What happened in 1.84 that we need this change?
../Randy
Quoted 10 lines
Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#213520):https://lists.openembedded.org/g/openembedded-core/message/213520 Mute This Topic:https://lists.openembedded.org/mt/111827575/3616765
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Signature · 2 lines
# Randy MacLeod # Wind River Linux
Re: [OE-core] [PATCH 2/5] rust: Fix build failure when multilibs are enabled
Quoted 2 lines · Randy MacLeod
This will block the 1.84 update until we understand the root cause. What happened in 1.84 that we need this change?
The issue has existed before, but with the new commit (https://github.com/rust-lang/rust/commit/68034f837a39387e49fc7d7c5b088f5372a1127e) from Rust 1.83, an error has started occurring. The problem is that when multilibs are enabled, stage1/rustc can't find the lib*.so files in the lib directory, as they are now placed in the lib64 directory. To resolve this, we initially reverted that commit. However, with the current update, we removed that revert patch. To resolve this issue, we exported the LD_LIBRARY_PATH to include both lib and lib64. After doing so, the issue was resolved.
Deepesh
Re: [OE-core] [PATCH 2/5] rust: Fix build failure when multilibs are enabled
In reply to Randy MacLeodQuoted 17 lines · Randy MacLeod
Quoted 9 lines · Alexander Kanavin via lists.openembedded.org
Quoted 6 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan<[email protected]>
When multilibs are enabled, rustc could not find dynamic libraries in the lib64 directory due to the bootstrapping process searching in the lib directory. This commit exports both lib and lib64 paths to ensure correct library detection.
Quoted 6 lines
What is creating and populating this lib64 directory then, and how does it decide that it should be named 'lib64'? Shouldn't either that, or the code that looks in 'lib' be fixed so they match each other?
This looks like an incomplete fix, as it does not get to the bottom of the mismatch problem.
Quoted 9 lines
FYI:
This will block the 1.84 update until we understand the root cause. What happened in 1.84 that we need this change?
../Randy
When multilibs are enabled, building Rust fails due to the following commit:
https://github.com/rust-lang/rust/commit/68034f837a39387e49fc7d7c5b088f5372a1127e
The issue occurs because stage1/rustc cannot find the dependent *.so files. This issue was addressed in the following commit:
https://github.com/rust-lang/rust/commit/139d6ba054a1a4cc5fe64981ad46fd5547bd4916
Where the necessary library paths were passed before executing stage1/rustc.
The fix has been implemented in rust-master, and the patch has been backported to our sources, which resolves the issue we're encountering. Additional testing is ongoing, and once completed, Will send the V2 shortly.
Thanks,
Deepesh
Quoted 15 lines
Quoted 11 lines
Alex
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#213520):https://lists.openembedded.org/g/openembedded-core/message/213520 Mute This Topic:https://lists.openembedded.org/mt/111827575/3616765
Group Owner:[email protected] Unsubscribe:https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-Signature · 2 lines
# Randy MacLeod # Wind River Linux
Re: [OE-core] [PATCH 2/5] rust: Fix build failure when multilibs are enabled
In reply to Alexander KanavinQuoted 12 lines · Alexander Kanavin
CAUTION: This email comes from a non Wind River email account!
Do not click links or open attachments unless you recognize the sender and know the content is safe.Quoted 6 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan <[email protected]>
When multilibs are enabled, rustc could not find dynamic libraries in the lib64 directory due to the bootstrapping process searching in the lib directory. This commit exports both lib and lib64 paths to ensure correct library detection.
Quoted 8 lines
What is creating and populating this lib64 directory then, and how does it decide that it should be named 'lib64'? Shouldn't either that, or the code that looks in 'lib' be fixed so they match each other?
This looks like an incomplete fix, as it does not get to the bottom of the mismatch problem.
Alex
Sure Alex, I will investigate further.
Deepesh
PATCH 3/5 rust: Fix build break because of "download-rustc" and "llvm-tools"
In reply to [email protected]From: Deepesh Varatharajan <[email protected]>
From Rust 1.84, the download-rustc and llvm-tools options were set to True (previously they were False)
https://github.com/rust-lang/rust/commit/cce6f03754f096f8a2bdfb357e3739b855e29366
(download-rustc)
https://github.com/rust-lang/rust/commit/38f0c099b2e684ea689633eb424d8737a1063a5e
(llvm-tools)
For tarball sources, the download-rustc option should be False, so it has been reverted back to False.
Setting llvm-tools to True caused issues with finding llvm-objcopy, so this has been changed back to False.
Upstream-Status: https://github.com/rust-lang/rust/pull/134240/
--- meta/recipes-devtools/rust/rust_1.83.0.bb | 2 ++ 1 file changed, 2 insertions(+)
meta/recipes-devtools/rust/rust_1.83.0.bb +2 -0
@@ -147,6 +147,8 @@ python do_configure() { config.add_section("rust") config.set("rust", "rpath", e(True)) config.set("rust", "remap-debuginfo", e(True)) + config.set("rust", "download-rustc", e(False)) + config.set("rust", "llvm-tools", e(False)) config.set("rust", "channel", e(d.expand("${RUST_CHANNEL}"))) # Whether or not to optimize the compiler and standard library
Signature · 1 line
2.43.0
PATCH 4/5 rust: Upgrade 1.83.0->1.84.1
In reply to [email protected]From: Deepesh Varatharajan <[email protected]>
Rust stable version updated to 1.84.1.
https://blog.rust-lang.org/2025/01/30/Rust-1.84.1.html
Renamed and modified the below patch to adapt the new version. rv32-cargo-rustix-0.38.37-fix.patch->rv32-cargo-rustix-0.38.38-fix.patch
Modified the below patches to adapt the new version. repro-issue-fix-with-cc-crate-hashmap.patch revert-link-std-statically-in-rustc_driver-feature.patch
Dropped: 0001-NFC-fix-build-failure-100993.patch
https://github.com/llvm/llvm-project/commit/6ee49080e4bb43efe7ede10bed15935853bbd434
---
meta/conf/distro/include/tcmode-default.inc | 2 +-
.../rust/{cargo_1.83.0.bb => cargo_1.84.1.bb} | 0
...epro-issue-fix-with-cc-crate-hashmap.patch | 53 +---
...d-statically-in-rustc_driver-feature.patch | 36 +--
.../files/rv32-cargo-rustix-0.38.37-fix.patch | 103 --------
.../files/rv32-cargo-rustix-0.38.38-fix.patch | 236 ++++++++++++++++++
...ibstd-rs_1.83.0.bb => libstd-rs_1.84.1.bb} | 0
....83.0.bb => rust-cross-canadian_1.84.1.bb} | 0
.../0001-NFC-fix-build-failure-100993.patch | 30 ---
...ust-llvm_1.83.0.bb => rust-llvm_1.84.1.bb} | 3 +-
meta/recipes-devtools/rust/rust-snapshot.inc | 78 +++---
meta/recipes-devtools/rust/rust-source.inc | 4 +-
.../rust/{rust_1.83.0.bb => rust_1.84.1.bb} | 0
13 files changed, 298 insertions(+), 247 deletions(-)
rename meta/recipes-devtools/rust/{cargo_1.83.0.bb => cargo_1.84.1.bb} (100%)
delete mode 100644 meta/recipes-devtools/rust/files/rv32-cargo-rustix-0.38.37-fix.patch
create mode 100644 meta/recipes-devtools/rust/files/rv32-cargo-rustix-0.38.38-fix.patch
rename meta/recipes-devtools/rust/{libstd-rs_1.83.0.bb => libstd-rs_1.84.1.bb} (100%)
rename meta/recipes-devtools/rust/{rust-cross-canadian_1.83.0.bb => rust-cross-canadian_1.84.1.bb} (100%)
delete mode 100644 meta/recipes-devtools/rust/rust-llvm/0001-NFC-fix-build-failure-100993.patch
rename meta/recipes-devtools/rust/{rust-llvm_1.83.0.bb => rust-llvm_1.84.1.bb} (97%)
rename meta/recipes-devtools/rust/{rust_1.83.0.bb => rust_1.84.1.bb} (100%)meta/conf/distro/include/tcmode-default.inc +1 -1
@@ -12,7 +12,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext" GCCVERSION ?= "14.%" SDKGCCVERSION ?= "${GCCVERSION}" GLIBCVERSION ?= "2.41%" -RUSTVERSION ?= "1.83%" +RUSTVERSION ?= "1.84.1%" PREFERRED_VERSION_gcc ?= "${GCCVERSION}" PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
meta/recipes-devtools/rust/cargo_1.84.1.bb renamed from meta/recipes-devtools/rust/cargo_1.83.0.bb +0 -0
meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch +1 -52
65 lines not on this page · raw message
meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch +18 -18
@@ -24,13 +24,12 @@ diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs index e9a7397557..29766fc9d8 100644 --- a/compiler/rustc/src/main.rs +++ b/compiler/rustc/src/main.rs -@@ -1,6 +1,3 @@ +@@ -1,5 +1,3 @@ -// We need this feature as it changes `dylib` linking behavior and allows us to link to `rustc_driver`. -#![feature(rustc_private)] -- - // A note about jemalloc: rustc uses jemalloc when built for CI and - // distribution. The obvious way to do this is with the `#[global_allocator]` - // mechanism. However, for complicated reasons (see + // Several crates are depended upon but unused so that they are present in the sysroot + #![expect(unused_crate_dependencies)] + diff --git a/compiler/rustc_metadata/src/dependency_format.rs b/compiler/rustc_metadata/src/dependency_format.rs index 39fa23766b..51d86b4009 100644 --- a/compiler/rustc_metadata/src/dependency_format.rs
@@ -44,10 +43,11 @@ index 39fa23766b..51d86b4009 100644 use rustc_hir::def_id::CrateNum; use rustc_middle::bug; use rustc_middle::middle::dependency_format::{Dependencies, DependencyList, Linkage}; -@@ -162,43 +162,18 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList { +@@ -161,44 +161,19 @@ fn calculate_type(tcx: TyCtxt<'_>, ty: CrateType) -> DependencyList { + } Linkage::Dynamic | Linkage::IncludedFromDylib => {} } - +- - let all_dylibs = || { - tcx.crates(()).iter().filter(|&&cnum| { - !tcx.dep_kind(cnum).macros_only() && tcx.used_crate_source(cnum).dylib.is_some()
@@ -56,7 +56,7 @@ index 39fa23766b..51d86b4009 100644 - - let mut upstream_in_dylibs = FxHashSet::default(); - -- if tcx.features().rustc_private { +- if tcx.features().rustc_private() { - // We need this to prevent users of `rustc_driver` from linking dynamically to `std` - // which does not work as `std` is also statically linked into `rustc_driver`. -
@@ -85,7 +85,7 @@ index 39fa23766b..51d86b4009 100644 + if tcx.dep_kind(cnum).macros_only() { continue; } -- + let name = tcx.crate_name(cnum); + let src = tcx.used_crate_source(cnum); + if src.dylib.is_some() {
@@ -139,11 +139,11 @@ index d04e2fbeb7..011c289d93 100644 if let Some(crate_name) = crate_name { if let Some(target) = env::var_os("RUSTC_TIME") { if target == "all" -diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs -index ff0d1f3a72..b2c9602e57 100644 ---- a/src/bootstrap/src/core/builder.rs -+++ b/src/bootstrap/src/core/builder.rs -@@ -2201,7 +2201,7 @@ impl<'a> Builder<'a> { +diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs +index 0688a1d689..066e6bf53f 100644 +--- a/src/bootstrap/src/core/builder/cargo.rs ++++ b/src/bootstrap/src/core/builder/cargo.rs +@@ -1146,7 +1146,7 @@ impl Builder<'_> { // When we build Rust dylibs they're all intended for intermediate // usage, so make sure we pass the -Cprefer-dynamic flag instead of // linking all deps statically into the dylib.
@@ -200,13 +200,13 @@ diff --git a/src/bootstrap/src/core/build_steps/compile.rs b/src/bootstrap/src/c index 27bbc8bd8f..a6fc4df2eb 100644 --- a/src/bootstrap/src/core/build_steps/compile.rs +++ b/src/bootstrap/src/core/build_steps/compile.rs -@@ -1934,24 +1934,8 @@ impl Step for Assemble { - let src_libdir = builder.sysroot_libdir(build_compiler, host); +@@ -1940,24 +1940,8 @@ impl Step for Assemble { + let src_libdir = builder.sysroot_target_libdir(build_compiler, host); for f in builder.read_dir(&src_libdir) { let filename = f.file_name().into_string().unwrap(); - - let is_proc_macro = proc_macros.contains(&filename); -- let is_dylib_or_debug = is_dylib(&filename) || is_debug_info(&filename); +- let is_dylib_or_debug = is_dylib(&f.path()) || is_debug_info(&filename); - - // If we link statically to stdlib, do not copy the libstd dynamic library file - // FIXME: Also do this for Windows once incremental post-optimization stage0 tests
@@ -214,7 +214,7 @@ index 27bbc8bd8f..a6fc4df2eb 100644 - let can_be_rustc_dynamic_dep = if builder - .link_std_into_rustc_driver(target_compiler.host) - && !target_compiler.host.is_windows() -+ if (is_dylib(&filename) || is_debug_info(&filename)) && !proc_macros.contains(&filename) ++ if (is_dylib(Path::new(&filename)) || is_debug_info(&filename)) && !proc_macros.contains(&filename) { - let is_std = filename.starts_with("std-") || filename.starts_with("libstd-"); - !is_std
meta/recipes-devtools/rust/files/rv32-cargo-rustix-0.38.37-fix.patch deleted +0 -103
103 lines not on this page · raw message
meta/recipes-devtools/rust/files/rv32-cargo-rustix-0.38.38-fix.patch new file +236 -0
236 lines not on this page · raw message
meta/recipes-devtools/rust/libstd-rs_1.84.1.bb renamed from meta/recipes-devtools/rust/libstd-rs_1.83.0.bb +0 -0
meta/recipes-devtools/rust/rust-cross-canadian_1.84.1.bb renamed from meta/recipes-devtools/rust/rust-cross-canadian_1.83.0.bb +0 -0
meta/recipes-devtools/rust/rust-llvm/0001-NFC-fix-build-failure-100993.patch deleted +0 -30
@@ -1,30 +0,0 @@ -From 40b4fd7a3e81d32b29364a1b15337bcf817659c0 Mon Sep 17 00:00:00 2001 -From: Chen Zheng <[email protected]> -Date: Tue, 30 Jul 2024 09:02:07 +0800 -Subject: [PATCH] [NFC] fix build failure (#100993) - -Fix the build failure caused by -https://github.com/llvm/llvm-project/pull/94944 - -Fixes https://github.com/llvm/llvm-project/issues/100296 -Upstream-Status: Backport [https://github.com/llvm/llvm-project/commit/40b4fd7a3e81d32b29364a1b15337bcf817659c0] -Signed-off-by: Khem Raj <[email protected]> ---- - llvm/lib/Analysis/ConstantFolding.cpp | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/llvm/lib/Analysis/ConstantFolding.cpp b/llvm/lib/Analysis/ConstantFolding.cpp -index 85ee231675d0..084647b1d9d9 100644 ---- a/llvm/lib/Analysis/ConstantFolding.cpp -+++ b/llvm/lib/Analysis/ConstantFolding.cpp -@@ -1782,8 +1782,8 @@ Constant *ConstantFoldFP(double (*NativeFP)(double), const APFloat &V, - } - - #if defined(HAS_IEE754_FLOAT128) && defined(HAS_LOGF128) --Constant *ConstantFoldFP128(long double (*NativeFP)(long double), -- const APFloat &V, Type *Ty) { -+Constant *ConstantFoldFP128(float128 (*NativeFP)(float128), const APFloat &V, -+ Type *Ty) { - llvm_fenv_clearexcept(); - float128 Result = NativeFP(V.convertToQuad()); - if (llvm_fenv_testexcept()) {
meta/recipes-devtools/rust/rust-llvm_1.84.1.bb renamed from meta/recipes-devtools/rust/rust-llvm_1.83.0.bb +1 -2
@@ -4,14 +4,13 @@ HOMEPAGE = "http://www.rust-lang.org" # check src/llvm-project/llvm/CMakeLists.txt for llvm version in use # -LLVM_RELEASE = "19.1.1" +LLVM_RELEASE = "19.1.5" require rust-source.inc SRC_URI += "file://0002-llvm-allow-env-override-of-exe-path.patch;striplevel=2 \ file://0001-AsmMatcherEmitter-sort-ClassInfo-lists-by-name-as-we.patch;striplevel=2 \ file://0003-llvm-fix-include-benchmarks.patch;striplevel=2 \ - file://0001-NFC-fix-build-failure-100993.patch;striplevel=2 \ " S = "${RUSTSRC}/src/llvm-project/llvm"
meta/recipes-devtools/rust/rust-snapshot.inc +39 -39
95 lines not on this page · raw message
meta/recipes-devtools/rust/rust-source.inc +2 -2
@@ -1,14 +1,14 @@ RUST_VERSION ?= "${@d.getVar('PV').split('-')[0]}" SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;name=rust \ - file://rv32-cargo-rustix-0.38.37-fix.patch;patchdir=${RUSTSRC} \ + file://rv32-cargo-rustix-0.38.38-fix.patch;patchdir=${RUSTSRC} \ file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \ file://repro-issue-fix-with-cc-crate-hashmap.patch;patchdir=${RUSTSRC} \ file://oeqa-selftest-Increase-timeout-in-process-sigpipe-ru.patch;patchdir=${RUSTSRC} \ file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \ file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \ " -SRC_URI[rust.sha256sum] = "7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11735760f97df" +SRC_URI[rust.sha256sum] = "e23ec747a06ffd3e94155046f40b6664ac152c9ee3c2adfd90353a7ccff24226" RUSTSRC = "${WORKDIR}/rustc-${RUST_VERSION}-src"
meta/recipes-devtools/rust/rust_1.84.1.bb renamed from meta/recipes-devtools/rust/rust_1.83.0.bb +0 -0
Signature · 1 line
2.43.0
PATCH 5/5 rust: Oe-selftest changes for rust v1.84.1
In reply to [email protected]From: Deepesh Varatharajan <[email protected]>
Ignore the failing unit test.
The tidy check failed due to a typo, which was already reported and fixed in the Rust upstream. I have backported that patch to resolve the issue.
--- .../rust/files/fix-tidy-check-failure.patch | 19 +++++++++++++++++++ .../rust/files/rust-oe-selftest.patch | 12 ++++++++++++ meta/recipes-devtools/rust/rust-source.inc | 1 + 3 files changed, 32 insertions(+) create mode 100644 meta/recipes-devtools/rust/files/fix-tidy-check-failure.patch
meta/recipes-devtools/rust/files/fix-tidy-check-failure.patch new file +19 -0
@@ -0,0 +1,19 @@ +fix a comment with uneven number of backticks in rustc_mir_build + +Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/8e7734978245522cbbd14e53e08e888faf031ded] + +Signed-off-by: Deepesh Varatharajan <[email protected]> +--- +diff --git a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs +index 3f89e33778..c66af11845 100644 +--- a/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs ++++ b/compiler/rustc_mir_build/src/build/expr/as_rvalue.rs +@@ -231,7 +231,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> { + if range.start <= range.end { BinOp::BitAnd } else { BinOp::BitOr }; + + let mut comparer = |range: u128, bin_op: BinOp| -> Place<'tcx> { +- // We can use `ty::TypingEnv::fully_monomorphized()`` here ++ // We can use `ty::TypingEnv::fully_monomorphized()` here + // as we only need it to compute the layout of a primitive. + let range_val = Const::from_bits( + this.tcx,
meta/recipes-devtools/rust/files/rust-oe-selftest.patch +12 -0
@@ -469,3 +469,15 @@ index 14e6013f96..b670f27ab4 100644 #[cfg_attr(miri, ignore)] fn $test_fn_name() { $crate::sort::tests::$test_fn_name::<$sort_impl>(); +diff --git a/compiler/rustc_data_structures/src/vec_cache/tests.rs b/compiler/rustc_data_structures/src/vec_cache/tests.rs +index a05f274136..0e69b4cb98 100644 +--- a/compiler/rustc_data_structures/src/vec_cache/tests.rs ++++ b/compiler/rustc_data_structures/src/vec_cache/tests.rs +@@ -17,6 +17,7 @@ fn vec_cache_insert_and_check() { + } + + #[test] ++#[ignore] + fn sparse_inserts() { + let cache: VecCache<u32, u8, u32> = VecCache::default(); + let end = if cfg!(target_pointer_width = "64") && cfg!(target_os = "linux") {
meta/recipes-devtools/rust/rust-source.inc +1 -0
@@ -7,6 +7,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n file://oeqa-selftest-Increase-timeout-in-process-sigpipe-ru.patch;patchdir=${RUSTSRC} \ file://0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch;patchdir=${RUSTSRC} \ file://revert-link-std-statically-in-rustc_driver-feature.patch;patchdir=${RUSTSRC} \ + file://fix-tidy-check-failure.patch;patchdir=${RUSTSRC} \ " SRC_URI[rust.sha256sum] = "e23ec747a06ffd3e94155046f40b6664ac152c9ee3c2adfd90353a7ccff24226"
Signature · 1 line
2.43.0
Quoted 23 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan <[email protected]>
Remove the "src/gcc" directory from the Rust source code to reduce the filesystem build space.
In Rust 1.83 (and 1.84), a full GCC-14 tree was included, which caused the tar.xz archive to increase by 128 MB and the unpacked sources to grow by 1.3 GB. This was an upstream error that has been resolved in Rust 1.85.
After updating to Rust 1.85 we can revert this removal of "gcc/src"
Signed-off-by Deepesh Varatharajan <[email protected]>--- meta/recipes-devtools/rust/rust_1.83.0.bb | 10 ++++++++++ 1 file changed, 10 insertions(+)meta/recipes-devtools/rust/rust_1.83.0.bb +0
-0
meta/recipes-devtools/rust/rust_1.83.0.bb setup_cargo_environment () { · line 52
Quoted 3 lines
meta/recipes-devtools/rust/rust_1.83.0.bb +0
-0@@ -50,6 +50,16 @@ setup_cargo_environment () { inherit rust-target-config
Lets add a comment here to remind us about removal with/when 1.85 is brought in.
Quoted 25 lines
meta/recipes-devtools/rust/rust_1.83.0.bb +10
-1+do_unpack:append() { + import os + import shutil + + # Remove gcc directory after unpacking + gcc_dir = os.path.join(d.getVar('S'), 'src', 'gcc') + if os.path.isdir(gcc_dir): + shutil.rmtree(gcc_dir) +} + do_rust_setup_snapshot () { for installer in "${UNPACKDIR}/rust-snapshot-components/"*"/install.sh"; do "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig --2.43.0
-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#213451): https://lists.openembedded.org/g/openembedded-core/message/213451
Mute This Topic: https://lists.openembedded.org/mt/111827574/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-
Quoted 35 lines · Deepesh via lists.openembedded.org
From: Deepesh Varatharajan <[email protected]>
Remove the "src/gcc" directory from the Rust source code to reduce the filesystem build space.
In Rust 1.83 (and 1.84), a full GCC-14 tree was included, which caused the tar.xz archive to increase by 128 MB and the unpacked sources to grow by 1.3 GB. This was an upstream error that has been resolved in Rust 1.85.
After updating to Rust 1.85 we can revert this removal of "gcc/src"
Signed-off-by Deepesh Varatharajan <[email protected]>---
meta/recipes-devtools/rust/rust_1.83.0.bb | 10 ++++++++++1 file changed, 10 insertions(+)meta/recipes-devtools/rust/rust_1.83.0.bb +0
-0@@ -50,6 +50,16 @@ setup_cargo_environment () {
inherit rust-target-configmeta/recipes-devtools/rust/rust_1.83.0.bb +10
-0+do_unpack:append() { + import os + import shutil + + # Remove gcc directory after unpacking + gcc_dir = os.path.join(d.getVar('S'), 'src', 'gcc') + if os.path.isdir(gcc_dir): + shutil.rmtree(gcc_dir) +} +
Quoted 3 lines
do_rust_setup_snapshot () {
for installer in "${UNPACKDIR}/rust-snapshot-components/"*"/install.sh"; do "${installer}" --prefix="${WORKDIR}/rust-snapshot" --disable-ldconfig
Thanks for the patch, it is important we fix this. Unfortunately this change isn't quite enough. We need to apply it to all users of the rust source, so it needs to be in the rust-source.inc file, not in the rust recipe.
Secondly, this would be better done as a postfunc for the do_unpack task, so it can be a separate function rather than a append. For example:
base.bbclass:do_unpack[postfuncs] += "create_source_date_epoch_stamp"
Cheers,
Richard