Skip to content

Commit

Permalink
Fix panicking when no cargo build targets are selected
Browse files Browse the repository at this point in the history
Closes #1632
  • Loading branch information
messense committed May 27, 2023
1 parent f1e25dc commit 1333409
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/build_options.rs
Original file line number Diff line number Diff line change
Expand Up @@ -647,6 +647,9 @@ impl BuildOptions {
let config_targets = pyproject.and_then(|x| x.targets());
let compile_targets =
filter_cargo_targets(&cargo_metadata, bridge, config_targets.as_deref())?;
if compile_targets.is_empty() {
bail!("No Cargo targets to build, please check your bindings configuration in pyproject.toml.");
}

let crate_name = cargo_toml.package.name;
Ok(BuildContext {
Expand Down

0 comments on commit 1333409

Please sign in to comment.