Skip to content

Commit

Permalink
fix: Fix cdylib crate name logic (#3926)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamspofford-dfinity authored Sep 26, 2024
1 parent 07bd312 commit bc98b43
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/dfx/src/lib/canister_info/rust.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,10 @@ impl CanisterInfoFactory for RustCanisterInfo {
(format!("crate `{package}`"), package.clone())
};
let mut candidate_targets = package_info.targets.iter().filter(|x| {
x.name == crate_name && x.crate_types.iter().any(|c| c == "cdylib" || c == "bin")
x.crate_types.iter().any(|c| {
(c == "cdylib" && x.name == crate_name.replace('-', "_"))
|| (c == "bin" && x.name == crate_name)
})
});
let Some(target) = candidate_targets.next() else {
if let Some(wrong_type_crate) =
Expand Down

0 comments on commit bc98b43

Please sign in to comment.