]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/build_system/abi_cafe.rs
Auto merge of #105650 - cassaundra:float-literal-suggestion, r=pnkfelix
[rust.git] / compiler / rustc_codegen_cranelift / build_system / abi_cafe.rs
1 use std::path::Path;
2
3 use super::build_sysroot;
4 use super::path::Dirs;
5 use super::prepare::GitRepo;
6 use super::utils::{spawn_and_wait, CargoProject, Compiler};
7 use super::SysrootKind;
8
9 pub(crate) static ABI_CAFE_REPO: GitRepo =
10     GitRepo::github("Gankra", "abi-cafe", "4c6dc8c9c687e2b3a760ff2176ce236872b37212", "abi-cafe");
11
12 pub(crate) static ABI_CAFE: CargoProject =
13     CargoProject::new(&ABI_CAFE_REPO.source_dir(), "abi_cafe");
14
15 pub(crate) fn run(
16     channel: &str,
17     sysroot_kind: SysrootKind,
18     dirs: &Dirs,
19     cg_clif_dylib: &Path,
20     bootstrap_host_compiler: &Compiler,
21 ) {
22     eprintln!("Building sysroot for abi-cafe");
23     build_sysroot::build_sysroot(
24         dirs,
25         channel,
26         sysroot_kind,
27         cg_clif_dylib,
28         bootstrap_host_compiler,
29         bootstrap_host_compiler.triple.clone(),
30     );
31
32     eprintln!("Running abi-cafe");
33
34     let pairs = ["rustc_calls_cgclif", "cgclif_calls_rustc", "cgclif_calls_cc", "cc_calls_cgclif"];
35
36     let mut cmd = ABI_CAFE.run(bootstrap_host_compiler, dirs);
37     cmd.arg("--");
38     cmd.arg("--pairs");
39     cmd.args(pairs);
40     cmd.arg("--add-rustc-codegen-backend");
41     cmd.arg(format!("cgclif:{}", cg_clif_dylib.display()));
42     cmd.current_dir(ABI_CAFE.source_dir(dirs));
43
44     spawn_and_wait(cmd);
45 }