Skip to content

Commit 6b57a34

Browse files
committed
Make rust-docs optional for the Windows MSI installer.
1 parent 7b9aa5f commit 6b57a34

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

src/bootstrap/dist.rs

+29-22
Original file line numberDiff line numberDiff line change
@@ -1585,11 +1585,10 @@ impl Step for Extended {
15851585
prepare("rustc");
15861586
prepare("cargo");
15871587
prepare("rust-analysis");
1588-
prepare("rust-docs");
15891588
prepare("rust-std");
15901589
prepare("clippy");
15911590
prepare("rust-analyzer");
1592-
for tool in &["rust-demangler", "miri"] {
1591+
for tool in &["rust-docs", "rust-demangler", "miri"] {
15931592
if built_tools.contains(tool) {
15941593
prepare(tool);
15951594
}
@@ -1624,23 +1623,25 @@ impl Step for Extended {
16241623
.arg("-out")
16251624
.arg(exe.join("RustcGroup.wxs")),
16261625
);
1627-
builder.run(
1628-
Command::new(&heat)
1629-
.current_dir(&exe)
1630-
.arg("dir")
1631-
.arg("rust-docs")
1632-
.args(&heat_flags)
1633-
.arg("-cg")
1634-
.arg("DocsGroup")
1635-
.arg("-dr")
1636-
.arg("Docs")
1637-
.arg("-var")
1638-
.arg("var.DocsDir")
1639-
.arg("-out")
1640-
.arg(exe.join("DocsGroup.wxs"))
1641-
.arg("-t")
1642-
.arg(etc.join("msi/squash-components.xsl")),
1643-
);
1626+
if built_tools.contains("rust-docs") {
1627+
builder.run(
1628+
Command::new(&heat)
1629+
.current_dir(&exe)
1630+
.arg("dir")
1631+
.arg("rust-docs")
1632+
.args(&heat_flags)
1633+
.arg("-cg")
1634+
.arg("DocsGroup")
1635+
.arg("-dr")
1636+
.arg("Docs")
1637+
.arg("-var")
1638+
.arg("var.DocsDir")
1639+
.arg("-out")
1640+
.arg(exe.join("DocsGroup.wxs"))
1641+
.arg("-t")
1642+
.arg(etc.join("msi/squash-components.xsl")),
1643+
);
1644+
}
16441645
builder.run(
16451646
Command::new(&heat)
16461647
.current_dir(&exe)
@@ -1787,7 +1788,6 @@ impl Step for Extended {
17871788
cmd.current_dir(&exe)
17881789
.arg("-nologo")
17891790
.arg("-dRustcDir=rustc")
1790-
.arg("-dDocsDir=rust-docs")
17911791
.arg("-dCargoDir=cargo")
17921792
.arg("-dStdDir=rust-std")
17931793
.arg("-dAnalysisDir=rust-analysis")
@@ -1799,6 +1799,9 @@ impl Step for Extended {
17991799
.arg(&input);
18001800
add_env(builder, &mut cmd, target);
18011801

1802+
if built_tools.contains("rust-docs") {
1803+
cmd.arg("-dDocsDir=rust-docs");
1804+
}
18021805
if built_tools.contains("rust-demangler") {
18031806
cmd.arg("-dRustDemanglerDir=rust-demangler");
18041807
}
@@ -1817,7 +1820,9 @@ impl Step for Extended {
18171820
candle(&etc.join("msi/ui.wxs"));
18181821
candle(&etc.join("msi/rustwelcomedlg.wxs"));
18191822
candle("RustcGroup.wxs".as_ref());
1820-
candle("DocsGroup.wxs".as_ref());
1823+
if built_tools.contains("rust-docs") {
1824+
candle("DocsGroup.wxs".as_ref());
1825+
}
18211826
candle("CargoGroup.wxs".as_ref());
18221827
candle("StdGroup.wxs".as_ref());
18231828
candle("ClippyGroup.wxs".as_ref());
@@ -1854,7 +1859,6 @@ impl Step for Extended {
18541859
.arg("ui.wixobj")
18551860
.arg("rustwelcomedlg.wixobj")
18561861
.arg("RustcGroup.wixobj")
1857-
.arg("DocsGroup.wixobj")
18581862
.arg("CargoGroup.wixobj")
18591863
.arg("StdGroup.wixobj")
18601864
.arg("AnalysisGroup.wixobj")
@@ -1870,6 +1874,9 @@ impl Step for Extended {
18701874
if built_tools.contains("rust-demangler") {
18711875
cmd.arg("RustDemanglerGroup.wixobj");
18721876
}
1877+
if built_tools.contains("rust-docs") {
1878+
cmd.arg("DocsGroup.wixobj");
1879+
}
18731880

18741881
if target.ends_with("windows-gnu") {
18751882
cmd.arg("GccGroup.wixobj");

src/etc/installer/msi/rust.wxs

+6
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,9 @@
167167
<?if $(env.CFG_MINGW)="1" ?>
168168
<Directory Id="Gcc" Name="." />
169169
<?endif?>
170+
<!-- tool-rust-docs-start -->
170171
<Directory Id="Docs" Name="." />
172+
<!-- tool-rust-docs-end -->
171173
<Directory Id="Cargo" Name="." />
172174
<Directory Id="Std" Name="." />
173175
</Directory>
@@ -209,6 +211,7 @@
209211
<RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="RustShell" Type="integer" Value="1" KeyPath="yes" />
210212
<RemoveFolder Id="ApplicationProgramsFolder1" On="uninstall" />
211213
</Component>
214+
<!-- tool-rust-docs-start -->
212215
<Component Id="DocIndexShortcut" Guid="*">
213216
<Shortcut Id="RustDocs"
214217
Name="$(var.ProductName) Documentation"
@@ -217,6 +220,7 @@
217220
<RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="RustDocs" Type="integer" Value="1" KeyPath="yes" />
218221
<RemoveFolder Id="ApplicationProgramsFolder2" On="uninstall" />
219222
</Component>
223+
<!-- tool-rust-docs-end -->
220224
</Directory>
221225
</Directory>
222226

@@ -256,6 +260,7 @@
256260
<ComponentGroupRef Id="GccGroup" />
257261
</Feature>
258262
<?endif?>
263+
<!-- tool-rust-docs-start -->
259264
<Feature Id="Docs"
260265
Title="HTML documentation"
261266
Display="5"
@@ -264,6 +269,7 @@
264269
<ComponentGroupRef Id="DocsGroup" />
265270
<ComponentRef Id="DocIndexShortcut" />
266271
</Feature>
272+
<!-- tool-rust-docs-end -->
267273
<Feature Id="Path"
268274
Title="Add to PATH"
269275
Description="Add Rust to PATH environment variable"

0 commit comments

Comments
 (0)