Skip to content

Commit fd34602

Browse files
committed
Fix rand tests
1 parent 86a2bb7 commit fd34602

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-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`");

0 commit comments

Comments
 (0)