Skip to content

Commit 3b4c58d

Browse files
committed
Fix rand tests
1 parent 86a2bb7 commit 3b4c58d

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

build_system/src/prepare.rs

+26
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,30 @@ fn prepare_libcore(
131131
)?;
132132
}
133133
println!("Successfully prepared libcore for building");
134+
135+
Ok(())
136+
}
137+
138+
// TODO: remove when we can ignore warnings in rustdoc tests.
139+
fn prepare_rand() -> Result<(), String> {
140+
// Apply patch for the rand crate.
141+
let file_path = "patches/crates/0001-Remove-deny-warnings.patch";
142+
let rand_dir = Path::new("build/rand");
143+
println!("[GIT] apply `{}`", file_path);
144+
let path = Path::new("../..").join(file_path);
145+
run_command_with_output(&[&"git", &"apply", &path], Some(rand_dir))?;
146+
run_command_with_output(&[&"git", &"add", &"-A"], Some(rand_dir))?;
147+
run_command_with_output(
148+
&[
149+
&"git",
150+
&"commit",
151+
&"--no-gpg-sign",
152+
&"-m",
153+
&format!("Patch {}", path.display()),
154+
],
155+
Some(rand_dir),
156+
)?;
157+
134158
Ok(())
135159
}
136160

@@ -241,6 +265,8 @@ pub fn run() -> Result<(), String> {
241265
for (repo_url, checkout_commit, cb) in to_clone {
242266
clone_and_setup(repo_url, checkout_commit, *cb)?;
243267
}
268+
269+
prepare_rand()?;
244270
}
245271

246272
println!("Successfully ran `prepare`");
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
From f4a31d2c57cdbd578b778ab70eb2a0cfb248652c Mon Sep 17 00:00:00 2001
2+
From: Antoni Boucher <[email protected]>
3+
Date: Tue, 5 Mar 2024 12:39:44 -0500
4+
Subject: [PATCH] Remove #[deny(warnings)]
5+
6+
---
7+
src/lib.rs | 1 -
8+
1 file changed, 1 deletion(-)
9+
10+
diff --git a/src/lib.rs b/src/lib.rs
11+
index 8ade2881d5..e26c595e38 100644
12+
--- a/src/lib.rs
13+
+++ b/src/lib.rs
14+
@@ -47,7 +47,6 @@
15+
)]
16+
#![deny(missing_docs)]
17+
#![deny(missing_debug_implementations)]
18+
-#![doc(test(attr(allow(unused_variables), deny(warnings))))]
19+
#![no_std]
20+
#![cfg_attr(feature = "simd_support", feature(stdsimd, portable_simd))]
21+
#![cfg_attr(doc_cfg, feature(doc_cfg))]
22+
--
23+
2.44.0
24+

0 commit comments

Comments
 (0)