Skip to content

Commit e3a4fb6

Browse files
Yashinde145hsadinen
authored andcommitted
rust: Upgrade 1.85.1->1.86.0
* Add pkgconfig-native and openssl to resolve openssl-sys crate dependency on pkg-config. The exact commit was not found found, but the crate's document mentions it as the required dependecy. | error: failed to run custom build command for `openssl-sys v0.9.106` | Could not find openssl via pkg-config: | The pkg-config command could not be found. | | Most likely, you need to install a pkg-config package for your OS. | Try `apt install pkg-config`, or `yum install pkg-config`, | or `pkg install pkg-config`, or `apk add pkgconfig` depending on your distribution https://crates.io/crates/openssl-sys/0.9.108/dependencies https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies * Add Ninja as a dependency for building Rust to prevent bootstrap build regression. Fixes: | Building LLD for x86_64-unknown-linux-gnu | | Couldn't find required command: ninja (or ninja-build) | | You should install ninja as described at | <https://github.com/ninja-build/ninja/wiki/Pre-built-Ninja-packages>, | or set `ninja = false` in the `[llvm]` section of `config.toml`. | Alternatively, set `download-ci-llvm = true` in that `[llvm]` section | to download LLVM rather than building it. * Add bash to DEPENDS to resolve missing dependency for subtree-sync.sh Fixes: ERROR: rust-1.86.0-r0 do_package_qa: QA Issue: /usr/lib/rustlib/src/rust/library/portable-simd/subtree-sync.sh contained in package rust requires /bin/bash, but no providers found in RDEPENDS:rust? [file-rdeps] * Add do_install:append() task to remove cargo bin from rust native builds. This resolves the following conflict: Fixes: ERROR: libstd-rs-1.86.0-r0 do_prepare_recipe_sysroot: The file /usr/bin/cargo is installed by both rust-native and cargo-native, aborting * Update Unicode-3.0 license checksums. License-Update: Copyright and license files to distributions are updated. rust-lang/rust@f9c1699 It adds copyright and license files (including HTML versions) to distributions, aligns with license compliance tools like reuse, and ensures all required license texts are properly included and formatted. * The "remote-test-server" bin is now generated in stage2-tools-bin dir rather than stage1. Update the test suite accordingly. * Fix do_package QA issue by packing missing zsh files and directories: Fixes: do_package: QA Issue: rust: Files/directories were installed but not shipped in any package: /usr/share/zsh /usr/share/zsh/site-functions /usr/share/zsh/site-functions/_cargo Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install * Install "llvm-tblgen" from native-sysroot to recipe sysroot to handle file not found error during rust builds: Fixes: /bin/sh: line 1:/home/poky/build/tmp/work/core2-64-poky-linux/rust/1.86.0/recipe-sysroot/usr/lib/llvm-rust/bin/llvm-tblgen: No such file or directory | make[2]: *** [COFF/CMakeFiles/COFFOptionsTableGen.dir/build.make:120: COFF/Options.inc] Error 127 | make[1]: *** [CMakeFiles/Makefile2:630: COFF/CMakeFiles/COFFOptionsTableGen.dir/all] Error 2 | make[1]: *** Waiting for unfinished jobs.... * From v1.86.0, a "self-contained" LLD is built as part of rust bootstrap build. This results in additional build time and installations. Disable rust-lld in config.toml to prevent it. References: rust-lang/rust#135001 rust-lang/rust@8744b44 * Drop Zdual-proc-macros-additional-check.patch patch since it's merged with v1.86.0 rust-lang/rust@139d6ba * LTO config is applied to rustdoc from v1.86.0. Rebase 0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch which disables it to avoid suffixes in binaries causing non-reproducibility. rust-lang/rust@1fe351b * Restrict tests using "//@only <target_arch>" to avoid failures on riscv64. qemuriscv64 was recently added to the default testing on AB. Riscv64 has Tier 2 status, (https://doc.rust-lang.org/rustc/platform-support.html#tier-2-with-host-tools) which guarantees successful builds but does not include automated testing. As a result, some tests may fail or exhibit unexpected behavior on this architecture. To avoid disabling these tests entirely, use //@only <target_arch> to limit their execution to architectures where they are known to work. This ensures the tests still run on supported targets while being skipped on riscv64. Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> Signed-off-by: Harish Sadineni <Harish.Sadineni@windriver.com>
1 parent e492016 commit e3a4fb6

