Skip to contentSkip to conversation

rust: Upgrade 1.82.0->1.83.0

PATCH Superseded [email protected] 2 participants 6 messages Mar 3, 2025 – Mar 4, 2025

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/3 rust: Upgrade 1.82.0->1.83.0

From: Deepesh Varatharajan <[email protected]>

Rust stable version updated to 1.83.0.
https://blog.rust-lang.org/2024/11/28/Rust-1.83.0.html

Renamed and modified the below patch to adapt the new version. rv32-cargo-rustix-0.38.34-fix.patch->rv32-cargo-rustix-0.38.37-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: zlib-off64_t.patch
https://github.com/madler/zlib/commit/a566e156b3fa07b566ddbf6801b517a9dba04fa3kq

---
 meta/conf/distro/include/tcmode-default.inc   |  2 +-
 .../rust/{cargo_1.82.0.bb => cargo_1.83.0.bb} |  0
 ...epro-issue-fix-with-cc-crate-hashmap.patch | 97 +++++--------------
 ...d-statically-in-rustc_driver-feature.patch | 65 ++++++++++++-
 ...ibstd-rs_1.82.0.bb => libstd-rs_1.83.0.bb} |  0
 ....82.0.bb => rust-cross-canadian_1.83.0.bb} |  0
 ...ust-llvm_1.82.0.bb => rust-llvm_1.83.0.bb} |  0
 meta/recipes-devtools/rust/rust-snapshot.inc  | 76 +++++++--------
 meta/recipes-devtools/rust/rust-source.inc    |  5 +-
 .../rust/{rust_1.82.0.bb => rust_1.83.0.bb}   |  1 +
 10 files changed, 128 insertions(+), 118 deletions(-)
 rename meta/recipes-devtools/rust/{cargo_1.82.0.bb => cargo_1.83.0.bb} (100%)
 rename meta/recipes-devtools/rust/{libstd-rs_1.82.0.bb => libstd-rs_1.83.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust-cross-canadian_1.82.0.bb => rust-cross-canadian_1.83.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust-llvm_1.82.0.bb => rust-llvm_1.83.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust_1.82.0.bb => rust_1.83.0.bb} (99%)
meta/conf/distro/include/tcmode-default.inc +1 -1
index 13f31d46de..f7a6cf0283 100644
@@ -28,7 +28,7 @@ GLIBCVERSION ?= "2.41%"
 LINUXLIBCVERSION ?= "6.12%"
 QEMUVERSION ?= "9.2%"
 GOVERSION ?= "1.22%"
-RUSTVERSION ?= "1.82%"
+RUSTVERSION ?= "1.83%"
 
 PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
 PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
meta/recipes-devtools/rust/cargo_1.83.0.bb renamed from meta/recipes-devtools/rust/cargo_1.82.0.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/cargo_1.82.0.bb
rename to meta/recipes-devtools/rust/cargo_1.83.0.bb
meta/recipes-devtools/rust/files/repro-issue-fix-with-cc-crate-hashmap.patch +25 -72

137 lines not on this page · raw message

meta/recipes-devtools/rust/files/revert-link-std-statically-in-rustc_driver-feature.patch +61 -4

92 lines not on this page · raw message

meta/recipes-devtools/rust/libstd-rs_1.83.0.bb renamed from meta/recipes-devtools/rust/libstd-rs_1.82.0.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/libstd-rs_1.82.0.bb
rename to meta/recipes-devtools/rust/libstd-rs_1.83.0.bb
meta/recipes-devtools/rust/rust-cross-canadian_1.83.0.bb renamed from meta/recipes-devtools/rust/rust-cross-canadian_1.82.0.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/rust-cross-canadian_1.82.0.bb
rename to meta/recipes-devtools/rust/rust-cross-canadian_1.83.0.bb
meta/recipes-devtools/rust/rust-llvm_1.83.0.bb renamed from meta/recipes-devtools/rust/rust-llvm_1.82.0.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/rust-llvm_1.82.0.bb
rename to meta/recipes-devtools/rust/rust-llvm_1.83.0.bb
meta/recipes-devtools/rust/rust-snapshot.inc +38 -38

94 lines not on this page · raw message

meta/recipes-devtools/rust/rust-source.inc +2 -3
index 0c0c9dcaa0..2d14ec64ca 100644
@@ -2,14 +2,13 @@ RUST_VERSION ?= "${@d.getVar('PV').split('-')[0]}"
 
 SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;name=rust \
             file://zlib-off64_t.patch;patchdir=${RUSTSRC} \
-            file://rv32-cargo-rustix-0.38.34-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://repro-issue-fix-with-cc-crate-hashmap.patch;patchdir=${RUSTSRC} \
 "
