MCPcopy Create free account
hub / github.com/f0rr0/oliphaunt / ensure_aot_serializer_binary

Function ensure_aot_serializer_binary

xtask/src/main.rs:8111–8146  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8109}
8110
8111fn ensure_aot_serializer_binary() -> Result<PathBuf> {
8112 let mut command = Command::new("cargo");
8113 command
8114 .args([
8115 "build",
8116 "-p",
8117 "xtask",
8118 "--release",
8119 "--locked",
8120 "--features",
8121 "aot-serializer",
8122 ])
8123 .env("CARGO_INCREMENTAL", "0");
8124 if env::var_os("LLVM_SYS_221_PREFIX").is_none() && Path::new("/opt/homebrew/opt/llvm").exists()
8125 {
8126 command.env("LLVM_SYS_221_PREFIX", "/opt/homebrew/opt/llvm");
8127 }
8128 configure_windows_llvm_aot_link(&mut command);
8129 run_command(&mut command).context("build maintainer AOT serializer")?;
8130
8131 let target_dir = env::var_os("CARGO_TARGET_DIR")
8132 .map(PathBuf::from)
8133 .unwrap_or_else(|| PathBuf::from("target"));
8134 let target_dir = if target_dir.is_absolute() {
8135 target_dir
8136 } else {
8137 env::current_dir()
8138 .context("read current directory")?
8139 .join(target_dir)
8140 };
8141 let serializer = target_dir
8142 .join("release")
8143 .join(format!("xtask{}", env::consts::EXE_SUFFIX));
8144 ensure_file(&serializer)?;
8145 Ok(serializer)
8146}
8147
8148fn generate_one_aot_artifact(serializer: &Path, input: &Path, output: &Path) -> Result<()> {
8149 ensure_file(input)?;

Callers 1

generate_aot_artifactsFunction · 0.85

Calls 5

run_commandFunction · 0.85
ensure_fileFunction · 0.85
argsMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected