Skip to contentSkip to conversation

rust: Fix bloat issue in recent rust updates

PATCH In review [email protected] 2 participants 6 messages Mar 27, 2025

lore
Share & tools
lore
#0 lore raw

PATCH v2 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 "src/gcc"

---
 meta/recipes-devtools/rust/rust-source.inc | 11 +++++++++++
 1 file changed, 11 insertions(+)
meta/recipes-devtools/rust/rust-source.inc +11 -0
index 838544e089..40fc237a62 100644
@@ -13,6 +13,17 @@ SRC_URI[rust.sha256sum] = "7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11
 
 RUSTSRC = "${WORKDIR}/rustc-${RUST_VERSION}-src"
 
+#After updating to Rust 1.85 we can revert this removal of "src/gcc"
+remove_gcc_directory() {
+    # Ensure the gcc directory exists
+    gcc_dir="${S}/src/gcc"
+    if [ -d "$gcc_dir" ]; then
+        rm -rf "$gcc_dir"
+    fi
+}
+# Add postfunc to the do_unpack task
+do_unpack[postfuncs] += "remove_gcc_directory"
+
 UPSTREAM_CHECK_URI = "https://forge.rust-lang.org/infra/other-installation-methods.html"
 UPSTREAM_CHECK_REGEX = "rustc-(?P<pver>\d+(\.\d+)+)-src"
 
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 2/5 rust: Fix build break because of "download-rustc" and "llvm-tools"

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
index cd470b1883..ee8c782ce3 100644
@@ -137,6 +137,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
#2 lore raw

PATCH v2 3/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 the below patches :
0001-NFC-fix-build-failure-100993.patch
https://github.com/llvm/llvm-project/commit/6ee49080e4bb43efe7ede10bed15935853bbd434

revert-Zdual-proc-macros-additional-check.patch Issue is fixed in rust-master and the fix is backported in the subsequent patch of the series.

---
 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 +---
 ...t-Zdual-proc-macros-additional-check.patch |  43 ----
 ...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    |   5 +-
 .../rust/{rust_1.83.0.bb => rust_1.84.1.bb}   |   0
 14 files changed, 298 insertions(+), 291 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/revert-Zdual-proc-macros-additional-check.patch
 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
index cbe8442cde..ddfba7256a 100644
@@ -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
similarity index 100%
rename from meta/recipes-devtools/rust/cargo_1.83.0.bb
rename to meta/recipes-devtools/rust/cargo_1.84.1.bb
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-Zdual-proc-macros-additional-check.patch deleted +0 -43

43 lines not on this page · raw message

meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch +18 -18
index 407d701bad..0ba0921f59 100644
@@ -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
similarity index 100%
rename from meta/recipes-devtools/rust/libstd-rs_1.83.0.bb
rename to meta/recipes-devtools/rust/libstd-rs_1.84.1.bb
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
similarity index 100%
rename from meta/recipes-devtools/rust/rust-cross-canadian_1.83.0.bb
rename to meta/recipes-devtools/rust/rust-cross-canadian_1.84.1.bb
meta/recipes-devtools/rust/rust-llvm/0001-NFC-fix-build-failure-100993.patch deleted +0 -30
deleted file mode 100644
index ed26de73ce..0000000000
@@ -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
similarity index 97%
rename from meta/recipes-devtools/rust/rust-llvm_1.83.0.bb
rename to meta/recipes-devtools/rust/rust-llvm_1.84.1.bb
index 17d49be4ef..6a4d295728 100644
@@ -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 -3
index 40fc237a62..28f5aebbb4 100644
@@ -1,15 +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} \
-	    file://revert-Zdual-proc-macros-additional-check.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
similarity index 100%
rename from meta/recipes-devtools/rust/rust_1.83.0.bb
rename to meta/recipes-devtools/rust/rust_1.84.1.bb
Signature · 1 line
2.43.0
#3 lore raw

Patchtest results for [PATCH V2 3/5] rust: Upgrade 1.83.0->1.84.1

Thank you for your submission. Patchtest identified one or more issues with the patch. Please see the log below for more information:

---
Testing patch /home/patchtest/share/mboxes/V2-3-5-rust-Upgrade-1.83.0--1.84.1.patch

FAIL: test src uri left files: Patches not removed from tree. Remove them and amend the submitted mbox (test_metadata.TestMetadata.test_src_uri_left_files)

PASS: pretest src uri left files (test_metadata.TestMetadata.pretest_src_uri_left_files)
PASS: test CVE check ignore (test_metadata.TestMetadata.test_cve_check_ignore)
PASS: test CVE tag format (test_patch.TestPatch.test_cve_tag_format)
PASS: test Signed-off-by presence (test_mbox.TestMbox.test_signed_off_by_presence)
PASS: test Signed-off-by presence (test_patch.TestPatch.test_signed_off_by_presence)
PASS: test Upstream-Status presence (test_patch.TestPatch.test_upstream_status_presence_format)
PASS: test author valid (test_mbox.TestMbox.test_author_valid)
PASS: test commit message presence (test_mbox.TestMbox.test_commit_message_presence)
PASS: test commit message user tags (test_mbox.TestMbox.test_commit_message_user_tags)
PASS: test lic files chksum modified not mentioned (test_metadata.TestMetadata.test_lic_files_chksum_modified_not_mentioned)
PASS: test max line length (test_metadata.TestMetadata.test_max_line_length)
PASS: test mbox format (test_mbox.TestMbox.test_mbox_format)
PASS: test non-AUH upgrade (test_mbox.TestMbox.test_non_auh_upgrade)
PASS: test shortlog format (test_mbox.TestMbox.test_shortlog_format)
PASS: test shortlog length (test_mbox.TestMbox.test_shortlog_length)
PASS: test target mailing list (test_mbox.TestMbox.test_target_mailing_list)