13 files changed

+152
-159
lines changed

meta/conf/distro/include/tcmode-default.inc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ PREFERRED_PROVIDER_virtual/gettext ??= "gettext"
1212
GCCVERSION ?= "15.%"
1313
SDKGCCVERSION ?= "${GCCVERSION}"
1414
GLIBCVERSION ?= "2.41%"
15-
RUSTVERSION ?= "1.85.1%"
15+
RUSTVERSION ?= "1.86.0%"
1616

1717
PREFERRED_VERSION_gcc ?= "${GCCVERSION}"
1818
PREFERRED_VERSION_gcc-cross-${TARGET_ARCH} ?= "${GCCVERSION}"

meta/lib/oeqa/selftest/cases/rust.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ def test_rust(self, *args, **kwargs):
104104
# Copy remote-test-server to image through scp
105105
host_sys = get_bb_var("RUST_BUILD_SYS", "rust")
106106
ssh = SSHControl(ip=qemu.ip, logfile=qemu.sshlog, user="root")
107-
ssh.copy_to(builddir + "/build/" + host_sys + "/stage1-tools-bin/remote-test-server","~/")
107+
ssh.copy_to(builddir + "/build/" + host_sys + "/stage2-tools-bin/remote-test-server","~/")
108108
# Execute remote-test-server on image through background ssh
109109
command = '~/remote-test-server --bind 0.0.0.0:12345 -v'
110110
sshrun=subprocess.Popen(("ssh", '-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '-f', "root@%s" % qemu.ip, command), shell=False, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

meta/recipes-devtools/rust/files/0001-Define-more-ioctl-codes-on-riscv32gc-unknown-linux-g.patch

Lines changed: 0 additions & 32 deletions
Large diffs are not rendered by default.

meta/recipes-devtools/rust/files/0001-src-core-build_steps-tool.rs-switch-off-lto-for-rust.patch

Lines changed: 42 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,23 +24,53 @@ diff --git a/src/bootstrap/src/core/build_steps/tool.rs b/src/bootstrap/src/core
2424
index 087df2f8a..00790affb 100644
2525
--- a/src/bootstrap/src/core/build_steps/tool.rs
2626
+++ b/src/bootstrap/src/core/build_steps/tool.rs
27-
@@ -635,7 +635,7 @@ impl Step for Rustdoc {
28-
}
27+
@@ -1,14 +1,11 @@
28+
use std::path::PathBuf;
29+
use std::{env, fs};
2930

30-
// NOTE: Never modify the rustflags here, it breaks the build cache for other tools!
31-
- let cargo = prepare_tool_cargo(
32-
+ let mut cargo = prepare_tool_cargo(
33-
builder,
34-
build_compiler,
35-
Mode::ToolRustc,
36-
@@ -645,6 +645,7 @@ impl Step for Rustdoc {
31+
-use crate::core::build_steps::compile::is_lto_stage;
32+
use crate::core::build_steps::toolstate::ToolState;
33+
use crate::core::build_steps::{compile, llvm};
34+
use crate::core::builder;
35+
-use crate::core::builder::{
36+
- Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step, cargo_profile_var,
37+
-};
38+
-use crate::core::config::{DebuginfoLevel, RustcLto, TargetSelection};
39+
+use crate::core::builder::{Builder, Cargo as CargoCommand, RunConfig, ShouldRun, Step};
40+
+use crate::core::config::{DebuginfoLevel, TargetSelection};
41+
use crate::utils::channel::GitInfo;
42+
use crate::utils::exec::{BootstrapCommand, command};
43+
use crate::utils::helpers::{add_dylib_path, exe, t};
44+
@@ -658,19 +655,7 @@
3745
SourceType::InTree,
3846
features.as_slice(),
3947
);
48+
-
49+
- // rustdoc is performance sensitive, so apply LTO to it.
50+
- if is_lto_stage(&build_compiler) {
51+
- let lto = match builder.config.rust_lto {
52+
- RustcLto::Off => Some("off"),
53+
- RustcLto::Thin => Some("thin"),
54+
- RustcLto::Fat => Some("fat"),
55+
- RustcLto::ThinLocal => None,
56+
- };
57+
- if let Some(lto) = lto {
58+
- cargo.env(cargo_profile_var("LTO", &builder.config), lto);
59+
- }
60+
- }
4061
+ cargo.rustflag("-Clto=off");
4162

4263
let _guard = builder.msg_tool(
4364
Kind::Build,
44-
--
45-
2.39.5
46-
65+
diff --git a/src/bootstrap/src/core/builder/mod.rs b/src/bootstrap/src/core/builder/mod.rs
66+
--- a/src/bootstrap/src/core/builder/mod.rs
67+
+++ b/src/bootstrap/src/core/builder/mod.rs
68+
@@ -11,7 +11,7 @@
69+
70+
use clap::ValueEnum;
71+
72+
-pub use self::cargo::{Cargo, cargo_profile_var};
73+
+pub use self::cargo::Cargo;
74+
pub use crate::Compiler;
75+
use crate::core::build_steps::{
76+
check, clean, clippy, compile, dist, doc, gcc, install, llvm, run, setup, test, tool, vendor,

meta/recipes-devtools/rust/files/Zdual-proc-macros-additional-check.patch

Lines changed: 0 additions & 31 deletions
This file was deleted.

meta/recipes-devtools/rust/files/rust-oe-selftest.patch

Lines changed: 51 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/sr
4343
fn test_can_print_warnings() {
4444
sess_and_cfg(&["-Awarnings"], |sess, _cfg| {
4545
assert!(!sess.dcx().can_emit_warnings());
46-
diff --git a/library/std/src/sync/poison/rwlock/tests.rs b/library/std/src/sync/poison/rwlock/tests.rs
46+
diff --git a/library/std/tests/sync/rwlock.rs b/library/std/tests/sync/rwlock.rs
4747
index 1a9d3d3f12f..0a9cfc48806 100644
48-
--- a/library/std/src/sync/poison/rwlock/tests.rs
49-
+++ b/library/std/src/sync/poison/rwlock/tests.rs
48+
--- a/library/std/tests/sync/rwlock.rs
49+
+++ b/library/std/tests/sync/rwlock.rs
5050
@@ -47,6 +47,7 @@ fn frob() {
5151
}
5252

@@ -114,9 +114,9 @@ diff --git a/library/test/src/tests.rs b/library/test/src/tests.rs
114114
fn test_time_options_threshold() {
115115
let unit = TimeThreshold::new(Duration::from_millis(50), Duration::from_millis(100));
116116
let integration = TimeThreshold::new(Duration::from_millis(500), Duration::from_millis(1000));
117-
diff --git a/library/std/src/sync/poison/mutex/tests.rs b/library/std/src/sync/poison/mutex/tests.rs
118-
--- a/library/std/src/sync/poison/mutex/tests.rs
119-
+++ b/library/std/src/sync/poison/mutex/tests.rs
117+
diff --git a/library/std/tests/sync/mutex.rs b/library/std/tests/sync/mutex.rs
118+
--- a/library/std/tests/sync/mutex.rs
119+
+++ b/library/std/tests/sync/mutex.rs
120120
@@ -193,6 +193,7 @@
121121
}
122122

@@ -125,9 +125,9 @@ diff --git a/library/std/src/sync/poison/mutex/tests.rs b/library/std/src/sync/p
125125
fn test_mutex_arc_poison_mapped() {
126126
let arc = Arc::new(Mutex::new(1));
127127
assert!(!arc.is_poisoned());
128-
diff --git a/library/std/src/sync/poison/mutex/tests.rs b/library/std/src/sync/poison/mutex/tests.rs
129-
--- a/library/std/src/sync/poison/mutex/tests.rs
130-
+++ b/library/std/src/sync/poison/mutex/tests.rs
128+
diff --git a/library/std/tests/sync/mutex.rs b/library/std/tests/sync/mutex.rs
129+
--- a/library/std/tests/sync/mutex.rs
130+
+++ b/library/std/tests/sync/mutex.rs
131131
@@ -272,6 +272,7 @@
132132
}
133133

@@ -136,9 +136,9 @@ diff --git a/library/std/src/sync/poison/mutex/tests.rs b/library/std/src/sync/p
136136
fn panic_while_mapping_unlocked_poison() {
137137
let lock = Mutex::new(());
138138

139-
diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/src/sync/poison/rwlock/tests.rs
140-
--- a/library/std/src/sync/poison/rwlock/tests.rs
141-
+++ b/library/std/src/sync/poison/rwlock/tests.rs
139+
diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/tests/sync/rwlock.rs
140+
--- a/library/std/tests/sync/rwlock.rs
141+
+++ b/library/std/tests/sync/rwlock.rs
142142
@@ -59,6 +59,7 @@ fn test_rw_arc_poison_wr() {
143143
}
144144

@@ -163,10 +163,10 @@ diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/src/sync/poison/
163163
fn panic_while_mapping_write_unlocked_poison() {
164164
let lock = RwLock::new(());
165165

166-
diff --git a/library/core/benches/num/int_log/mod.rs b/library/core/benches/num/int_log/mod.rs
166+
diff --git a/library/coretests/benches/num/int_log/mod.rs b/library/coretests/benches/num/int_log/mod.rs
167167
index 3807cd5d76c..018c5c04456 100644
168-
--- a/library/core/benches/num/int_log/mod.rs
169-
+++ b/library/core/benches/num/int_log/mod.rs
168+
--- a/library/coretests/benches/num/int_log/mod.rs
169+
+++ b/library/coretests/benches/num/int_log/mod.rs
170170
@@ -98,6 +98,7 @@ fn $random_small(bench: &mut Bencher) {
171171
}
172172

@@ -175,34 +175,22 @@ index 3807cd5d76c..018c5c04456 100644
175175
fn $geometric(bench: &mut Bencher) {
176176
let bases: [$t; 16] = [2, 3, 4, 5, 7, 8, 9, 15, 16, 17, 31, 32, 33, 63, 64, 65];
177177
let base_and_numbers: Vec<($t, Vec<$t>)> = bases
178-
diff --git a/compiler/rustc_data_structures/src/tagged_ptr/copy/tests.rs b/compiler/rustc_data_structures/src/tagged_ptr/copy/tests.rs
178+
diff --git a/compiler/rustc_data_structures/src/tagged_ptr/tests.rs b/compiler/rustc_data_structures/src/tagged_ptr/tests.rs
179179
index 160af8a65d..686f4607bb 100644
180-
--- a/compiler/rustc_data_structures/src/tagged_ptr/copy/tests.rs
181-
+++ b/compiler/rustc_data_structures/src/tagged_ptr/copy/tests.rs
180+
--- a/compiler/rustc_data_structures/src/tagged_ptr/tests.rs
181+
+++ b/compiler/rustc_data_structures/src/tagged_ptr/tests.rs
182182
@@ -5,6 +5,7 @@ use crate::stable_hasher::{HashStable, StableHasher};
183-
use crate::tagged_ptr::{CopyTaggedPtr, Pointer, Tag, Tag2};
184-
185-
#[test]
186-
+#[ignore]
187-
fn smoke() {
188-
let value = 12u32;
189-
let reference = &value;
190-
diff --git a/compiler/rustc_data_structures/src/tagged_ptr/drop/tests.rs b/compiler/rustc_data_structures/src/tagged_ptr/drop/tests.rs
191-
index 4d342c72cc..9a77f92616 100644
192-
--- a/compiler/rustc_data_structures/src/tagged_ptr/drop/tests.rs
193-
+++ b/compiler/rustc_data_structures/src/tagged_ptr/drop/tests.rs
194-
@@ -4,6 +4,7 @@ use std::sync::Arc;
195-
use crate::tagged_ptr::{Pointer, Tag, Tag2, TaggedPtr};
183+
}
196184

197185
#[test]
198186
+#[ignore]
199187
fn smoke() {
200188
let value = 12u32;
201189
let reference = &value;
202-
diff --git a/library/std/src/thread/local/tests.rs b/library/std/src/thread/local/tests.rs
190+
diff --git a/library/std/tests/thread_local/tests.rs b/library/std/tests/thread_local/tests.rs
203191
index 9d4f52a092..d425e5f7b7 100644
204-
--- a/library/std/src/thread/local/tests.rs
205-
+++ b/library/std/src/thread/local/tests.rs
192+
--- a/library/std/tests/thread_local/tests.rs
193+
+++ b/library/std/tests/thread_local/tests.rs
206194
@@ -346,6 +346,7 @@ fn join_orders_after_tls_destructors() {
207195

208196
// Test that thread::current is still available in TLS destructors.
@@ -242,3 +230,32 @@ index a05f274136..0e69b4cb98 100644
242230
fn sparse_inserts() {
243231
let cache: VecCache<u32, u8, u32> = VecCache::default();
244232
let end = if cfg!(target_pointer_width = "64") && cfg!(target_os = "linux") {
233+
diff --git a/tests/assembly/dwarf-mixed-versions-lto.rs b/tests/assembly/dwarf-mixed-versions-lto.rs
234+
index 5b8e5ff4f4a..e558fbd7bd7 100644
235+
--- a/tests/assembly/dwarf-mixed-versions-lto.rs
236+
+++ b/tests/assembly/dwarf-mixed-versions-lto.rs
237+
@@ -1,6 +1,11 @@
238+
// This test ensures that if LTO occurs between crates with different DWARF versions, we
239+
// will choose the highest DWARF version for the final binary. This matches Clang's behavior.
240+
241+
+//@ only-x86
242+
+//@ only-x86_64
243+
+//@ only-arm
244+
+//@ only-aarch64
245+
+
246+
//@ only-linux
247+
//@ aux-build:dwarf-mixed-versions-lto-aux.rs
248+
//@ compile-flags: -C lto -g -Zdwarf-version=5
249+
diff --git a/tests/codegen/dont-shuffle-bswaps.rs b/tests/codegen/dont-shuffle-bswaps.rs
250+
index 0e712bc3a4e..93965d990d0 100644
251+
--- a/tests/codegen/dont-shuffle-bswaps.rs
252+
+++ b/tests/codegen/dont-shuffle-bswaps.rs
253+
@@ -1,3 +1,8 @@
254+
+//@ only-x86
255+
+//@ only-x86_64
256+
+//@ only-arm
257+
+//@ only-aarch64
258+
+
259+
//@ revisions: OPT2 OPT3
260+
//@[OPT2] compile-flags: -Copt-level=2
261+
//@[OPT3] compile-flags: -C opt-level=3

meta/recipes-devtools/rust/libstd-rs_1.85.1.bb renamed to meta/recipes-devtools/rust/libstd-rs_1.86.0.bb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ SUMMARY = "Rust standard libaries"
22
HOMEPAGE = "http://www.rust-lang.org"
33
SECTION = "devel"
44
LICENSE = "(MIT | Apache-2.0) & Unicode-3.0"
5-
LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=9c0fae516fe8aaea2fb601db4800daf7"
5+
LIC_FILES_CHKSUM = "file://../../COPYRIGHT;md5=11a3899825f4376896e438c8c753f8dc"
66

77
require rust-source.inc
88

meta/recipes-devtools/rust/rust-llvm_1.85.1.bb renamed to meta/recipes-devtools/rust/rust-llvm_1.86.0.bb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ SUMMARY = "LLVM compiler framework (packaged with rust)"
22
LICENSE ?= "Apache-2.0-with-LLVM-exception"
33
HOMEPAGE = "http://www.rust-lang.org"
44

5-
# check src/llvm-project/llvm/CMakeLists.txt for llvm version in use
5+
# check src/llvm-project/cmake/Modules/LLVMVersion.cmake for llvm version in use
66
#
7-
LLVM_RELEASE = "19.1.5"
7+
LLVM_RELEASE = "19.1.7"
88

99
require rust-source.inc
1010

0 commit comments

Comments
 (0)