From 82a132874070bff23fa8b372dd4702ac738be9eb Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Thu, 5 Jul 2018 18:48:56 +0200 Subject: [PATCH 1/3] Vertical list of tools to check --- src/bootstrap/tool.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index 23b3f5a0826..a85594d4d3d 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -118,8 +118,13 @@ impl Step for ToolBuild { let mut duplicates = Vec::new(); let is_expected = compile::stream_cargo(builder, &mut cargo, &mut |msg| { // Only care about big things like the RLS/Cargo for now - if tool != "rls" && tool != "cargo" && tool != "clippy-driver" { - return + match tool { + | "rls" + | "cargo" + | "clippy-driver" + => {} + + _ => return, } let (id, features, filenames) = match msg { compile::CargoMessage::CompilerArtifact { From f1e3a5a24be0429b046726f6f945595f5513f093 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Thu, 5 Jul 2018 19:02:43 +0200 Subject: [PATCH 2/3] Only display difference of features, not all features --- src/bootstrap/tool.rs | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index a85594d4d3d..ec904eb2134 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -13,6 +13,7 @@ use std::env; use std::iter; use std::path::PathBuf; use std::process::{Command, exit}; +use std::collections::HashSet; use Mode; use Compiler; @@ -183,12 +184,29 @@ impl Step for ToolBuild { typically means that something was recompiled because \ a transitive dependency has different features activated \ than in a previous build:\n"); + println!("the following dependencies are duplicated although they \ + have the same features enabled:"); + for (id, cur, prev) in &duplicates { + println!(" {}", id); + if cur.2 == prev.2 { + // same features + println!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1); + } + } + println!("the following dependencies have different features:"); for (id, cur, prev) in duplicates { println!(" {}", id); - println!(" `{}` enabled features {:?} at {:?}", - cur.0, cur.2, cur.1); - println!(" `{}` enabled features {:?} at {:?}", - prev.0, prev.2, prev.1); + if cur.2 == prev.2 { + continue; + } + let cur_features: HashSet<_> = cur.2.into_iter().collect(); + let prev_features: HashSet<_> = prev.2.into_iter().collect(); + let cur_extra: Vec<_> = cur_features.difference(&prev_features).collect(); + let prev_extra: Vec<_> = prev_features.difference(&cur_features).collect(); + println!(" `{}` additionally enabled features {:?} at {:?}", + cur.0, cur_extra, cur.1); + println!(" `{}` additionally enabled features {:?} at {:?}", + prev.0, prev_extra, prev.1); } println!(""); panic!("tools should not compile multiple copies of the same crate"); From f352e98ddc17a992d724053e89479e0fbf080343 Mon Sep 17 00:00:00 2001 From: Oliver Schneider Date: Thu, 5 Jul 2018 19:30:06 +0200 Subject: [PATCH 3/3] Address review comments --- src/bootstrap/lib.rs | 1 + src/bootstrap/tool.rs | 17 +++++------------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 414f17dfad4..29ba635a9b7 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -115,6 +115,7 @@ #![deny(warnings)] #![feature(core_intrinsics)] +#![feature(drain_filter)] #[macro_use] extern crate build_helper; diff --git a/src/bootstrap/tool.rs b/src/bootstrap/tool.rs index ec904eb2134..12b3d59e93d 100644 --- a/src/bootstrap/tool.rs +++ b/src/bootstrap/tool.rs @@ -186,27 +186,20 @@ impl Step for ToolBuild { than in a previous build:\n"); println!("the following dependencies are duplicated although they \ have the same features enabled:"); - for (id, cur, prev) in &duplicates { + for (id, cur, prev) in duplicates.drain_filter(|(_, cur, prev)| cur.2 == prev.2) { println!(" {}", id); - if cur.2 == prev.2 { - // same features - println!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1); - } + // same features + println!(" `{}` ({:?})\n `{}` ({:?})", cur.0, cur.1, prev.0, prev.1); } println!("the following dependencies have different features:"); for (id, cur, prev) in duplicates { println!(" {}", id); - if cur.2 == prev.2 { - continue; - } let cur_features: HashSet<_> = cur.2.into_iter().collect(); let prev_features: HashSet<_> = prev.2.into_iter().collect(); - let cur_extra: Vec<_> = cur_features.difference(&prev_features).collect(); - let prev_extra: Vec<_> = prev_features.difference(&cur_features).collect(); println!(" `{}` additionally enabled features {:?} at {:?}", - cur.0, cur_extra, cur.1); + cur.0, &cur_features - &prev_features, cur.1); println!(" `{}` additionally enabled features {:?} at {:?}", - prev.0, prev_extra, prev.1); + prev.0, &prev_features - &cur_features, prev.1); } println!(""); panic!("tools should not compile multiple copies of the same crate");