SKIP: pretest pylint: No python related patches, skipping test (test_python_pylint.PyLint.pretest_pylint)
SKIP: test bugzilla entry format: No bug ID found (test_mbox.TestMbox.test_bugzilla_entry_format)
SKIP: test lic files chksum presence: No added recipes, skipping test (test_metadata.TestMetadata.test_lic_files_chksum_presence)
SKIP: test license presence: No added recipes, skipping test (test_metadata.TestMetadata.test_license_presence)
SKIP: test pylint: No python related patches, skipping test (test_python_pylint.PyLint.test_pylint)
SKIP: test series merge on head: Merge test is disabled for now (test_mbox.TestMbox.test_series_merge_on_head)
SKIP: test summary presence: No added recipes, skipping test (test_metadata.TestMetadata.test_summary_presence)

---

Please address the issues identified and
submit a new revision of the patch, or alternatively, reply to this email with an explanation of why the patch should be accepted. If you believe these results are due to an error in patchtest, please submit a bug at https://bugzilla.yoctoproject.org/ (use the 'Patchtest' category under 'Yocto Project Subprojects'). For more information on specific failures, see: https://wiki.yoctoproject.org/wiki/Patchtest. Thank you!

#4 lore raw

PATCH v2 4/5 rust: Fix build failure when multilibs are enabled

In reply to [email protected]

From: Deepesh Varatharajan <[email protected]>

When multilibs are enabled, building rust is failing because of the following commit
https://github.com/rust-lang/rust/commit/68034f837a39387e49fc7d7c5b088f5372a1127e
with stage1/rustc cannot able to find dependent *.so files. The issue is been fixed inrust-master with the following commit by passing the necessary library paths before executing stage1/rustc

Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/139d6ba054a1a4cc5fe64981ad46fd5547bd4916]

---
 .../Zdual-proc-macros-additional-check.patch  | 31 +++++++++++++++++++
 meta/recipes-devtools/rust/rust-source.inc    |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta/recipes-devtools/rust/files/Zdual-proc-macros-additional-check.patch
meta/recipes-devtools/rust/files/Zdual-proc-macros-additional-check.patch new file +31 -0
new file mode 100644
index 0000000000..6bb1738d05
@@ -0,0 +1,31 @@
+Fix bootstrap failure when multilibs are enabled.
+
+Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/139d6ba054a1a4cc5fe64981ad46fd5547bd4916]
+
+Signed-off-by: Deepesh Varatharajan <[email protected]>
+---
+diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
+index 066e6bf53f..a2f6fac4b1 100644
+--- a/src/bootstrap/src/core/builder/cargo.rs
++++ b/src/bootstrap/src/core/builder/cargo.rs
+@@ -646,7 +646,10 @@ impl Builder<'_> {
+                 // 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))
++                    let mut rustc_cmd = command(self.rustc(compiler));
++                    self.add_rustc_lib_path(compiler, &mut rustc_cmd);
++
++                    let error = rustc_cmd
+                         .arg("--target")
+                         .arg(target.rustc_target_arg())
+                         .arg("--print=file-names")
+@@ -654,6 +657,7 @@ impl Builder<'_> {
+                         .arg("-")
+                         .run_capture(self)
+                         .stderr();
++
+                     let not_supported = error
+                         .lines()
+                         .any(|line| line.contains("unsupported crate type `proc-macro`"));
+
meta/recipes-devtools/rust/rust-source.inc +1 -0
index 28f5aebbb4..ee23e5aa8b 100644
@@ -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://Zdual-proc-macros-additional-check.patch;patchdir=${RUSTSRC} \
 "
 SRC_URI[rust.sha256sum] = "e23ec747a06ffd3e94155046f40b6664ac152c9ee3c2adfd90353a7ccff24226"
 
Signature · 1 line
2.43.0
#5 lore raw

PATCH v2 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.

Upstream-Status: Backport [https://github.com/rust-lang/rust/commit/8e7734978245522cbbd14e53e08e888faf031ded]

---
 .../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
new file mode 100644
index 0000000000..54b4ee690b
@@ -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
index dd22ced57d..7e5854a62a 100644
@@ -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
index ee23e5aa8b..92bb5e4779 100644
@@ -8,6 +8,7 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n
             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://Zdual-proc-macros-additional-check.patch;patchdir=${RUSTSRC} \
+	    file://fix-tidy-check-failure.patch;patchdir=${RUSTSRC} \
 "
 SRC_URI[rust.sha256sum] = "e23ec747a06ffd3e94155046f40b6664ac152c9ee3c2adfd90353a7ccff24226"
 
Signature · 1 line
2.43.0