mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-19 18:34:08 +00:00
Auto merge of #109880 - ehuss:fix-macos-installer-rust-docs, r=Mark-Simulacrum
Fix macOS and Windows installers when rust-docs is not available. This fixes the macOS `.pkg` and Windows `.msi` installers to work when rust-docs is not available. If the rust-docs component is not built, then the installer would fail. This adds the rust-docs component to the filtering mechanism so that the rust-docs line of the distribution definition aren't included. I tested installing and uninstalling both with and without the rust-docs component available. This happens on the aarch64-apple-darwin distribution provided by rust-lang since we currently disable the rust-docs component due to long build times. An alternate solution would be to just enable the rust-docs component on aarch64-apple-darwin since there are faster build systems. Fixes #109877
This commit is contained in:
commit
749b487be4
@ -1488,7 +1488,7 @@ impl Step for Extended {
|
||||
|
||||
let xform = |p: &Path| {
|
||||
let mut contents = t!(fs::read_to_string(p));
|
||||
for tool in &["rust-demangler", "miri"] {
|
||||
for tool in &["rust-demangler", "miri", "rust-docs"] {
|
||||
if !built_tools.contains(tool) {
|
||||
contents = filter(&contents, tool);
|
||||
}
|
||||
@ -1585,11 +1585,10 @@ impl Step for Extended {
|
||||
prepare("rustc");
|
||||
prepare("cargo");
|
||||
prepare("rust-analysis");
|
||||
prepare("rust-docs");
|
||||
prepare("rust-std");
|
||||
prepare("clippy");
|
||||
prepare("rust-analyzer");
|
||||
for tool in &["rust-demangler", "miri"] {
|
||||
for tool in &["rust-docs", "rust-demangler", "miri"] {
|
||||
if built_tools.contains(tool) {
|
||||
prepare(tool);
|
||||
}
|
||||
@ -1624,23 +1623,25 @@ impl Step for Extended {
|
||||
.arg("-out")
|
||||
.arg(exe.join("RustcGroup.wxs")),
|
||||
);
|
||||
builder.run(
|
||||
Command::new(&heat)
|
||||
.current_dir(&exe)
|
||||
.arg("dir")
|
||||
.arg("rust-docs")
|
||||
.args(&heat_flags)
|
||||
.arg("-cg")
|
||||
.arg("DocsGroup")
|
||||
.arg("-dr")
|
||||
.arg("Docs")
|
||||
.arg("-var")
|
||||
.arg("var.DocsDir")
|
||||
.arg("-out")
|
||||
.arg(exe.join("DocsGroup.wxs"))
|
||||
.arg("-t")
|
||||
.arg(etc.join("msi/squash-components.xsl")),
|
||||
);
|
||||
if built_tools.contains("rust-docs") {
|
||||
builder.run(
|
||||
Command::new(&heat)
|
||||
.current_dir(&exe)
|
||||
.arg("dir")
|
||||
.arg("rust-docs")
|
||||
.args(&heat_flags)
|
||||
.arg("-cg")
|
||||
.arg("DocsGroup")
|
||||
.arg("-dr")
|
||||
.arg("Docs")
|
||||
.arg("-var")
|
||||
.arg("var.DocsDir")
|
||||
.arg("-out")
|
||||
.arg(exe.join("DocsGroup.wxs"))
|
||||
.arg("-t")
|
||||
.arg(etc.join("msi/squash-components.xsl")),
|
||||
);
|
||||
}
|
||||
builder.run(
|
||||
Command::new(&heat)
|
||||
.current_dir(&exe)
|
||||
@ -1787,7 +1788,6 @@ impl Step for Extended {
|
||||
cmd.current_dir(&exe)
|
||||
.arg("-nologo")
|
||||
.arg("-dRustcDir=rustc")
|
||||
.arg("-dDocsDir=rust-docs")
|
||||
.arg("-dCargoDir=cargo")
|
||||
.arg("-dStdDir=rust-std")
|
||||
.arg("-dAnalysisDir=rust-analysis")
|
||||
@ -1799,6 +1799,9 @@ impl Step for Extended {
|
||||
.arg(&input);
|
||||
add_env(builder, &mut cmd, target);
|
||||
|
||||
if built_tools.contains("rust-docs") {
|
||||
cmd.arg("-dDocsDir=rust-docs");
|
||||
}
|
||||
if built_tools.contains("rust-demangler") {
|
||||
cmd.arg("-dRustDemanglerDir=rust-demangler");
|
||||
}
|
||||
@ -1817,7 +1820,9 @@ impl Step for Extended {
|
||||
candle(&etc.join("msi/ui.wxs"));
|
||||
candle(&etc.join("msi/rustwelcomedlg.wxs"));
|
||||
candle("RustcGroup.wxs".as_ref());
|
||||
candle("DocsGroup.wxs".as_ref());
|
||||
if built_tools.contains("rust-docs") {
|
||||
candle("DocsGroup.wxs".as_ref());
|
||||
}
|
||||
candle("CargoGroup.wxs".as_ref());
|
||||
candle("StdGroup.wxs".as_ref());
|
||||
candle("ClippyGroup.wxs".as_ref());
|
||||
@ -1854,7 +1859,6 @@ impl Step for Extended {
|
||||
.arg("ui.wixobj")
|
||||
.arg("rustwelcomedlg.wixobj")
|
||||
.arg("RustcGroup.wixobj")
|
||||
.arg("DocsGroup.wixobj")
|
||||
.arg("CargoGroup.wixobj")
|
||||
.arg("StdGroup.wixobj")
|
||||
.arg("AnalysisGroup.wixobj")
|
||||
@ -1870,6 +1874,9 @@ impl Step for Extended {
|
||||
if built_tools.contains("rust-demangler") {
|
||||
cmd.arg("RustDemanglerGroup.wixobj");
|
||||
}
|
||||
if built_tools.contains("rust-docs") {
|
||||
cmd.arg("DocsGroup.wixobj");
|
||||
}
|
||||
|
||||
if target.ends_with("windows-gnu") {
|
||||
cmd.arg("GccGroup.wixobj");
|
||||
|
@ -167,7 +167,9 @@
|
||||
<?if $(env.CFG_MINGW)="1" ?>
|
||||
<Directory Id="Gcc" Name="." />
|
||||
<?endif?>
|
||||
<!-- tool-rust-docs-start -->
|
||||
<Directory Id="Docs" Name="." />
|
||||
<!-- tool-rust-docs-end -->
|
||||
<Directory Id="Cargo" Name="." />
|
||||
<Directory Id="Std" Name="." />
|
||||
</Directory>
|
||||
@ -209,6 +211,7 @@
|
||||
<RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="RustShell" Type="integer" Value="1" KeyPath="yes" />
|
||||
<RemoveFolder Id="ApplicationProgramsFolder1" On="uninstall" />
|
||||
</Component>
|
||||
<!-- tool-rust-docs-start -->
|
||||
<Component Id="DocIndexShortcut" Guid="*">
|
||||
<Shortcut Id="RustDocs"
|
||||
Name="$(var.ProductName) Documentation"
|
||||
@ -217,6 +220,7 @@
|
||||
<RegistryValue Root="HKMU" Key="$(var.BaseRegKey)" Name="RustDocs" Type="integer" Value="1" KeyPath="yes" />
|
||||
<RemoveFolder Id="ApplicationProgramsFolder2" On="uninstall" />
|
||||
</Component>
|
||||
<!-- tool-rust-docs-end -->
|
||||
</Directory>
|
||||
</Directory>
|
||||
|
||||
@ -256,6 +260,7 @@
|
||||
<ComponentGroupRef Id="GccGroup" />
|
||||
</Feature>
|
||||
<?endif?>
|
||||
<!-- tool-rust-docs-start -->
|
||||
<Feature Id="Docs"
|
||||
Title="HTML documentation"
|
||||
Display="5"
|
||||
@ -264,6 +269,7 @@
|
||||
<ComponentGroupRef Id="DocsGroup" />
|
||||
<ComponentRef Id="DocIndexShortcut" />
|
||||
</Feature>
|
||||
<!-- tool-rust-docs-end -->
|
||||
<Feature Id="Path"
|
||||
Title="Add to PATH"
|
||||
Description="Add Rust to PATH environment variable"
|
||||
|
@ -15,7 +15,9 @@
|
||||
<line choice="rustc"/>
|
||||
<line choice="rust-std"/>
|
||||
<line choice="cargo"/>
|
||||
<!-- tool-rust-docs-start -->
|
||||
<line choice="rust-docs"/>
|
||||
<!-- tool-rust-docs-end -->
|
||||
</line>
|
||||
<line choice="uninstall" />
|
||||
</choices-outline>
|
||||
@ -55,15 +57,19 @@
|
||||
>
|
||||
<pkg-ref id="org.rust-lang.rust-std"/>
|
||||
</choice>
|
||||
<!-- tool-rust-docs-start -->
|
||||
<choice id="rust-docs" visible="true"
|
||||
title="Documentation" description="HTML documentation."
|
||||
selected="(!choices.uninstall.selected && choices['rust-docs'].selected) || (choices.uninstall.selected && choices.install.selected)"
|
||||
>
|
||||
<pkg-ref id="org.rust-lang.rust-docs"/>
|
||||
</choice>
|
||||
<!-- tool-rust-docs-end -->
|
||||
<pkg-ref id="org.rust-lang.rustc" version="0" onConclusion="none">rustc.pkg</pkg-ref>
|
||||
<pkg-ref id="org.rust-lang.cargo" version="0" onConclusion="none">cargo.pkg</pkg-ref>
|
||||
<!-- tool-rust-docs-start -->
|
||||
<pkg-ref id="org.rust-lang.rust-docs" version="0" onConclusion="none">rust-docs.pkg</pkg-ref>
|
||||
<!-- tool-rust-docs-end -->
|
||||
<pkg-ref id="org.rust-lang.rust-std" version="0" onConclusion="none">rust-std.pkg</pkg-ref>
|
||||
<pkg-ref id="org.rust-lang.uninstall" version="0" onConclusion="none">uninstall.pkg</pkg-ref>
|
||||
<background file="rust-logo.png" mime-type="image/png"
|
||||
|
Loading…
Reference in New Issue
Block a user