Skip to content
/ rust Public
forked from rust-lang/rust

Commit a56b1d2

Browse files
committed
fix missing rustfmt and clippy for msi
1 parent 2828650 commit a56b1d2

File tree

2 files changed

+70
-2
lines changed

2 files changed

+70
-2
lines changed

src/bootstrap/src/core/build_steps/dist.rs

+30-1
Original file line numberDiff line numberDiff line change
@@ -1627,6 +1627,8 @@ impl Step for Extended {
16271627
"rust-analyzer-preview".to_string()
16281628
} else if name == "clippy" {
16291629
"clippy-preview".to_string()
1630+
} else if name == "rustfmt" {
1631+
"rustfmt-preview".to_string()
16301632
} else if name == "miri" {
16311633
"miri-preview".to_string()
16321634
} else if name == "rustc-codegen-cranelift" {
@@ -1646,7 +1648,7 @@ impl Step for Extended {
16461648
prepare("cargo");
16471649
prepare("rust-analysis");
16481650
prepare("rust-std");
1649-
for tool in &["clippy", "rust-analyzer", "rust-docs", "miri"] {
1651+
for tool in &["clippy", "rustfmt", "rust-analyzer", "rust-docs", "miri"] {
16501652
if built_tools.contains(tool) {
16511653
prepare(tool);
16521654
}
@@ -1764,6 +1766,24 @@ impl Step for Extended {
17641766
.arg(etc.join("msi/remove-duplicates.xsl"))
17651767
.run(builder);
17661768
}
1769+
if built_tools.contains("rustfmt") {
1770+
command(&heat)
1771+
.current_dir(&exe)
1772+
.arg("dir")
1773+
.arg("rustfmt")
1774+
.args(heat_flags)
1775+
.arg("-cg")
1776+
.arg("RustFmtGroup")
1777+
.arg("-dr")
1778+
.arg("RustFmt")
1779+
.arg("-var")
1780+
.arg("var.RustFmtDir")
1781+
.arg("-out")
1782+
.arg(exe.join("RustFmtGroup.wxs"))
1783+
.arg("-t")
1784+
.arg(etc.join("msi/remove-duplicates.xsl"))
1785+
.run(builder);
1786+
}
17671787
if built_tools.contains("miri") {
17681788
command(&heat)
17691789
.current_dir(&exe)
@@ -1835,6 +1855,9 @@ impl Step for Extended {
18351855
if built_tools.contains("clippy") {
18361856
cmd.arg("-dClippyDir=clippy");
18371857
}
1858+
if built_tools.contains("rustfmt") {
1859+
cmd.arg("-dRustFmtDir=rustfmt");
1860+
}
18381861
if built_tools.contains("rust-docs") {
18391862
cmd.arg("-dDocsDir=rust-docs");
18401863
}
@@ -1861,6 +1884,9 @@ impl Step for Extended {
18611884
if built_tools.contains("clippy") {
18621885
candle("ClippyGroup.wxs".as_ref());
18631886
}
1887+
if built_tools.contains("rustfmt") {
1888+
candle("RustFmtGroup.wxs".as_ref());
1889+
}
18641890
if built_tools.contains("miri") {
18651891
candle("MiriGroup.wxs".as_ref());
18661892
}
@@ -1899,6 +1925,9 @@ impl Step for Extended {
18991925
if built_tools.contains("clippy") {
19001926
cmd.arg("ClippyGroup.wixobj");
19011927
}
1928+
if built_tools.contains("rustfmt") {
1929+
cmd.arg("RustFmtGroup.wixobj");
1930+
}
19021931
if built_tools.contains("miri") {
19031932
cmd.arg("MiriGroup.wixobj");
19041933
}

src/etc/installer/msi/rust.wxs

+40-1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,11 @@
172172
<!-- tool-rust-docs-end -->
173173
<Directory Id="Cargo" Name="." />
174174
<Directory Id="Std" Name="." />
175+
<Directory Id="RustFmt" Name="." />
176+
<Directory Id="RustAnalyzer" Name="." />
177+
<Directory Id="Miri" Name="." />
178+
<Directory Id="Analysis" Name="." />
179+
<Directory Id="Clippy" Name="." />
175180
</Directory>
176181
</Directory>
177182

@@ -279,7 +284,41 @@
279284
<ComponentRef Id="PathEnvPerMachine" />
280285
<ComponentRef Id="PathEnvPerUser" />
281286
</Feature>
282-
287+
<Feature Id="RustFmt"
288+
Title="Formatter for rust"
289+
Display="7"
290+
Level="1"
291+
AllowAdvertise="no">
292+
<ComponentGroupRef Id="RustFmtGroup" />
293+
</Feature>
294+
<Feature Id="Clippy"
295+
Title="Formatter and checker for rust"
296+
Display="8"
297+
Level="1"
298+
AllowAdvertise="no">
299+
<ComponentGroupRef Id="ClippyGroup" />
300+
</Feature>
301+
<Feature Id="Miri"
302+
Title="Soundness checker for rust"
303+
Display="9"
304+
Level="1"
305+
AllowAdvertise="no">
306+
<ComponentGroupRef Id="MiriGroup" />
307+
</Feature>
308+
<Feature Id="RustAnalyzer"
309+
Title="Analyzer for rust"
310+
Display="10"
311+
Level="1"
312+
AllowAdvertise="no">
313+
<ComponentGroupRef Id="RustAnalyzerGroup" />
314+
</Feature>
315+
<Feature Id="Analysis"
316+
Title="Analysis for rust"
317+
Display="11"
318+
Level="1"
319+
AllowAdvertise="no">
320+
<ComponentGroupRef Id="AnalysisGroup" />
321+
</Feature>
283322
<UIRef Id="RustUI" />
284323
</Product>
285324
</Wix>

0 commit comments

Comments
 (0)