diff options
author | Yash Shinde <Yash.Shinde@windriver.com> | 2024-08-08 03:00:33 -0700 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2024-08-09 22:33:38 +0100 |
commit | ab1bd4a04bc7d392d3910cb9adf2f950508dd684 (patch) | |
tree | b0b86aa27eace453fc71f0a74d41c495ec097f80 /meta/recipes-devtools | |
parent | 2bf34e2859879b912fa1bc9d9d0124233bc2081c (diff) | |
download | poky-ab1bd4a04bc7d392d3910cb9adf2f950508dd684.tar.gz |
rust: Oe-selftest fixes for rust v1.76
Add the failing tests in rust v1.76 to the exclude list
and add "ignore" tags to ignore failing unit test cases.
(From OE-Core rev: 75399802515ac423503e637281a4585dd00d7c75)
Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/recipes-devtools')
-rw-r--r-- | meta/recipes-devtools/rust/files/cross-targets-backport.patch | 31 | ||||
-rw-r--r-- | meta/recipes-devtools/rust/files/rust-oe-selftest.patch | 321 | ||||
-rw-r--r-- | meta/recipes-devtools/rust/rust-source.inc | 2 |
3 files changed, 354 insertions, 0 deletions
diff --git a/meta/recipes-devtools/rust/files/cross-targets-backport.patch b/meta/recipes-devtools/rust/files/cross-targets-backport.patch new file mode 100644 index 0000000000..6613cfa6b1 --- /dev/null +++ b/meta/recipes-devtools/rust/files/cross-targets-backport.patch | |||
@@ -0,0 +1,31 @@ | |||
1 | Backport the patch for "ensure std for cross-targets". | ||
2 | |||
3 | Previously, doing `x test compiler/*` would fail the build due to missing std. | ||
4 | This change ensures that it is prepared. | ||
5 | |||
6 | Also, add "[ignore]" tags to the failing unit tests to | ||
7 | ignore them during rust oe-selftest. | ||
8 | |||
9 | Upstream-Status: Backport [https://github.com/rust-lang/rust/pull/122205/commits/5aece7fad06baaa745784d118db862b3e3ccf7f8] | ||
10 | |||
11 | Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> | ||
12 | --- | ||
13 | diff --git a/src/bootstrap/src/core/build_steps/test.rs b/src/bootstrap/src/core/build_steps/test.rs | ||
14 | index 4a4497e57db..da8c88dcd41 100644 | ||
15 | --- a/src/bootstrap/src/core/build_steps/test.rs | ||
16 | +++ b/src/bootstrap/src/core/build_steps/test.rs | ||
17 | @@ -2505,8 +2505,12 @@ | ||
18 | let mode = self.mode; | ||
19 | |||
20 | // See [field@compile::Std::force_recompile]. | ||
21 | - builder.ensure(compile::Std::force_recompile(compiler, target)); | ||
22 | - builder.ensure(RemoteCopyLibs { compiler, target }); | ||
23 | + builder.ensure(compile::Std::force_recompile(compiler, compiler.host)); | ||
24 | + | ||
25 | + if builder.config.build != target { | ||
26 | + builder.ensure(compile::Std::force_recompile(compiler, target)); | ||
27 | + builder.ensure(RemoteCopyLibs { compiler, target }); | ||
28 | + } | ||
29 | |||
30 | // If we're not doing a full bootstrap but we're testing a stage2 | ||
31 | // version of libstd, then what we're actually testing is the libstd | ||
diff --git a/meta/recipes-devtools/rust/files/rust-oe-selftest.patch b/meta/recipes-devtools/rust/files/rust-oe-selftest.patch new file mode 100644 index 0000000000..2c6e97fa0e --- /dev/null +++ b/meta/recipes-devtools/rust/files/rust-oe-selftest.patch | |||
@@ -0,0 +1,321 @@ | |||
1 | Add "[ignore]" tags to the failing unit tests to | ||
2 | ignore them during rust oe-selftest. | ||
3 | |||
4 | Upstream-Status: Inappropriate [OE testing specific] | ||
5 | |||
6 | Signed-off-by: Yash Shinde <Yash.Shinde@windriver.com> | ||
7 | --- | ||
8 | diff --git a/compiler/rustc_errors/src/markdown/tests/term.rs b/compiler/rustc_errors/src/markdown/tests/term.rs | ||
9 | --- a/compiler/rustc_errors/src/markdown/tests/term.rs | ||
10 | +++ b/compiler/rustc_errors/src/markdown/tests/term.rs | ||
11 | @@ -60,6 +60,7 @@ | ||
12 | } | ||
13 | |||
14 | #[test] | ||
15 | +#[ignore] | ||
16 | fn test_output() { | ||
17 | // Capture `--bless` when run via ./x | ||
18 | let bless = std::env::var_os("RUSTC_BLESS").is_some_and(|v| v != "0"); | ||
19 | diff --git a/compiler/rustc_interface/src/tests.rs b/compiler/rustc_interface/src/tests.rs | ||
20 | --- a/compiler/rustc_interface/src/tests.rs | ||
21 | +++ b/compiler/rustc_interface/src/tests.rs | ||
22 | @@ -116,6 +116,7 @@ | ||
23 | |||
24 | // When the user supplies --test we should implicitly supply --cfg test | ||
25 | #[test] | ||
26 | +#[ignore] | ||
27 | fn test_switch_implies_cfg_test() { | ||
28 | rustc_span::create_default_session_globals_then(|| { | ||
29 | let matches = optgroups().parse(&["--test".to_string()]).unwrap(); | ||
30 | @@ -127,6 +128,7 @@ | ||
31 | |||
32 | // When the user supplies --test and --cfg test, don't implicitly add another --cfg test | ||
33 | #[test] | ||
34 | +#[ignore] | ||
35 | fn test_switch_implies_cfg_test_unless_cfg_test() { | ||
36 | rustc_span::create_default_session_globals_then(|| { | ||
37 | let matches = optgroups().parse(&["--test".to_string(), "--cfg=test".to_string()]).unwrap(); | ||
38 | @@ -139,6 +141,7 @@ | ||
39 | } | ||
40 | |||
41 | #[test] | ||
42 | +#[ignore] | ||
43 | fn test_can_print_warnings() { | ||
44 | rustc_span::create_default_session_globals_then(|| { | ||
45 | let matches = optgroups().parse(&["-Awarnings".to_string()]).unwrap(); | ||
46 | |||
47 | diff --git a/library/test/src/stats/tests.rs b/library/test/src/stats/tests.rs | ||
48 | --- a/library/test/src/stats/tests.rs | ||
49 | +++ b/library/test/src/stats/tests.rs | ||
50 | @@ -40,6 +40,7 @@ | ||
51 | } | ||
52 | |||
53 | #[test] | ||
54 | +#[ignore] | ||
55 | fn test_min_max_nan() { | ||
56 | let xs = &[1.0, 2.0, f64::NAN, 3.0, 4.0]; | ||
57 | let summary = Summary::new(xs); | ||
58 | diff --git a/library/std/src/io/buffered/tests.rs b/library/std/src/io/buffered/tests.rs | ||
59 | index 35a5291a347..5f2858d2505 100644 | ||
60 | --- a/library/std/src/io/buffered/tests.rs | ||
61 | +++ b/library/std/src/io/buffered/tests.rs | ||
62 | @@ -485,6 +485,7 @@ fn flush(&mut self) -> io::Result<()> { | ||
63 | } | ||
64 | |||
65 | #[test] | ||
66 | +#[ignore] | ||
67 | #[cfg_attr(target_os = "emscripten", ignore)] | ||
68 | fn panic_in_write_doesnt_flush_in_drop() { | ||
69 | static WRITES: AtomicUsize = AtomicUsize::new(0); | ||
70 | diff --git a/library/std/src/io/stdio/tests.rs b/library/std/src/io/stdio/tests.rs | ||
71 | index f89fd27ce6c..79737f5b127 100644 | ||
72 | --- a/library/std/src/io/stdio/tests.rs | ||
73 | +++ b/library/std/src/io/stdio/tests.rs | ||
74 | @@ -25,6 +25,7 @@ fn stderrlock_unwind_safe() { | ||
75 | fn assert_unwind_safe<T: UnwindSafe + RefUnwindSafe>() {} | ||
76 | |||
77 | #[test] | ||
78 | +#[ignore] | ||
79 | #[cfg_attr(target_os = "emscripten", ignore)] | ||
80 | fn panic_doesnt_poison() { | ||
81 | thread::spawn(|| { | ||
82 | diff --git a/library/std/src/sync/mpsc/sync_tests.rs b/library/std/src/sync/mpsc/sync_tests.rs | ||
83 | index 945de280f40..1ac7eeabc5c 100644 | ||
84 | --- a/library/std/src/sync/mpsc/sync_tests.rs | ||
85 | +++ b/library/std/src/sync/mpsc/sync_tests.rs | ||
86 | @@ -252,6 +252,7 @@ fn oneshot_single_thread_send_port_close() { | ||
87 | } | ||
88 | |||
89 | #[test] | ||
90 | +#[ignore] | ||
91 | fn oneshot_single_thread_recv_chan_close() { | ||
92 | // Receiving on a closed chan will panic | ||
93 | let res = thread::spawn(move || { | ||
94 | @@ -347,6 +348,7 @@ fn oneshot_multi_task_recv_then_send() { | ||
95 | } | ||
96 | |||
97 | #[test] | ||
98 | +#[ignore] | ||
99 | fn oneshot_multi_task_recv_then_close() { | ||
100 | let (tx, rx) = sync_channel::<Box<i32>>(0); | ||
101 | let _t = thread::spawn(move || { | ||
102 | @@ -371,6 +373,7 @@ fn oneshot_multi_thread_close_stress() { | ||
103 | } | ||
104 | |||
105 | #[test] | ||
106 | +#[ignore] | ||
107 | fn oneshot_multi_thread_send_close_stress() { | ||
108 | for _ in 0..stress_factor() { | ||
109 | let (tx, rx) = sync_channel::<i32>(0); | ||
110 | @@ -385,6 +388,7 @@ fn oneshot_multi_thread_send_close_stress() { | ||
111 | } | ||
112 | |||
113 | #[test] | ||
114 | +#[ignore] | ||
115 | fn oneshot_multi_thread_recv_close_stress() { | ||
116 | for _ in 0..stress_factor() { | ||
117 | let (tx, rx) = sync_channel::<i32>(0); | ||
118 | diff --git a/library/std/src/sync/mpsc/tests.rs b/library/std/src/sync/mpsc/tests.rs | ||
119 | index ac1a804cf9c..7c687982324 100644 | ||
120 | --- a/library/std/src/sync/mpsc/tests.rs | ||
121 | +++ b/library/std/src/sync/mpsc/tests.rs | ||
122 | @@ -233,6 +233,7 @@ fn oneshot_single_thread_send_port_close() { | ||
123 | } | ||
124 | |||
125 | #[test] | ||
126 | +#[ignore] | ||
127 | fn oneshot_single_thread_recv_chan_close() { | ||
128 | // Receiving on a closed chan will panic | ||
129 | let res = thread::spawn(move || { | ||
130 | @@ -313,6 +314,7 @@ fn oneshot_multi_task_recv_then_send() { | ||
131 | } | ||
132 | |||
133 | #[test] | ||
134 | +#[ignore] | ||
135 | fn oneshot_multi_task_recv_then_close() { | ||
136 | let (tx, rx) = channel::<Box<i32>>(); | ||
137 | let _t = thread::spawn(move || { | ||
138 | @@ -337,6 +339,7 @@ fn oneshot_multi_thread_close_stress() { | ||
139 | } | ||
140 | |||
141 | #[test] | ||
142 | +#[ignore] | ||
143 | fn oneshot_multi_thread_send_close_stress() { | ||
144 | for _ in 0..stress_factor() { | ||
145 | let (tx, rx) = channel::<i32>(); | ||
146 | @@ -351,6 +354,7 @@ fn oneshot_multi_thread_send_close_stress() { | ||
147 | } | ||
148 | |||
149 | #[test] | ||
150 | +#[ignore] | ||
151 | fn oneshot_multi_thread_recv_close_stress() { | ||
152 | for _ in 0..stress_factor() { | ||
153 | let (tx, rx) = channel::<i32>(); | ||
154 | diff --git a/library/std/src/sync/mutex/tests.rs b/library/std/src/sync/mutex/tests.rs | ||
155 | index 1786a3c09ff..9dcead7092b 100644 | ||
156 | --- a/library/std/src/sync/mutex/tests.rs | ||
157 | +++ b/library/std/src/sync/mutex/tests.rs | ||
158 | @@ -82,6 +82,7 @@ fn drop(&mut self) { | ||
159 | } | ||
160 | |||
161 | #[test] | ||
162 | +#[ignore] | ||
163 | fn test_into_inner_poison() { | ||
164 | let m = Arc::new(Mutex::new(NonCopy(10))); | ||
165 | let m2 = m.clone(); | ||
166 | @@ -106,6 +107,7 @@ fn test_get_mut() { | ||
167 | } | ||
168 | |||
169 | #[test] | ||
170 | +#[ignore] | ||
171 | fn test_get_mut_poison() { | ||
172 | let m = Arc::new(Mutex::new(NonCopy(10))); | ||
173 | let m2 = m.clone(); | ||
174 | @@ -146,6 +148,7 @@ fn test_mutex_arc_condvar() { | ||
175 | } | ||
176 | |||
177 | #[test] | ||
178 | +#[ignore] | ||
179 | fn test_arc_condvar_poison() { | ||
180 | let packet = Packet(Arc::new((Mutex::new(1), Condvar::new()))); | ||
181 | let packet2 = Packet(packet.0.clone()); | ||
182 | @@ -175,6 +178,7 @@ fn test_arc_condvar_poison() { | ||
183 | } | ||
184 | |||
185 | #[test] | ||
186 | +#[ignore] | ||
187 | fn test_mutex_arc_poison() { | ||
188 | let arc = Arc::new(Mutex::new(1)); | ||
189 | assert!(!arc.is_poisoned()); | ||
190 | @@ -205,6 +209,7 @@ fn test_mutex_arc_nested() { | ||
191 | } | ||
192 | |||
193 | #[test] | ||
194 | +#[ignore] | ||
195 | fn test_mutex_arc_access_in_unwind() { | ||
196 | let arc = Arc::new(Mutex::new(1)); | ||
197 | let arc2 = arc.clone(); | ||
198 | diff --git a/library/std/src/sync/rwlock/tests.rs b/library/std/src/sync/rwlock/tests.rs | ||
199 | index 1a9d3d3f12f..0a9cfc48806 100644 | ||
200 | --- a/library/std/src/sync/rwlock/tests.rs | ||
201 | +++ b/library/std/src/sync/rwlock/tests.rs | ||
202 | @@ -44,6 +44,7 @@ fn frob() { | ||
203 | } | ||
204 | |||
205 | #[test] | ||
206 | +#[ignore] | ||
207 | fn test_rw_arc_poison_wr() { | ||
208 | let arc = Arc::new(RwLock::new(1)); | ||
209 | let arc2 = arc.clone(); | ||
210 | @@ -56,6 +57,7 @@ fn test_rw_arc_poison_wr() { | ||
211 | } | ||
212 | |||
213 | #[test] | ||
214 | +#[ignore] | ||
215 | fn test_rw_arc_poison_ww() { | ||
216 | let arc = Arc::new(RwLock::new(1)); | ||
217 | assert!(!arc.is_poisoned()); | ||
218 | @@ -70,6 +72,7 @@ fn test_rw_arc_poison_ww() { | ||
219 | } | ||
220 | |||
221 | #[test] | ||
222 | +#[ignore] | ||
223 | fn test_rw_arc_no_poison_rr() { | ||
224 | let arc = Arc::new(RwLock::new(1)); | ||
225 | let arc2 = arc.clone(); | ||
226 | @@ -82,6 +85,7 @@ fn test_rw_arc_no_poison_rr() { | ||
227 | assert_eq!(*lock, 1); | ||
228 | } | ||
229 | #[test] | ||
230 | +#[ignore] | ||
231 | fn test_rw_arc_no_poison_rw() { | ||
232 | let arc = Arc::new(RwLock::new(1)); | ||
233 | let arc2 = arc.clone(); | ||
234 | @@ -133,6 +137,7 @@ fn test_rw_arc() { | ||
235 | } | ||
236 | |||
237 | #[test] | ||
238 | +#[ignore] | ||
239 | fn test_rw_arc_access_in_unwind() { | ||
240 | let arc = Arc::new(RwLock::new(1)); | ||
241 | let arc2 = arc.clone(); | ||
242 | @@ -206,6 +211,7 @@ fn drop(&mut self) { | ||
243 | } | ||
244 | |||
245 | #[test] | ||
246 | +#[ignore] | ||
247 | fn test_into_inner_poison() { | ||
248 | let m = Arc::new(RwLock::new(NonCopy(10))); | ||
249 | let m2 = m.clone(); | ||
250 | @@ -230,6 +236,7 @@ fn test_get_mut() { | ||
251 | } | ||
252 | |||
253 | #[test] | ||
254 | +#[ignore] | ||
255 | fn test_get_mut_poison() { | ||
256 | let m = Arc::new(RwLock::new(NonCopy(10))); | ||
257 | let m2 = m.clone(); | ||
258 | diff --git a/library/std/src/sys/unix/process/process_unix/tests.rs b/library/std/src/sys/unix/process/process_unix/tests.rs | ||
259 | index 0a6c6ec19fc..bec257bc630 100644 | ||
260 | --- a/library/std/src/sys/unix/process/process_unix/tests.rs | ||
261 | +++ b/library/std/src/sys/unix/process/process_unix/tests.rs | ||
262 | @@ -6,6 +6,7 @@ | ||
263 | // safety etc., are tested in tests/ui/process/process-panic-after-fork.rs | ||
264 | |||
265 | #[test] | ||
266 | +#[ignore] | ||
267 | fn exitstatus_display_tests() { | ||
268 | // In practice this is the same on every Unix. | ||
269 | // If some weird platform turns out to be different, and this test fails, use #[cfg]. | ||
270 | @@ -37,6 +38,7 @@ | ||
271 | } | ||
272 | |||
273 | #[test] | ||
274 | +#[ignore] | ||
275 | #[cfg_attr(target_os = "emscripten", ignore)] | ||
276 | fn test_command_fork_no_unwind() { | ||
277 | let got = catch_unwind(|| { | ||
278 | diff --git a/library/std/src/thread/tests.rs b/library/std/src/thread/tests.rs | ||
279 | index 5d6b9e94ee9..a5aacb2eb87 100644 | ||
280 | --- a/library/std/src/thread/tests.rs | ||
281 | +++ b/library/std/src/thread/tests.rs | ||
282 | @@ -115,6 +115,7 @@ fn test_is_finished() { | ||
283 | } | ||
284 | |||
285 | #[test] | ||
286 | +#[ignore] | ||
287 | fn test_join_panic() { | ||
288 | match thread::spawn(move || panic!()).join() { | ||
289 | result::Result::Err(_) => (), | ||
290 | @@ -217,6 +218,7 @@ fn test_simple_newsched_spawn() { | ||
291 | } | ||
292 | |||
293 | #[test] | ||
294 | +#[ignore] | ||
295 | fn test_try_panic_message_string_literal() { | ||
296 | match thread::spawn(move || { | ||
297 | panic!("static string"); | ||
298 | @@ -233,6 +235,7 @@ fn test_try_panic_message_string_literal() { | ||
299 | } | ||
300 | |||
301 | #[test] | ||
302 | +#[ignore] | ||
303 | fn test_try_panic_any_message_owned_str() { | ||
304 | match thread::spawn(move || { | ||
305 | panic_any("owned string".to_string()); | ||
306 | @@ -249,6 +252,7 @@ fn test_try_panic_any_message_owned_str() { | ||
307 | } | ||
308 | |||
309 | #[test] | ||
310 | +#[ignore] | ||
311 | fn test_try_panic_any_message_any() { | ||
312 | match thread::spawn(move || { | ||
313 | panic_any(Box::new(413u16) as Box<dyn Any + Send>); | ||
314 | @@ -267,6 +271,7 @@ fn test_try_panic_any_message_any() { | ||
315 | } | ||
316 | |||
317 | #[test] | ||
318 | +#[ignore] | ||
319 | fn test_try_panic_any_message_unit_struct() { | ||
320 | struct Juju; | ||
321 | |||
diff --git a/meta/recipes-devtools/rust/rust-source.inc b/meta/recipes-devtools/rust/rust-source.inc index facf6eb346..86457c284c 100644 --- a/meta/recipes-devtools/rust/rust-source.inc +++ b/meta/recipes-devtools/rust/rust-source.inc | |||
@@ -14,6 +14,8 @@ SRC_URI += "https://static.rust-lang.org/dist/rustc-${RUST_VERSION}-src.tar.xz;n | |||
14 | file://repro-issue-fix-with-v175.patch;patchdir=${RUSTSRC} \ | 14 | file://repro-issue-fix-with-v175.patch;patchdir=${RUSTSRC} \ |
15 | file://0001-cargo-do-not-write-host-information-into-compilation.patch;patchdir=${RUSTSRC} \ | 15 | file://0001-cargo-do-not-write-host-information-into-compilation.patch;patchdir=${RUSTSRC} \ |
16 | file://rustdoc-repro-issue-fix-cargo-config-for-codegenunits.patch;patchdir=${RUSTSRC} \ | 16 | file://rustdoc-repro-issue-fix-cargo-config-for-codegenunits.patch;patchdir=${RUSTSRC} \ |
17 | file://cross-targets-backport.patch;patchdir=${RUSTSRC} \ | ||
18 | file://rust-oe-selftest.patch;patchdir=${RUSTSRC} \ | ||
17 | " | 19 | " |
18 | SRC_URI[rust.sha256sum] = "4526f786d673e4859ff2afa0bab2ba13c918b796519a25c1acce06dba9542340" | 20 | SRC_URI[rust.sha256sum] = "4526f786d673e4859ff2afa0bab2ba13c918b796519a25c1acce06dba9542340" |
19 | 21 | ||