Rollup merge of #78709 - ehuss:fix-in_tree_crates-non-member, r=Mark-Simulacrum

Fix panic in bootstrap for non-workspace path dependencies.

If you add a `path` dependency to a `Cargo.toml` that is located outside of the workspace, then the `in_tree_crates` function can panic because it finds a path dependency that is not defined (since it uses `cargo metadata --no-deps`).  This fixes it by skipping over those entries, which are usually not things you select on the command-line.

Fixes #78617
This commit is contained in:
Mara Bos 2020-11-03 19:32:44 +01:00 committed by GitHub
commit a65507b47d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1119,6 +1119,10 @@ impl Build {
let krate = &self.crates[&krate];
ret.push(krate);
for dep in &krate.deps {
if !self.crates.contains_key(dep) {
// Ignore non-workspace members.
continue;
}
// Don't include optional deps if their features are not
// enabled. Ideally this would be computed from `cargo
// metadata --features …`, but that is somewhat slow. Just