Skip to content

Commit 0ccd036

Browse files
authored
Fixed error message if no artifact found (#2034)
1 parent de8058f commit 0ccd036

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

cargo-pgrx/src/command/install.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -418,12 +418,10 @@ pub(crate) fn find_library_file(
418418
manifest_path: &Path,
419419
build_command_messages: &[CargoMessage],
420420
) -> eyre::Result<PathBuf> {
421-
use std::env::consts::{DLL_EXTENSION, DLL_SUFFIX};
421+
use std::env::consts::DLL_EXTENSION;
422422

423-
// cargo sometimes decides to change whether targets are kebab-case or snake_case in metadata,
424-
// so normalize away the difference
425-
let target_name = manifest.target_name()?.replace('-', "_");
426423
let manifest_path = std::path::absolute(manifest_path)?;
424+
let lib_filename = manifest.lib_filename()?;
427425

428426
// no hard and fast rule for the lib.so output filename exists, so we implement this routine
429427
// which is essentially a cope for cargo's disinterest in writing down any docs so far.
@@ -448,7 +446,7 @@ pub(crate) fn find_library_file(
448446
.map(|filename| filename.to_string())
449447
})
450448
.ok_or_else(|| {
451-
eyre!("Could not get shared object file `{target_name}{DLL_SUFFIX}` from Cargo output.")
449+
eyre!("Could not get shared object file `{lib_filename}` from Cargo output.",)
452450
})?;
453451
let library_file_path = PathBuf::from(library_file);
454452

0 commit comments

Comments
 (0)