Skip to content

Commit

Permalink
msvc dist extended: clippy is optional
Browse files Browse the repository at this point in the history
The windows tarballs and installers expect clippy to be present, but
it's not always the case. For example, in try builds.
  • Loading branch information
lqd committed Jul 1, 2023
1 parent 6b06fdf commit 8a4a6f7
Showing 1 changed file with 29 additions and 22 deletions.
51 changes: 29 additions & 22 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1601,9 +1601,8 @@ impl Step for Extended {
prepare("cargo");
prepare("rust-analysis");
prepare("rust-std");
prepare("clippy");
prepare("rust-analyzer");
for tool in &["rust-docs", "rust-demangler", "miri"] {
for tool in &["clippy", "rust-docs", "rust-demangler", "miri"] {
if built_tools.contains(tool) {
prepare(tool);
}
Expand Down Expand Up @@ -1706,23 +1705,25 @@ impl Step for Extended {
.arg("-t")
.arg(etc.join("msi/remove-duplicates.xsl")),
);
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")),
);
if built_tools.contains("clippy") {
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")),
);
}
if built_tools.contains("rust-demangler") {
builder.run(
Command::new(&heat)
Expand Down Expand Up @@ -1806,14 +1807,16 @@ impl Step for Extended {
.arg("-dCargoDir=cargo")
.arg("-dStdDir=rust-std")
.arg("-dAnalysisDir=rust-analysis")
.arg("-dClippyDir=clippy")
.arg("-arch")
.arg(&arch)
.arg("-out")
.arg(&output)
.arg(&input);
add_env(builder, &mut cmd, target);

if built_tools.contains("clippy") {
cmd.arg("-dClippyDir=clippy");
}
if built_tools.contains("rust-docs") {
cmd.arg("-dDocsDir=rust-docs");
}
Expand All @@ -1840,7 +1843,9 @@ impl Step for Extended {
}
candle("CargoGroup.wxs".as_ref());
candle("StdGroup.wxs".as_ref());
candle("ClippyGroup.wxs".as_ref());
if built_tools.contains("clippy") {
candle("ClippyGroup.wxs".as_ref());
}
if built_tools.contains("miri") {
candle("MiriGroup.wxs".as_ref());
}
Expand Down Expand Up @@ -1877,9 +1882,11 @@ impl Step for Extended {
.arg("CargoGroup.wixobj")
.arg("StdGroup.wixobj")
.arg("AnalysisGroup.wixobj")
.arg("ClippyGroup.wixobj")
.current_dir(&exe);

if built_tools.contains("clippy") {
cmd.arg("ClippyGroup.wixobj");
}
if built_tools.contains("miri") {
cmd.arg("MiriGroup.wixobj");
}
Expand Down

0 comments on commit 8a4a6f7

Please sign in to comment.