Skip to content

Commit 01652d3

Browse files
committed
Extract Cranelift component
1 parent cef5ebc commit 01652d3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/tools/opt-dist/src/tests.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,16 @@ pub fn run_tests(env: &Environment) -> anyhow::Result<()> {
3636
let cargo_dir = extract_dist_dir(&format!("cargo-{version}-{host_triple}"))?.join("cargo");
3737
let extracted_src_dir = extract_dist_dir(&format!("rust-src-{version}"))?.join("rust-src");
3838

39+
// If we have a Cranelift archive, copy it to the rustc sysroot
40+
if let Ok(_) = find_file_in_dir(&dist_dir, "rustc-codegen-cranelift-", ".tar.xz") {
41+
let extracted_codegen_dir =
42+
extract_dist_dir(&format!("rustc-codegen-cranelift-{version}-{host_triple}"))?
43+
.join("rustc-codegen-cranelift-preview");
44+
let rel_path =
45+
Utf8Path::new("lib").join("rustlib").join(host_triple).join("codegen-backends");
46+
copy_directory(&extracted_codegen_dir.join(&rel_path), &rustc_dir.join(&rel_path))?;
47+
}
48+
3949
// We need to manually copy libstd to the extracted rustc sysroot
4050
copy_directory(
4151
&libstd_dir.join("lib").join("rustlib").join(host_triple).join("lib"),

0 commit comments

Comments
 (0)