diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2024-10-20 16:54:09 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-20 16:54:09 +0200 |
| commit | 17ac4c8fb5a0a49145886749ea8ed38ffeb340bf (patch) | |
| tree | 78169d6e90823b249e300834329eab625890ec3d /src | |
| parent | 7b714d4735c50a5148f30261a3e5e8e00807d8a8 (diff) | |
| parent | 2316749ca954030afed6145342808a8c1ae29fac (diff) | |
| download | rust-17ac4c8fb5a0a49145886749ea8ed38ffeb340bf.tar.gz rust-17ac4c8fb5a0a49145886749ea8ed38ffeb340bf.zip | |
Rollup merge of #131365 - heiseish:fix-issue-101993, r=Mark-Simulacrum
Fix missing rustfmt in msi installer #101993 # Context - Fixed missing `rustfmt`, `clippy`, `miri` and `rust-analyzer` in msi installer - Fixed missing `rustfmt` for apple darwin installer - Closes #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
Diffstat (limited to 'src')
| -rw-r--r-- | src/bootstrap/src/core/build_steps/dist.rs | 43 | ||||
| -rw-r--r-- | src/etc/installer/msi/rust.wxs | 41 |
2 files changed, 79 insertions, 5 deletions
diff --git a/src/bootstrap/src/core/build_steps/dist.rs b/src/bootstrap/src/core/build_steps/dist.rs index 90e6a10d9d6..80ba9f44448 100644 --- a/src/bootstrap/src/core/build_steps/dist.rs +++ b/src/bootstrap/src/core/build_steps/dist.rs @@ -1591,9 +1591,15 @@ impl Step for Extended { prepare("cargo"); prepare("rust-std"); prepare("rust-analysis"); - prepare("clippy"); - prepare("rust-analyzer"); - for tool in &["rust-docs", "miri", "rustc-codegen-cranelift"] { + + for tool in &[ + "clippy", + "rustfmt", + "rust-analyzer", + "rust-docs", + "miri", + "rustc-codegen-cranelift", + ] { if built_tools.contains(tool) { prepare(tool); } @@ -1633,6 +1639,8 @@ impl Step for Extended { "rust-analyzer-preview".to_string() } else if name == "clippy" { "clippy-preview".to_string() + } else if name == "rustfmt" { + "rustfmt-preview".to_string() } else if name == "miri" { "miri-preview".to_string() } else if name == "rustc-codegen-cranelift" { @@ -1652,7 +1660,7 @@ impl Step for Extended { prepare("cargo"); prepare("rust-analysis"); prepare("rust-std"); - for tool in &["clippy", "rust-analyzer", "rust-docs", "miri"] { + for tool in &["clippy", "rustfmt", "rust-analyzer", "rust-docs", "miri"] { if built_tools.contains(tool) { prepare(tool); } @@ -1770,6 +1778,24 @@ impl Step for Extended { .arg(etc.join("msi/remove-duplicates.xsl")) .run(builder); } + if built_tools.contains("rustfmt") { + command(&heat) + .current_dir(&exe) + .arg("dir") + .arg("rustfmt") + .args(heat_flags) + .arg("-cg") + .arg("RustFmtGroup") + .arg("-dr") + .arg("RustFmt") + .arg("-var") + .arg("var.RustFmtDir") + .arg("-out") + .arg(exe.join("RustFmtGroup.wxs")) + .arg("-t") + .arg(etc.join("msi/remove-duplicates.xsl")) + .run(builder); + } if built_tools.contains("miri") { command(&heat) .current_dir(&exe) @@ -1841,6 +1867,9 @@ impl Step for Extended { if built_tools.contains("clippy") { cmd.arg("-dClippyDir=clippy"); } + if built_tools.contains("rustfmt") { + cmd.arg("-dRustFmtDir=rustfmt"); + } if built_tools.contains("rust-docs") { cmd.arg("-dDocsDir=rust-docs"); } @@ -1867,6 +1896,9 @@ impl Step for Extended { if built_tools.contains("clippy") { candle("ClippyGroup.wxs".as_ref()); } + if built_tools.contains("rustfmt") { + candle("RustFmtGroup.wxs".as_ref()); + } if built_tools.contains("miri") { candle("MiriGroup.wxs".as_ref()); } @@ -1905,6 +1937,9 @@ impl Step for Extended { if built_tools.contains("clippy") { cmd.arg("ClippyGroup.wixobj"); } + if built_tools.contains("rustfmt") { + cmd.arg("RustFmtGroup.wixobj"); + } if built_tools.contains("miri") { cmd.arg("MiriGroup.wixobj"); } diff --git a/src/etc/installer/msi/rust.wxs b/src/etc/installer/msi/rust.wxs index f29e1e4d27a..2d155bf0b10 100644 --- a/src/etc/installer/msi/rust.wxs +++ b/src/etc/installer/msi/rust.wxs @@ -172,6 +172,11 @@ <!-- tool-rust-docs-end --> <Directory Id="Cargo" Name="." /> <Directory Id="Std" Name="." /> + <Directory Id="RustFmt" Name="." /> + <Directory Id="RustAnalyzer" Name="." /> + <Directory Id="Miri" Name="." /> + <Directory Id="Analysis" Name="." /> + <Directory Id="Clippy" Name="." /> </Directory> </Directory> @@ -279,7 +284,41 @@ <ComponentRef Id="PathEnvPerMachine" /> <ComponentRef Id="PathEnvPerUser" /> </Feature> - + <Feature Id="RustFmt" + Title="Formatter for rust" + Display="7" + Level="1" + AllowAdvertise="no"> + <ComponentGroupRef Id="RustFmtGroup" /> + </Feature> + <Feature Id="Clippy" + Title="Formatter and checker for rust" + Display="8" + Level="1" + AllowAdvertise="no"> + <ComponentGroupRef Id="ClippyGroup" /> + </Feature> + <Feature Id="Miri" + Title="Soundness checker for rust" + Display="9" + Level="1" + AllowAdvertise="no"> + <ComponentGroupRef Id="MiriGroup" /> + </Feature> + <Feature Id="RustAnalyzer" + Title="Analyzer for rust" + Display="10" + Level="1" + AllowAdvertise="no"> + <ComponentGroupRef Id="RustAnalyzerGroup" /> + </Feature> + <Feature Id="Analysis" + Title="Analysis for rust" + Display="11" + Level="1" + AllowAdvertise="no"> + <ComponentGroupRef Id="AnalysisGroup" /> + </Feature> <UIRef Id="RustUI" /> </Product> </Wix> |
