Skip to content

Commit 07e96ab

Browse files
authored
Merge pull request #1635 from messense/fix-1632
Fix panicking when no cargo build targets are selected
2 parents f1e25dc + 1333409 commit 07e96ab

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/build_options.rs

+3
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,9 @@ impl BuildOptions {
647647
let config_targets = pyproject.and_then(|x| x.targets());
648648
let compile_targets =
649649
filter_cargo_targets(&cargo_metadata, bridge, config_targets.as_deref())?;
650+
if compile_targets.is_empty() {
651+
bail!("No Cargo targets to build, please check your bindings configuration in pyproject.toml.");
652+
}
650653

651654
let crate_name = cargo_toml.package.name;
652655
Ok(BuildContext {

0 commit comments

Comments
 (0)