* targeted error message for virtual manifests
* assert correct error message
This commit is contained in:
Timothy Bess 2018-02-28 16:43:08 -05:00
parent 7334fe42b8
commit 05b896ac90
2 changed files with 7 additions and 4 deletions

View File

@ -156,12 +156,14 @@ impl<'a> Packages<'a> {
} }
}; };
if specs.is_empty() { if specs.is_empty() {
bail!("Workspace contains no members to be compiled. \ match ws.is_virtual() {
Be sure all workspace members haven't been excluded") true => bail!("manifest path `{}` contains no package: The manifest is virtual, \
} else { and the workspace has no members.", ws.root().display()),
Ok(specs) false => bail!("no packages to compile"),
} }
} }
Ok(specs)
}
} }
#[derive(Clone, Copy, Debug)] #[derive(Clone, Copy, Debug)]

View File

@ -152,6 +152,7 @@ fn cargo_compile_with_workspace_excluded() {
assert_that( assert_that(
p.cargo("build").arg("--all").arg("--exclude").arg("foo"), p.cargo("build").arg("--all").arg("--exclude").arg("foo"),
execs().with_stderr_does_not_contain("[..]virtual[..]") execs().with_stderr_does_not_contain("[..]virtual[..]")
.with_stderr_contains("[..]no packages to compile")
.with_status(101)); .with_status(101));
} }