[[package]]
name = "clippy"
-version = "0.0.202"
+version = "0.0.211"
dependencies = [
"ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"clippy-mini-macro-test 0.2.0",
- "clippy_lints 0.0.202",
+ "clippy_lints 0.0.211",
"compiletest_rs 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
"derive-new 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "clippy_lints"
-version = "0.0.202"
+version = "0.0.205"
+source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
[[package]]
name = "clippy_lints"
-version = "0.0.205"
-source = "registry+https://github.com/rust-lang/crates.io-index"
+version = "0.0.211"
dependencies = [
"cargo_metadata 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
"if_chain 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
format!("{}-{}", component, builder.cargo_package_vers())
} else if component == "rls" {
format!("{}-{}", component, builder.rls_package_vers())
+ } else if component == "clippy" {
+ format!("{}-{}", component, builder.clippy_package_vers())
} else if component == "rustfmt" {
format!("{}-{}", component, builder.rustfmt_package_vers())
} else if component == "llvm-tools" {
}
}
+#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
+pub struct Clippy {
+ pub stage: u32,
+ pub target: Interned<String>,
+}
+
+impl Step for Clippy {
+ type Output = Option<PathBuf>;
+ const ONLY_HOSTS: bool = true;
+
+ fn should_run(run: ShouldRun) -> ShouldRun {
+ run.path("clippy")
+ }
+
+ fn make_run(run: RunConfig) {
+ run.builder.ensure(Clippy {
+ stage: run.builder.top_stage,
+ target: run.target,
+ });
+ }
+
+ fn run(self, builder: &Builder) -> Option<PathBuf> {
+ let stage = self.stage;
+ let target = self.target;
+ assert!(builder.config.extended);
+
+ builder.info(&format!("Dist clippy stage{} ({})", stage, target));
+ let src = builder.src.join("src/tools/clippy");
+ let release_num = builder.release_num("clippy");
+ let name = pkgname(builder, "clippy");
+ let version = builder.clippy_info.version(builder, &release_num);
+
+ let tmp = tmpdir(builder);
+ let image = tmp.join("clippy-image");
+ drop(fs::remove_dir_all(&image));
+ t!(fs::create_dir_all(&image));
+
+ // Prepare the image directory
+ // We expect clippy to build, because we've exited this step above if tool
+ // state for clippy isn't testing.
+ let clippy = builder.ensure(tool::Clippy {
+ compiler: builder.compiler(stage, builder.config.build),
+ target, extra_features: Vec::new()
+ }).or_else(|| { println!("Unable to build clippy, skipping dist"); None })?;
+
+ builder.install(&clippy, &image.join("bin"), 0o755);
+ let doc = image.join("share/doc/clippy");
+ builder.install(&src.join("README.md"), &doc, 0o644);
+ builder.install(&src.join("LICENSE"), &doc, 0o644);
+
+ // Prepare the overlay
+ let overlay = tmp.join("clippy-overlay");
+ drop(fs::remove_dir_all(&overlay));
+ t!(fs::create_dir_all(&overlay));
+ builder.install(&src.join("README.md"), &overlay, 0o644);
+ builder.install(&src.join("LICENSE-MIT"), &overlay, 0o644);
+ builder.install(&src.join("LICENSE-APACHE"), &overlay, 0o644);
+ builder.create(&overlay.join("version"), &version);
+
+ // Generate the installer tarball
+ let mut cmd = rust_installer(builder);
+ cmd.arg("generate")
+ .arg("--product-name=Rust")
+ .arg("--rel-manifest-dir=rustlib")
+ .arg("--success-message=clippy-ready-to-serve.")
+ .arg("--image-dir").arg(&image)
+ .arg("--work-dir").arg(&tmpdir(builder))
+ .arg("--output-dir").arg(&distdir(builder))
+ .arg("--non-installed-overlay").arg(&overlay)
+ .arg(format!("--package-name={}-{}", name, target))
+ .arg("--legacy-manifest-dirs=rustlib,cargo")
+ .arg("--component-name=clippy-preview");
+
+ builder.run(&mut cmd);
+ Some(distdir(builder).join(format!("{}-{}.tar.gz", name, target)))
+ }
+}
#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Rustfmt {
let rustfmt_installer = builder.ensure(Rustfmt { stage, target });
let rls_installer = builder.ensure(Rls { stage, target });
let llvm_tools_installer = builder.ensure(LlvmTools { stage, target });
+ let clippy_installer = builder.ensure(Clippy { stage, target });
let mingw_installer = builder.ensure(Mingw { host: target });
let analysis_installer = builder.ensure(Analysis {
compiler: builder.compiler(stage, self.host),
tarballs.push(rustc_installer);
tarballs.push(cargo_installer);
tarballs.extend(rls_installer.clone());
+ tarballs.extend(clippy_installer.clone());
tarballs.extend(rustfmt_installer.clone());
tarballs.extend(llvm_tools_installer.clone());
tarballs.push(analysis_installer);
if rls_installer.is_none() {
contents = filter(&contents, "rls");
}
+ if clippy_installer.is_none() {
+ contents = filter(&contents, "clippy");
+ }
if rustfmt_installer.is_none() {
contents = filter(&contents, "rustfmt");
}
if rls_installer.is_some() {
prepare("rls");
}
+ if clippy_installer.is_some() {
+ prepare("clippy");
+ }
// create an 'uninstall' package
builder.install(&etc.join("pkg/postinstall"), &pkg.join("uninstall"), 0o755);
format!("{}-{}", name, target)
} else if name == "rls" {
"rls-preview".to_string()
+ } else if name == "clippy" {
+ "clippy-preview".to_string()
} else {
name.to_string()
};
if rls_installer.is_some() {
prepare("rls");
}
+ if clippy_installer.is_some() {
+ prepare("clippy");
+ }
if target.contains("windows-gnu") {
prepare("rust-mingw");
}
.arg("-out").arg(exe.join("RlsGroup.wxs"))
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
}
+ if clippy_installer.is_some() {
+ builder.run(Command::new(&heat)
+ .current_dir(&exe)
+ .arg("dir")
+ .arg("clippy")
+ .args(&heat_flags)
+ .arg("-cg").arg("ClippyGroup")
+ .arg("-dr").arg("Clippy")
+ .arg("-var").arg("var.ClippyDir")
+ .arg("-out").arg(exe.join("ClippyGroup.wxs"))
+ .arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
+ }
builder.run(Command::new(&heat)
.current_dir(&exe)
.arg("dir")
if rls_installer.is_some() {
cmd.arg("-dRlsDir=rls");
}
+ if clippy_installer.is_some() {
+ cmd.arg("-dClippyDir=clippy");
+ }
if target.contains("windows-gnu") {
cmd.arg("-dGccDir=rust-mingw");
}
if rls_installer.is_some() {
candle("RlsGroup.wxs".as_ref());
}
+ if clippy_installer.is_some() {
+ candle("ClippyGroup.wxs".as_ref());
+ }
candle("AnalysisGroup.wxs".as_ref());
if target.contains("windows-gnu") {
if rls_installer.is_some() {
cmd.arg("RlsGroup.wixobj");
}
+ if clippy_installer.is_some() {
+ cmd.arg("ClippyGroup.wixobj");
+ }
if target.contains("windows-gnu") {
cmd.arg("GccGroup.wixobj");
cmd.arg(builder.rust_package_vers());
cmd.arg(builder.package_vers(&builder.release_num("cargo")));
cmd.arg(builder.package_vers(&builder.release_num("rls")));
+ cmd.arg(builder.package_vers(&builder.release_num("clippy")));
cmd.arg(builder.package_vers(&builder.release_num("rustfmt")));
cmd.arg(builder.llvm_tools_package_vers());
cmd.arg(addr);
pub fn install_rls(builder: &Builder, stage: u32, host: Interned<String>) {
install_sh(builder, "rls", "rls", stage, Some(host));
}
+pub fn install_clippy(builder: &Builder, stage: u32, host: Interned<String>) {
+ install_sh(builder, "clippy", "clippy", stage, Some(host));
+}
pub fn install_rustfmt(builder: &Builder, stage: u32, host: Interned<String>) {
install_sh(builder, "rustfmt", "rustfmt", stage, Some(host));
builder.info(&format!("skipping Install RLS stage{} ({})", self.stage, self.target));
}
};
+ Clippy, "clippy", Self::should_build(_config), only_hosts: true, {
+ if builder.ensure(dist::Clippy { stage: self.stage, target: self.target }).is_some() ||
+ Self::should_install(builder) {
+ install_clippy(builder, self.stage, self.target);
+ } else {
+ builder.info(&format!("skipping Install clippy stage{} ({})", self.stage, self.target));
+ }
+ };
Rustfmt, "rustfmt", Self::should_build(_config), only_hosts: true, {
if builder.ensure(dist::Rustfmt { stage: self.stage, target: self.target }).is_some() ||
Self::should_install(builder) {
rust_info: channel::GitInfo,
cargo_info: channel::GitInfo,
rls_info: channel::GitInfo,
+ clippy_info: channel::GitInfo,
rustfmt_info: channel::GitInfo,
local_rebuild: bool,
fail_fast: bool,
let rust_info = channel::GitInfo::new(&config, &src);
let cargo_info = channel::GitInfo::new(&config, &src.join("src/tools/cargo"));
let rls_info = channel::GitInfo::new(&config, &src.join("src/tools/rls"));
+ let clippy_info = channel::GitInfo::new(&config, &src.join("src/tools/clippy"));
let rustfmt_info = channel::GitInfo::new(&config, &src.join("src/tools/rustfmt"));
let mut build = Build {
rust_info,
cargo_info,
rls_info,
+ clippy_info,
rustfmt_info,
cc: HashMap::new(),
cxx: HashMap::new(),
self.package_vers(&self.release_num("rls"))
}
+ /// Returns the value of `package_vers` above for clippy
+ fn clippy_package_vers(&self) -> String {
+ self.package_vers(&self.release_num("clippy"))
+ }
+
/// Returns the value of `package_vers` above for rustfmt
fn rustfmt_package_vers(&self) -> String {
self.package_vers(&self.release_num("rustfmt"))
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" {
+ if tool != "rls" && tool != "cargo" && tool != "clippy-driver" {
return
}
let (id, features, filenames) = match msg {
rust_release: String,
cargo_release: String,
rls_release: String,
+ clippy_release: String,
rustfmt_release: String,
llvm_tools_release: String,
rust_version: Option<String>,
cargo_version: Option<String>,
rls_version: Option<String>,
+ clippy_version: Option<String>,
rustfmt_version: Option<String>,
llvm_tools_version: Option<String>,
rust_git_commit_hash: Option<String>,
cargo_git_commit_hash: Option<String>,
rls_git_commit_hash: Option<String>,
+ clippy_git_commit_hash: Option<String>,
rustfmt_git_commit_hash: Option<String>,
llvm_tools_git_commit_hash: Option<String>,
}
let rust_release = args.next().unwrap();
let cargo_release = args.next().unwrap();
let rls_release = args.next().unwrap();
+ let clippy_release = args.next().unwrap();
let rustfmt_release = args.next().unwrap();
let llvm_tools_release = args.next().unwrap();
let s3_address = args.next().unwrap();
rust_release,
cargo_release,
rls_release,
+ clippy_release,
rustfmt_release,
llvm_tools_release,
rust_version: None,
cargo_version: None,
rls_version: None,
+ clippy_version: None,
rustfmt_version: None,
llvm_tools_version: None,
rust_git_commit_hash: None,
cargo_git_commit_hash: None,
rls_git_commit_hash: None,
+ clippy_git_commit_hash: None,
rustfmt_git_commit_hash: None,
llvm_tools_git_commit_hash: None,
}.build();
self.rust_git_commit_hash = self.git_commit_hash("rust", "x86_64-unknown-linux-gnu");
self.cargo_git_commit_hash = self.git_commit_hash("cargo", "x86_64-unknown-linux-gnu");
self.rls_git_commit_hash = self.git_commit_hash("rls", "x86_64-unknown-linux-gnu");
+ self.clippy_git_commit_hash = self.git_commit_hash("clippy", "x86_64-unknown-linux-gnu");
self.rustfmt_git_commit_hash = self.git_commit_hash("rustfmt", "x86_64-unknown-linux-gnu");
self.llvm_tools_git_commit_hash = self.git_commit_hash("llvm-tools",
"x86_64-unknown-linux-gnu");
self.package("rust-docs", &mut manifest.pkg, TARGETS);
self.package("rust-src", &mut manifest.pkg, &["*"]);
self.package("rls-preview", &mut manifest.pkg, HOSTS);
+ self.package("clippy-preview", &mut manifest.pkg, HOSTS);
self.package("rustfmt-preview", &mut manifest.pkg, HOSTS);
self.package("rust-analysis", &mut manifest.pkg, TARGETS);
self.package("llvm-tools", &mut manifest.pkg, TARGETS);
+ let clippy_present = manifest.pkg.contains_key("clippy-preview");
let rls_present = manifest.pkg.contains_key("rls-preview");
let rustfmt_present = manifest.pkg.contains_key("rustfmt-preview");
let llvm_tools_present = manifest.pkg.contains_key("llvm-tools");
});
}
+ if clippy_present {
+ extensions.push(Component {
+ pkg: "clippy-preview".to_string(),
+ target: host.to_string(),
+ });
+ }
if rls_present {
extensions.push(Component {
pkg: "rls-preview".to_string(),
format!("cargo-{}-{}.tar.gz", self.cargo_release, target)
} else if component == "rls" || component == "rls-preview" {
format!("rls-{}-{}.tar.gz", self.rls_release, target)
+ } else if component == "clippy" || component == "clippy-preview" {
+ format!("clippy-{}-{}.tar.gz", self.clippy_release, target)
} else if component == "rustfmt" || component == "rustfmt-preview" {
format!("rustfmt-{}-{}.tar.gz", self.rustfmt_release, target)
} else if component == "llvm_tools" {
&self.cargo_version
} else if component == "rls" || component == "rls-preview" {
&self.rls_version
+ } else if component == "clippy" || component == "clippy-preview" {
+ &self.clippy_version
} else if component == "rustfmt" || component == "rustfmt-preview" {
&self.rustfmt_version
} else if component == "llvm-tools" {
&self.cargo_git_commit_hash
} else if component == "rls" || component == "rls-preview" {
&self.rls_git_commit_hash
+ } else if component == "clippy" || component == "clippy-preview" {
+ &self.clippy_git_commit_hash
} else if component == "rustfmt" || component == "rustfmt-preview" {
&self.rustfmt_git_commit_hash
} else if component == "llvm-tools" {
-Subproject commit ebe0b0eed596243a2839867363cb31d93f0b9754
+Subproject commit b4b6e6558e3ccd5ef11758297dc064acceb15ef2