Skip to contentSkip to conversation

rust: Upgrade 1.94.1 -> 1.95.0

PATCH New [email protected] 1 participant 1 message May 15

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 rust: Upgrade 1.94.1 -> 1.95.0

From: Deepesh Varatharajan <[email protected]>

Rust Changes:
https://github.com/rust-lang/rust/releases/tag/1.95.0

Cargo Changes:
https://doc.rust-lang.org/nightly/cargo/CHANGELOG.html#cargo-195-2026-04-16

Drop merged patches:
0001-Adjust-loongarch-assembly-test.patch
0001-Fix-flaky-assertions-in-oneshot-tests.patch
0001-Update-amdgpu-data-layout.patch

Updated patches:
0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch rust-oe-selftest.patch

New patch:
0002-Fix-rust-build-failure-with-unstable-options.patch

Fix rust build failure with unstable options.
Remove the check that errors out when -Zunstable-options is not provided for custom targets.The original upstream change (and its follow-up) mainly ensured GitHub workflows and tests work correctly by explicitly passing "-Zunstable-options", along with related testcase updates. Reverting the entire commit would also undo those unrelated workflow and test adjustments, so this patch only targets the specific enforcement logic without affecting the rest of the changes.
https://github.com/rust-lang/rust/issues/155963

Selftest Changes:
Skip two failing tests
src/librustdoc
src/tools/rustdoc
https://github.com/rust-lang/rust/pull/153409

Excluded tests:

+--------+----------+---------+
| Before  |  After  | Skipped |
+---------+---------+---------+
|   37    |   39    |   +2    |
+--------+----------+---------+

Test results:

rust v1.95.0

+-------------+---------+---------+
| Machine     | Passed  | Skipped |
+-------------+---------+---------+
| qemux86-64  |  22187  |   689   |
| qemux86     |  21929  |   947   |
| qemuarm64   |  21994  |   882   |
| qemuarm     |  21910  |   966   |
| qemuriscv64 |  21955  |   921   |
+-------------+---------+---------+

Test results difference (1.95.0 - 1.94.1):

+-------------+--------+---------+
| Machine     | Passed | Skipped |
+-------------+--------+---------+
| qemux86-64  |  +276  |   +29   |
| qemux86     |  +271  |   +34   |
| qemuarm64   |  +271  |   +34   |
| qemuarm     |  +271  |   +34   |
| qemuriscv64 |  +270  |   +35   |
+-------------+--------+---------+
---
 meta/conf/distro/include/tcmode-default.inc   |   2 +-
 meta/lib/oeqa/selftest/cases/rust.py          |   2 +-
 .../rust/{cargo_1.94.1.bb => cargo_1.95.0.bb} |   0
 .../0001-Adjust-loongarch-assembly-test.patch |  66 -----------
 ...ix-flaky-assertions-in-oneshot-tests.patch |  72 ------------
 .../0001-Update-amdgpu-data-layout.patch      |  44 --------
 ...teps-tool.rs-switch-off-lto-for-rust.patch |   4 +-
 ...-build-failure-with-unstable-options.patch |  63 +++++++++++
 .../rust/files/rust-oe-selftest.patch         |  20 +++-
 ...ibstd-rs_1.94.1.bb => libstd-rs_1.95.0.bb} |   0
 ....94.1.bb => rust-cross-canadian_1.95.0.bb} |   0
 meta/recipes-devtools/rust/rust-snapshot.inc  | 104 +++++++++---------
 meta/recipes-devtools/rust/rust-source.inc    |   6 +-
 .../rust/{rust_1.94.1.bb => rust_1.95.0.bb}   |   0
 14 files changed, 135 insertions(+), 248 deletions(-)
 rename meta/recipes-devtools/rust/{cargo_1.94.1.bb => cargo_1.95.0.bb} (100%)
 delete mode 100644 meta/recipes-devtools/rust/files/0001-Adjust-loongarch-assembly-test.patch
 delete mode 100644 meta/recipes-devtools/rust/files/0001-Fix-flaky-assertions-in-oneshot-tests.patch
 delete mode 100644 meta/recipes-devtools/rust/files/0001-Update-amdgpu-data-layout.patch
 create mode 100644 meta/recipes-devtools/rust/files/0002-Fix-rust-build-failure-with-unstable-options.patch
 rename meta/recipes-devtools/rust/{libstd-rs_1.94.1.bb => libstd-rs_1.95.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust-cross-canadian_1.94.1.bb => rust-cross-canadian_1.95.0.bb} (100%)
 rename meta/recipes-devtools/rust/{rust_1.94.1.bb => rust_1.95.0.bb} (100%)
