Skip to content

Commit

Permalink
Rollup merge of rust-lang#78709 - ehuss:fix-in_tree_crates-non-member…
Browse files Browse the repository at this point in the history
…, 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 rust-lang#78617
  • Loading branch information
m-ou-se authored Nov 3, 2020
2 parents f9dd8d3 + 2172adb commit a65507b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit a65507b

Please sign in to comment.