Skip to content

Fixed error message if no artifact found #2034

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions cargo-pgrx/src/command/install.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,12 +418,10 @@ pub(crate) fn find_library_file(
manifest_path: &Path,
build_command_messages: &Vec<CargoMessage>,
) -> eyre::Result<PathBuf> {
use std::env::consts::{DLL_EXTENSION, DLL_SUFFIX};
use std::env::consts::DLL_EXTENSION;

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

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

Expand Down
Loading