Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit f5577a8

Browse files
committedOct 15, 2024
fix missing rustfmt and clippy for msi
1 parent f79fae3 commit f5577a8

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
@@ -1633,6 +1633,8 @@ impl Step for Extended {
16331633
"rust-analyzer-preview".to_string()
16341634
} else if name == "clippy" {
16351635
"clippy-preview".to_string()
1636+
} else if name == "rustfmt" {
1637+
"rustfmt-preview".to_string()
16361638
} else if name == "miri" {
16371639
"miri-preview".to_string()
16381640
} else if name == "rustc-codegen-cranelift" {
@@ -1652,7 +1654,7 @@ impl Step for Extended {
16521654
prepare("cargo");
16531655
prepare("rust-analysis");
16541656
prepare("rust-std");
1655-
for tool in &["clippy", "rust-analyzer", "rust-docs", "miri"] {
1657+
for tool in &["clippy", "rustfmt", "rust-analyzer", "rust-docs", "miri"] {
16561658
if built_tools.contains(tool) {
16571659
prepare(tool);
16581660
}
@@ -1770,6 +1772,24 @@ impl Step for Extended {
17701772
.arg(etc.join("msi/remove-duplicates.xsl"))
17711773
.run(builder);
17721774
}
1775+
if built_tools.contains("rustfmt") {
1776+
command(&heat)
1777+
.current_dir(&exe)
1778+
.arg("dir")
1779+
.arg("rustfmt")
1780+
.args(heat_flags)
1781+
.arg("-cg")
1782+
.arg("RustFmtGroup")
1783+
.arg("-dr")
1784+
.arg("RustFmt")
1785+
.arg("-var")
1786+
.arg("var.RustFmtDir")
1787+
.arg("-out")
1788+
.arg(exe.join("RustFmtGroup.wxs"))
1789+
.arg("-t")
1790+
.arg(etc.join("msi/remove-duplicates.xsl"))
1791+
.run(builder);
1792+
}
17731793
if built_tools.contains("miri") {
17741794
command(&heat)
17751795
.current_dir(&exe)
@@ -1841,6 +1861,9 @@ impl Step for Extended {
18411861
if built_tools.contains("clippy") {
18421862
cmd.arg("-dClippyDir=clippy");
18431863
}
1864+
if built_tools.contains("rustfmt") {
1865+
cmd.arg("-dRustFmtDir=rustfmt");
1866+
}
18441867
if built_tools.contains("rust-docs") {
18451868
cmd.arg("-dDocsDir=rust-docs");
18461869
}
@@ -1867,6 +1890,9 @@ impl Step for Extended {
18671890
if built_tools.contains("clippy") {
18681891
candle("ClippyGroup.wxs".as_ref());
18691892
}
1893+
if built_tools.contains("rustfmt") {
1894+
candle("RustFmtGroup.wxs".as_ref());
1895+
}
18701896
if built_tools.contains("miri") {
18711897
candle("MiriGroup.wxs".as_ref());
18721898
}
@@ -1905,6 +1931,9 @@ impl Step for Extended {
19051931
if built_tools.contains("clippy") {
19061932
cmd.arg("ClippyGroup.wixobj");
19071933
}
1934+
if built_tools.contains("rustfmt") {
1935+
cmd.arg("RustFmtGroup.wixobj");
1936+
}
19081937
if built_tools.contains("miri") {
19091938
cmd.arg("MiriGroup.wixobj");
19101939
}

‎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)
Failed to load comments.