Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit cc885b4

Browse files
committed
Properly warn if a package lacks [lib] target
Otherwise it errors out with a "lost build artifact", which may be hard to decipher.
1 parent 78f0426 commit cc885b4

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/bin/cargo_semver.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ fn run(config: &cargo::Config, matches: &getopts::Matches) -> Result<()> {
119119
};
120120
let name = current.package.name().to_owned();
121121

122+
if !current.package.targets().iter().any(|t| t.is_lib()) {
123+
return Err(anyhow::anyhow!("package `{}` lacks required [lib] target", &name));
124+
}
125+
122126
// TODO: JSON output here
123127
if matches.opt_present("show-public") {
124128
let (current_rlib, current_deps_output) =

0 commit comments

Comments
 (0)