-SRC_URI[rust.sha256sum] = "1276a0bb8fa12288ba6fa96597d28b40e74c44257c051d3bc02c2b049bb38210"
+SRC_URI[rust.sha256sum] = "7b11d4242dab0921a7d54758ad3fe805153c979c144625fecde11735760f97df"
 
 RUSTSRC = "${WORKDIR}/rustc-${RUST_VERSION}-src"
 
meta/recipes-devtools/rust/rust_1.83.0.bb renamed from meta/recipes-devtools/rust/rust_1.82.0.bb +1 -0
similarity index 99%
rename from meta/recipes-devtools/rust/rust_1.82.0.bb
rename to meta/recipes-devtools/rust/rust_1.83.0.bb
index c4f8ee7108..2bf87ba27e 100644
@@ -132,6 +132,7 @@ python do_configure() {
     if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""):
         config.set("llvm", "use-libcxx", e(True))
 
+
     # [rust]
     config.add_section("rust")
     config.set("rust", "rpath", e(True))
Signature · 1 line
2.43.0
#1 lore raw

PATCH v2 2/3 rust: Fix build break because of download-ci-llvm

From: Deepesh Varatharajan <[email protected]>

-----------------------------------------------------------------------
| thread 'main' panicked at src/core/config/config.rs:2047:13:
| setting build-target.llvm-config is incompatible with download-ci-llvm.
-----------------------------------------------------------------------

Disable the automatic download of pre-built LLVM binaries, ensuring compatibility with local LLVM builds and preventing conflicts with other configuration settings.

---
 meta/recipes-devtools/rust/rust_1.83.0.bb | 1 +
 1 file changed, 1 insertion(+)
meta/recipes-devtools/rust/rust_1.83.0.bb +1 -0
index 2bf87ba27e..ffbac267b6 100644
@@ -129,6 +129,7 @@ python do_configure() {
     # [llvm]
     config.add_section("llvm")
     config.set("llvm", "static-libstdcpp", e(False))
+    config.set("llvm", "download-ci-llvm", e(False))
     if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""):
         config.set("llvm", "use-libcxx", e(True))
 
Signature · 1 line
2.43.0
#2 lore raw

Re: [PATCH V2 2/3] rust: Fix build break because of download-ci-llvm

Quoted 21 lines · On 03-03-2025 21:04, [email protected] wrote:

From: Deepesh Varatharajan <[email protected]>

-----------------------------------------------------------------------
| thread 'main' panicked at src/core/config/config.rs:2047:13:
| setting build-target.llvm-config is incompatible with download-ci-llvm.
-----------------------------------------------------------------------

Disable the automatic download of pre-built LLVM binaries, ensuring compatibility with local LLVM builds and preventing conflicts with other configuration settings.

---
  meta/recipes-devtools/rust/rust_1.83.0.bb | 1 +
  1 file changed, 1 insertion(+)
meta/recipes-devtools/rust/rust_1.83.0.bb +0 -0
index 2bf87ba27e..ffbac267b6 100644

