Skip to content

Commit

Permalink
build eval fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MdTeach committed Jan 8, 2025
1 parent 6f03142 commit df1b207
Show file tree
Hide file tree
Showing 7 changed files with 254 additions and 86 deletions.
34 changes: 31 additions & 3 deletions provers/sp1/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,8 @@ fn generate_elf_contents_and_vk_hash(_program: &str) -> ([u32; 8], String) {
/// Copies the compiled ELF file of the specified program to its cache directory.
#[cfg(not(debug_assertions))]
fn migrate_elf(program: &str) {
let sp1_build_dir = env::var("CARGO_MANIFEST_DIR").expect("CARGO_MANIFEST_DIR is not set");

let metadata = MetadataCommand::new()
.manifest_path(format!("{}/Cargo.toml", program))
.exec()
Expand All @@ -278,15 +280,41 @@ fn migrate_elf(program: &str) {
.clone();

// Copy the elf file
let desination_elf_path = Path::new(program)
let desination_elf_path = Path::new(&sp1_build_dir)
.join(program)
.join("cache")
.join(format!("{}.elf", program));

let built_elf_path = format!(
"{}/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/{}",
program, built_elf_name
"{}/{}/target/elf-compilation/riscv32im-succinct-zkvm-elf/release/{}",
sp1_build_dir, program, built_elf_name
);

eprintln!(
"Current dir is {:?}",
list_dir(Path::new(&format!("{}/{}", sp1_build_dir, program)))
);
eprintln!("Got the source {:?}", built_elf_path);
eprintln!("Got the des {:?}", desination_elf_path);
assert!(1 == 2);
fs::copy(&built_elf_path, &desination_elf_path)
.expect("Failed to copy the built ELF file to the cache directory");
}

fn list_dir(path: &Path) {
eprintln!("got the dir {:?}", path);
match fs::read_dir(path) {
Ok(entries) => {
for entry in entries {
match entry {
Ok(entry) => {
let file_name = entry.file_name();
println!("Abishek {}", file_name.to_string_lossy());
}
Err(e) => eprintln!("Error reading entry: {}", e),
}
}
}
Err(e) => eprintln!("Error reading directory: {}", e),
}
}
46 changes: 34 additions & 12 deletions provers/sp1/guest-btc-blockspace/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

56 changes: 40 additions & 16 deletions provers/sp1/guest-checkpoint/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit df1b207

Please sign in to comment.