Skip to content

Commit

Permalink
fix: copy_elf_from_output_dir binary name (#1526)
Browse files Browse the repository at this point in the history
  • Loading branch information
ratankaliani authored Sep 20, 2024
1 parent 4ed9f05 commit 14567af
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion crates/build/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,20 @@ pub(crate) fn copy_elf_to_output_dir(
HELPER_TARGET_SUBDIR.to_string()
};

// The ELF's file name is the binary name if it's specified. Otherwise, it is the root package
// name.
let original_elf_file_name = if !args.binary.is_empty() {
args.binary.clone()
} else {
root_package_name.unwrap().clone()
};

let original_elf_path = program_metadata
.target_directory
.join(target_dir_suffix)
.join(BUILD_TARGET)
.join("release")
.join(root_package_name.unwrap());
.join(original_elf_file_name);

// The order of precedence for the ELF name is:
// 1. --elf_name flag
Expand Down

0 comments on commit 14567af

Please sign in to comment.