Skip to content

Commit

Permalink
Only generate atos output for testing on macos
Browse files Browse the repository at this point in the history
  • Loading branch information
matux committed Apr 26, 2023
1 parent 0c0deb5 commit 46105f1
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ators/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,24 @@ use std::{
process::Command,
};

const SYMBOLICATE: &str = "/usr/bin/atos";
#[cfg(target_os = "macos")]
const ATOS: &str = "/usr/bin/atos";

const TEST_DWARF: &str = "test.dwarf";
const TEST_ADDRS: &str = "test_addrs.txt";
const TEST_SYMR: &str = "test_symr.txt";

fn main() -> Result<()> {
println!("cargo:rerun-if-changed={}", path(TEST_ADDRS)?.display());
#[cfg(target_os = "macos")]
println!("cargo:rerun-if-changed={}", path(TEST_SYMR)?.display());

path(TEST_ADDRS)?
.exists()
.eq(&false)
.then(generate_test_addrs_file);

#[cfg(target_os = "macos")]
path(TEST_SYMR)?
.exists()
.eq(&false)
Expand Down Expand Up @@ -52,8 +56,9 @@ fn generate_test_addrs_file() -> Result<()> {
Ok(addrs_file.flush()?)
}

#[cfg(target_os = "macos")]
fn generate_test_symr_file() -> Result<()> {
let output = Command::new(SYMBOLICATE)
let output = Command::new(ATOS)
.args([
"-i",
"-o",
Expand Down

0 comments on commit 46105f1

Please sign in to comment.