Skip to content

Commit ae61430

Browse files
authored
Unrolled build for rust-lang#131365
Rollup merge of rust-lang#131365 - heiseish:fix-issue-101993, r=Mark-Simulacrum Fix missing rustfmt in msi installer rust-lang#101993 # Context - Fixed missing `rustfmt`, `clippy`, `miri` and `rust-analyzer` in msi installer - Fixed missing `rustfmt` for apple darwin installer - Closes rust-lang#101993 r​? `@jyn514` - Please let me know if I should request from someone else instead. I divided the changes into 3 separate commits for the ease of review. The refactoring commit `fbdfd5c03c3c979bcf105ccdd05ff4ab9f37a763` is a bit more involved, but I think it helps in the long term for readability and to avoid bugs. - I changed `build-manifest` to `build_manifest` in order to invoke it as a library. Not sure if this is gonna break any upstream processes. I checked `generate-manifest-list` and `generate-release` but didn't find any obvious reference - Will push fixes for linting later
2 parents bfab34a + 2316749 commit ae61430

File tree

2 files changed

+79
-5
lines changed

2 files changed

+79
-5
lines changed

Diff for: src/bootstrap/src/core/build_steps/dist.rs

+39-4
Original file line numberDiff line numberDiff line change
@@ -1591,9 +1591,15 @@ impl Step for Extended {
15911591
prepare("cargo");
15921592
prepare("rust-std");
15931593
prepare("rust-analysis");
1594-
prepare("clippy");
1595-
prepare("rust-analyzer");
1596-
for tool in &["rust-docs", "miri", "rustc-codegen-cranelift"] {
1594+
1595+
for tool in &[
1596+
"clippy",
1597+
"rustfmt",
1598+
"rust-analyzer",
1599+
"rust-docs",
1600+
"miri",
1601+
"rustc-codegen-cranelift",
1602+
] {
15971603
if built_tools.contains(tool) {
15981604
prepare(tool);
15991605
}
@@ -1633,6 +1639,8 @@ impl Step for Extended {
16331639
"rust-analyzer-preview".to_string()
16341640
} else if name == "clippy" {
16351641
"clippy-preview".to_string()
1642+
} else if name == "rustfmt" {
1643+
"rustfmt-preview".to_string()
16361644
} else if name == "miri" {
16371645
"miri-preview".to_string()
16381646
} else if name == "rustc-codegen-cranelift" {
@@ -1652,7 +1660,7 @@ impl Step for Extended {
16521660
prepare("cargo");
16531661
prepare("rust-analysis");
16541662
prepare("rust-std");
1655-
for tool in &["clippy", "rust-analyzer", "rust-docs", "miri"] {
1663+
for tool in &["clippy", "rustfmt", "rust-analyzer", "rust-docs", "miri"] {
16561664
if built_tools.contains(tool) {
16571665
prepare(tool);
16581666
}
@@ -1770,6 +1778,24 @@ impl Step for Extended {
17701778
.arg(etc.join("msi/remove-duplicates.xsl"))
17711779
.run(builder);
17721780
}
1781+
if built_tools.contains("rustfmt") {
1782+
command(&heat)
1783+
.current_dir(&exe)
1784+
.arg("dir")
1785+
.arg("rustfmt")
1786+
.args(heat_flags)
1787+
.arg("-cg")
1788+
.arg("RustFmtGroup")
1789+
.arg("-dr")
1790+
.arg("RustFmt")
1791+
.arg("-var")
1792+
.arg("var.RustFmtDir")
1793+
.arg("-out")
1794+
.arg(exe.join("RustFmtGroup.wxs"))
1795+
.arg("-t")
1796+
.arg(etc.join("msi/remove-duplicates.xsl"))
1797+
.run(builder);
1798+
}
17731799
if built_tools.contains("miri") {
17741800
command(&heat)
17751801
.current_dir(&exe)
@@ -1841,6 +1867,9 @@ impl Step for Extended {
18411867
if built_tools.contains("clippy") {
18421868
cmd.arg("-dClippyDir=clippy");
18431869
}
1870+
if built_tools.contains("rustfmt") {
1871+
cmd.arg("-dRustFmtDir=rustfmt");
1872+
}
18441873
if built_tools.contains("rust-docs") {
18451874
cmd.arg("-dDocsDir=rust-docs");
18461875
}
@@ -1867,6 +1896,9 @@ impl Step for Extended {
18671896
if built_tools.contains("clippy") {
18681897
candle("ClippyGroup.wxs".as_ref());
18691898
}
1899+
if built_tools.contains("rustfmt") {
1900+
candle("RustFmtGroup.wxs".as_ref());
1901+
}
18701902
if built_tools.contains("miri") {
18711903
candle("MiriGroup.wxs".as_ref());
18721904
}
@@ -1905,6 +1937,9 @@ impl Step for Extended {
19051937
if built_tools.contains("clippy") {
19061938
cmd.arg("ClippyGroup.wixobj");
19071939
}
1940+
if built_tools.contains("rustfmt") {
1941+
cmd.arg("RustFmtGroup.wixobj");
1942+
}
19081943
if built_tools.contains("miri") {
19091944
cmd.arg("MiriGroup.wixobj");
19101945
}

Diff for: 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)