meta/recipes-devtools/rust/rust_1.83.0.bb python do_configure() { · line 135

Quoted 7 lines
meta/recipes-devtools/rust/rust_1.83.0.bb +1 -0
@@ -129,6 +129,7 @@ python do_configure() {
      # [llvm]
      config.add_section("llvm")
      config.set("llvm", "static-libstdcpp", e(False))
+    config.set("llvm", "download-ci-llvm", e(False))
      if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""):
          config.set("llvm", "use-libcxx", e(True))
 

Hi All,

Previously, download-ci-llvm was set to false. However, with the following commit:
https://github.com/rust-lang/rust/commit/7d579046c80d3de3143dcb8b2db5640f95b5383c , which has been present from rust_1.83, it was changed to true. As a result, after updating to rust_1.83, we encountered the following error during the build:

--------------------------------------------------------------------------------------------------------------------

| thread 'main' panicked at src/core/config/config.rs:2047:13:
| setting build-target.llvm-config is incompatible with download-ci-llvm.
| note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

--------------------------------------------------------------------------------------------------------------------

To resolve this issue, we are setting download-ci-llvm back to false.

If no other issues seen in the AB , we will send a V3 with an explanatory commit message.

Regards,
Deepesh

#3 lore raw

Re: [OE-core] [PATCH V2 2/3] rust: Fix build break because of download-ci-llvm

Quoted 43 lines · Deepesh via lists.openembedded.org
Quoted 25 lines · On 03-03-2025 21:04, [email protected] wrote:

From: Deepesh Varatharajan <[email protected]>

-----------------------------------------------------------------------

Quoted 2 lines

thread 'main' panicked at src/core/config/config.rs:2047:13:
setting build-target.llvm-config is incompatible with download-ci-llvm.

-----------------------------------------------------------------------

Disable the automatic download of pre-built LLVM binaries, ensuring compatibility with local LLVM builds and preventing conflicts with other configuration settings.

---
  meta/recipes-devtools/rust/rust_1.83.0.bb | 1 +

  1 file changed, 1 insertion(+)
meta/recipes-devtools/rust/rust_1.83.0.bb +1 -0
index 2bf87ba27e..ffbac267b6 100644
@@ -129,6 +129,7 @@ python do_configure() {
       # [llvm]
       config.add_section("llvm")
       config.set("llvm", "static-libstdcpp", e(False))
+    config.set("llvm", "download-ci-llvm", e(False))
Quoted 3 lines

      if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""):
          config.set("llvm", "use-libcxx", e(True))

Hi All,

Previously, download-ci-llvm was set to false. However, with the following commit:
https://github.com/rust-lang/rust/commit/7d579046c80d3de3143dcb8b2db5640f95b5383c
, which has been present from rust_1.83,
it was changed to true. As a result, after updating to rust_1.83, we encountered the following error during the build:

--------------------------------------------------------------------------------------------------------------------

Quoted 3 lines

thread 'main' panicked at src/core/config/config.rs:2047:13:
setting build-target.llvm-config is incompatible with download-ci-llvm.
note: run with RUST_BACKTRACE=1 environment variable to display a

Quoted 7 lines

backtrace
--------------------------------------------------------------------------------------------------------------------

To resolve this issue, we are setting download-ci-llvm back to false.

If no other issues seen in the AB , we will send a V3 with an explanatory commit message.

Nothing was seen in testing so far so the series is looking ready to merge. How was the previous world build failure from v1 fixed out of interest?

Thanks,

Richard

#4 lore raw

Re: [OE-core] [PATCH V2 2/3] rust: Fix build break because of download-ci-llvm

Quoted 53 lines · Richard Purdie

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 42 lines · Deepesh via lists.openembedded.org
Quoted 21 lines · On 03-03-2025 21:04, [email protected] wrote:

From: Deepesh Varatharajan <[email protected]>

-----------------------------------------------------------------------

Quoted 2 lines

thread 'main' panicked at src/core/config/config.rs:2047:13:
setting build-target.llvm-config is incompatible with download-ci-llvm.

-----------------------------------------------------------------------

Disable the automatic download of pre-built LLVM binaries, ensuring compatibility with local LLVM builds and preventing conflicts with other configuration settings.

---
   meta/recipes-devtools/rust/rust_1.83.0.bb | 1 +
   1 file changed, 1 insertion(+)
meta/recipes-devtools/rust/rust_1.83.0.bb +0 -0
index 2bf87ba27e..ffbac267b6 100644

meta/recipes-devtools/rust/rust_1.83.0.bb python do_configure() { · line 135

Quoted 7 lines
meta/recipes-devtools/rust/rust_1.83.0.bb +1 -0
@@ -129,6 +129,7 @@ python do_configure() {
       # [llvm]
       config.add_section("llvm")
       config.set("llvm", "static-libstdcpp", e(False))
+    config.set("llvm", "download-ci-llvm", e(False))
       if "llvm" in (d.getVar('TC_CXX_RUNTIME') or ""):
           config.set("llvm", "use-libcxx", e(True))
 

Hi All,

Previously, download-ci-llvm was set to false. However, with the following commit:
https://github.com/rust-lang/rust/commit/7d579046c80d3de3143dcb8b2db5640f95b5383c
, which has been present from rust_1.83,
it was changed to true. As a result, after updating to rust_1.83, we encountered the following error during the build:

--------------------------------------------------------------------------------------------------------------------

Quoted 3 lines

thread 'main' panicked at src/core/config/config.rs:2047:13:
setting build-target.llvm-config is incompatible with download-ci-llvm.
note: run with RUST_BACKTRACE=1 environment variable to display a

Quoted 7 lines

backtrace
--------------------------------------------------------------------------------------------------------------------

To resolve this issue, we are setting download-ci-llvm back to false.

If no other issues seen in the AB , we will send a V3 with an explanatory commit message.

Quoted 7 lines

Nothing was seen in testing so far so the series is looking ready to merge. How was the previous world build failure from v1 fixed out of interest?

Thanks,

Richard

The issue which was seen in AB is because of the following commit https://github.com/rust-lang/rust/pull/131372/commits/68034f837a39387e49fc7d7c5b088f5372a1127e ,

When building Rust for a 64-bit architecture with lib32 enabled, the patch incorrectly prevents the addition of the -Zdual-proc-macros flag. This occurs because the check introduced by the patch detects an issue with proc macro support. The issue might stem from the -Zdual-proc-macros flag not functioning properly when lib32 is enabled in the build environment. As a result, the build fails when lib32 is enabled, but the issue does not occur when lib32 is disabled for 64-bit architectures. Hence for now, we reverted this patch.

Reverting this patch will restore 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.

Regards,
Deepesh

#5 lore raw

PATCH v2 3/3 rust: Oe-selftest changes for rust v1.83.0

In reply to [email protected]

From: Deepesh Varatharajan <[email protected]>

Few unit tests are failing for x86_64 arch.
Ignore the failing unit tests.

Upstream-Status: Pending

---
 .../rust/files/rust-oe-selftest.patch         | 46 +++++++++++++------
 1 file changed, 33 insertions(+), 13 deletions(-)
meta/recipes-devtools/rust/files/rust-oe-selftest.patch +33 -13
index 0e952efadc..dd22ced57d 100644
@@ -63,7 +63,7 @@ index 35a5291a347..5f2858d2505 100644
 
  #[test]
 +#[ignore]
- #[cfg_attr(target_os = "emscripten", ignore)]
+ #[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
  fn panic_in_write_doesnt_flush_in_drop() {
      static WRITES: AtomicUsize = AtomicUsize::new(0);
 diff --git a/library/std/src/io/stdio/tests.rs b/library/std/src/io/stdio/tests.rs
@@ -75,7 +75,7 @@ index f89fd27ce6c..79737f5b127 100644
 
  #[test]
 +#[ignore]
- #[cfg_attr(target_os = "emscripten", ignore)]
+ #[cfg_attr(any(target_os = "emscripten", target_os = "wasi"), ignore)] // no threads
  fn panic_doesnt_poison() {
      thread::spawn(|| {
 diff --git a/library/std/src/sync/mpsc/sync_tests.rs b/library/std/src/sync/mpsc/sync_tests.rs
@@ -318,17 +318,6 @@ index 5d6b9e94ee9..a5aacb2eb87 100644
  fn test_try_panic_any_message_unit_struct() {
      struct Juju;
 
-diff --git a/library/alloc/src/slice/tests.rs b/library/alloc/src/slice/tests.rs
---- a/library/alloc/src/slice/tests.rs
-+++ b/library/alloc/src/slice/tests.rs
-@@ -186,6 +186,7 @@
- std::thread_local!(static SILENCE_PANIC: Cell<bool> = Cell::new(false));
-
- #[test]
-+#[ignore]
- #[cfg_attr(target_os = "emscripten", ignore)] // no threads
- #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
- fn panic_safe() {
 diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs
 --- a/library/test/src/tests.rs
 +++ b/library/test/src/tests.rs
@@ -449,3 +438,34 @@ index 4d342c72cc..9a77f92616 100644
  fn arclones() {
      let value = 12u32;
      let arc = Arc::new(value);
+diff --git a/library/std/src/thread/local/tests.rs b/library/std/src/thread/local/tests.rs
+index 9d4f52a092..d425e5f7b7 100644
+--- a/library/std/src/thread/local/tests.rs
++++ b/library/std/src/thread/local/tests.rs
+@@ -346,6 +346,7 @@ fn join_orders_after_tls_destructors() {
+
+ // Test that thread::current is still available in TLS destructors.
+ #[test]
++#[ignore]
+ fn thread_current_in_dtor() {
+     // Go through one round of TLS destruction first.
+     struct Defer;
+diff --git a/library/alloc/tests/sort/tests.rs b/library/alloc/tests/sort/tests.rs
+index 14e6013f96..b670f27ab4 100644
+--- a/library/alloc/tests/sort/tests.rs
++++ b/library/alloc/tests/sort/tests.rs
+@@ -915,12 +915,14 @@ gen_sort_test_fns_with_default_patterns_3_ty!(
+ macro_rules! instantiate_sort_test_inner {
+     ($sort_impl:ty, miri_yes, $test_fn_name:ident) => {
+         #[test]
++        #[ignore]
+         fn $test_fn_name() {
+             $crate::sort::tests::$test_fn_name::<$sort_impl>();
+         }
+     };
+     ($sort_impl:ty, miri_no, $test_fn_name:ident) => {
+         #[test]
++        #[ignore]
+         #[cfg_attr(miri, ignore)]
+         fn $test_fn_name() {
+             $crate::sort::tests::$test_fn_name::<$sort_impl>();
Signature · 1 line
2.43.0