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

Function generate_one_aot_artifact

xtask/src/main.rs:8148–8177  ·  view source on GitHub ↗
(serializer: &Path, input: &Path, output: &Path)

Source from the content-addressed store, hash-verified

8146}
8147
8148fn generate_one_aot_artifact(serializer: &Path, input: &Path, output: &Path) -> Result<()> {
8149 ensure_file(input)?;
8150 let input =
8151 fs::canonicalize(input).with_context(|| format!("canonicalize {}", input.display()))?;
8152 let output = if output.is_absolute() {
8153 output.to_path_buf()
8154 } else {
8155 env::current_dir()
8156 .context("read current directory")?
8157 .join(output)
8158 };
8159 if let Some(parent) = output.parent() {
8160 fs::create_dir_all(parent).with_context(|| format!("create {}", parent.display()))?;
8161 }
8162
8163 let mut command = Command::new(serializer);
8164 command
8165 .args(["aot-serializer", "serialize", "--input"])
8166 .arg(&input)
8167 .arg("--output")
8168 .arg(output)
8169 .env("CARGO_INCREMENTAL", "0");
8170 if env::var_os("LLVM_SYS_221_PREFIX").is_none() && Path::new("/opt/homebrew/opt/llvm").exists()
8171 {
8172 command.env("LLVM_SYS_221_PREFIX", "/opt/homebrew/opt/llvm");
8173 }
8174 configure_windows_llvm_aot_link(&mut command);
8175 run_command(&mut command)
8176 .with_context(|| format!("generate AOT artifact for {}", input.display()))
8177}
8178
8179fn configure_windows_llvm_aot_link(command: &mut Command) {
8180 if !cfg!(windows) {

Callers 1

generate_aot_artifactsFunction · 0.85

Calls 6

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

Tested by

no test coverage detected