meta/conf/distro/include/tcmode-default.inc +1 -1
index d2dd5abc03..3c956dfb12 100644
@@ -12,7 +12,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
 GCCVERSION ?= "15.%"
 SDKGCCVERSION ?= "${GCCVERSION}"
 GLIBCVERSION ?= "2.43%"
-RUSTVERSION ?= "1.94.1%"
+RUSTVERSION ?= "1.95.0%"
 
 PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
 PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"
meta/lib/oeqa/selftest/cases/rust.py +1 -1
index 72ffa5f234..c961a8f652 100644
@@ -102,7 +102,7 @@ class RustSelfTestSystemEmulated(OESelftestTestCase, OEPTestResultTestCase):
 
         exclude_fail_tests = " ".join([" --exclude " + item for item in exclude_list])
         # Add exclude_fail_tests with other test arguments
-        testargs =  exclude_fail_tests + " --no-doc --no-fail-fast --bless"
+        testargs =  exclude_fail_tests + " --no-doc --no-fail-fast --bless --skip src/librustdoc --skip src/tools/rustdoc"
 
         # wrap the execution with a qemu instance.
         # Set QEMU RAM to 1024MB to support running unit tests for the compiler crate, including larger
meta/recipes-devtools/rust/cargo_1.95.0.bb renamed from meta/recipes-devtools/rust/cargo_1.94.1.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/cargo_1.94.1.bb
rename to meta/recipes-devtools/rust/cargo_1.95.0.bb
meta/recipes-devtools/rust/files/0001-Adjust-loongarch-assembly-test.patch deleted +0 -66

66 lines not on this page · raw message

meta/recipes-devtools/rust/files/0001-Fix-flaky-assertions-in-oneshot-tests.patch deleted +0 -72

72 lines not on this page · raw message

meta/recipes-devtools/rust/files/0001-Update-amdgpu-data-layout.patch deleted +0 -44

44 lines not on this page · raw message

meta/recipes-devtools/rust/files/0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch +2 -2
index a8232b928a..35ebf3b96c 100644
@@ -42,7 +42,7 @@ index 087df2f8a..00790affb 100644
  use crate::utils::exec::{BootstrapCommand, command};
  use crate::utils::helpers::{add_dylib_path, exe, t};
  use crate::{Compiler, FileType, Kind, Mode};
-@@ -121,22 +119,7 @@ impl Step for ToolBuild {
+@@ -121,22 +121,7 @@ impl Step for ToolBuild {
              cargo.env("RUSTC_WRAPPER", ccache);
          }
 
@@ -58,7 +58,7 @@ index 087df2f8a..00790affb 100644
 -                RustcLto::ThinLocal => None,
 -            };
 -            if let Some(lto) = lto {
--                cargo.env(cargo_profile_var("LTO", &builder.config), lto);
+-                cargo.env(cargo_profile_var("LTO", &builder.config, self.mode), lto);
 -            }
 -        }
 -
meta/recipes-devtools/rust/files/0002-Fix-rust-build-failure-with-unstable-options.patch new file +63 -0

63 lines not on this page · raw message

meta/recipes-devtools/rust/files/rust-oe-selftest.patch +14 -6
index 9cbfc62b35..0ecfc7cad4 100644
@@ -22,7 +22,7 @@ diff --git a/compiler/rustc_errors/src/markdown/tests/term.rs b/compiler/rustc_e
 diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs
 --- a/compiler/rustc_interface/src/tests.rs
 +++ b/compiler/rustc_interface/src/tests.rs
