Skip to content

Commit

Permalink
fix: tempdir early drop
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathanpwang committed Dec 30, 2024
1 parent 15ac46c commit d2d8128
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/toolchain/tests/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use std::{
path::{Path, PathBuf},
};

use eyre::Result;
use eyre::{Context, Result};
use openvm_build::{
build_guest_package, get_dir_with_profile, get_package, GuestOptions, TargetFilter,
};
Expand Down Expand Up @@ -75,11 +75,12 @@ pub fn build_example_program_at_path_with_features<S: AsRef<str>>(
.iter()
.find(|target| target.name == example_name)
.map(|target| {
get_dir_with_profile(target_dir, profile, true)
get_dir_with_profile(&target_dir, profile, true)
.join(&target.name)
.to_path_buf()
})
.expect("Could not find target binary");
let data = read(elf_path)?;
let data = read(&elf_path).with_context(|| format!("Path not found: {:?}", elf_path))?;
target_dir.close()?;
Elf::decode(&data, MEM_SIZE as u32)
}

0 comments on commit d2d8128

Please sign in to comment.