-@@ -147,6 +147,7 @@ fn assert_non_crate_hash_different(x: &Options, y: &Options) {
+@@ -144,6 +144,7 @@ fn assert_non_crate_hash_different(x: &Options, y: &Options) {
 
  // When the user supplies --test we should implicitly supply --cfg test
  #[test]
@@ -30,7 +30,7 @@ diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/sr
  fn test_switch_implies_cfg_test() {
      sess_and_cfg(&["--test"], |_sess, cfg| {
          assert!(cfg.contains(&(sym::test, None)));
-@@ -155,6 +156,7 @@ fn test_switch_implies_cfg_test() {
+@@ -152,6 +153,7 @@ fn test_switch_implies_cfg_test() {
 
  // When the user supplies --test and --cfg test, don't implicitly add another --cfg test
  #[test]
@@ -38,7 +38,7 @@ diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/sr
  fn test_switch_implies_cfg_test_unless_cfg_test() {
      sess_and_cfg(&["--test", "--cfg=test"], |_sess, cfg| {
          let mut test_items = cfg.iter().filter(|&&(name, _)| name == sym::test);
-@@ -164,6 +166,7 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
+@@ -161,6 +163,7 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
  }
 
  #[test]
@@ -128,7 +128,7 @@ diff --git a/library/std/tests/sync/mutex.rs b/library/std/tests/sync/mutex.rs
  fn test_mutex_arc_poison_mapped() {
      let arc = Arc::new(Mutex::new(1));
      assert!(!arc.is_poisoned());
-@@ -457,6 +458,7 @@
+@@ -456,6 +457,7 @@
  
  #[test]
  #[cfg_attr(not(panic = "unwind"), ignore = "test requires unwinding support")]
@@ -176,7 +176,7 @@ diff --git a/library/alloctests/tests/sort/tests.rs b/library/alloctests/tests/s
 index 14e6013f96..b670f27ab4 100644
 --- a/library/alloctests/tests/sort/tests.rs
 +++ b/library/alloctests/tests/sort/tests.rs
-@@ -922,12 +922,14 @@ gen_sort_test_fns_with_default_patterns_3_ty!(
+@@ -929,12 +929,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]
@@ -271,11 +271,19 @@ diff --git a/compiler/rustc/src/main.rs b/compiler/rustc/src/main.rs
 index 89c61cd..144ea0e 100644
 --- a/compiler/rustc/src/main.rs
 +++ b/compiler/rustc/src/main.rs
+@@ -3,6 +3,7 @@
+ // Several crates are depended upon but unused so that they are present in the sysroot
+ #![expect(unused_crate_dependencies)]
+
++#[allow(unused_imports)]
+ use std::process::ExitCode;
+
+ // A note about jemalloc: rustc uses jemalloc when built for CI and
 @@ -38,6 +38,7 @@
  #[cfg(feature = "jemalloc")]
  use tikv_jemalloc_sys as _;
 
 +#[cfg(not(test))]
- fn main() {
+ fn main() -> ExitCode {
      rustc_driver::main()
  }
meta/recipes-devtools/rust/libstd-rs_1.95.0.bb renamed from meta/recipes-devtools/rust/libstd-rs_1.94.1.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/libstd-rs_1.94.1.bb
rename to meta/recipes-devtools/rust/libstd-rs_1.95.0.bb
meta/recipes-devtools/rust/rust-cross-canadian_1.95.0.bb renamed from meta/recipes-devtools/rust/rust-cross-canadian_1.94.1.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/rust-cross-canadian_1.94.1.bb
rename to meta/recipes-devtools/rust/rust-cross-canadian_1.95.0.bb
meta/recipes-devtools/rust/rust-snapshot.inc +52 -52

110 lines not on this page · raw message

meta/recipes-devtools/rust/rust-source.inc +2 -4
index f11bbea9b3..c5771e1932 100644
@@ -7,12 +7,10 @@ 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://0001-riscv32-Define-plain-syscalls-as-their-time64-varian.patch;patchdir=${RUSTSRC} \
             file://0001-Update-call-llvm-intrinsics-test.patch;patchdir=${RUSTSRC} \
-            file://0001-Fix-flaky-assertions-in-oneshot-tests.patch;patchdir=${RUSTSRC} \
-            file://0001-Update-amdgpu-data-layout.patch;patchdir=${RUSTSRC} \
-            file://0001-Adjust-loongarch-assembly-test.patch;patchdir=${RUSTSRC} \
             file://0001-Fix-multiple-option-or-permutations-test-for-big-end.patch;patchdir=${RUSTSRC} \
+            file://0002-Fix-rust-build-failure-with-unstable-options.patch;patchdir=${RUSTSRC} \
 "
-SRC_URI[rust.sha256sum] = "174fce10ce012317ca995810296d8af199318838180b03d68a853e0f02d4b571"
+SRC_URI[rust.sha256sum] = "62b67230754da642a264ca0cb9fc08820c54e2ed7b3baba0289876d4cdb48c08"
 
 RUSTSRC = "${UNPACKDIR}/rustc-${RUST_VERSION}-src"
 
meta/recipes-devtools/rust/rust_1.95.0.bb renamed from meta/recipes-devtools/rust/rust_1.94.1.bb +0 -0
similarity index 100%
rename from meta/recipes-devtools/rust/rust_1.94.1.bb
rename to meta/recipes-devtools/rust/rust_1.95.0.bb
Signature · 1 line
2.49.0