Skip to content

Commit 8c88f02

Browse files
authored
Rollup merge of #149554 - mati865:build-manifest-more-gen, r=Mark-Simulacrum
build-manifest: generate MSI and MINGW arrays from rustc An alternative to #149503 The arrays after generating: ``` ❯ bat -n build/x86_64-unknown-linux-gnu/stage2-tools/x86_64-unknown-linux-gnu/release/build/build-manifest-e0236666c7c4187b/out/targets.rs | rg MSI -A14 136 static MSI_INSTALLERS: &[&str] = &[ 137 "aarch64-pc-windows-gnullvm", 138 "aarch64-pc-windows-msvc", 139 "i686-pc-windows-gnu", 140 "i686-pc-windows-msvc", 141 "x86_64-pc-windows-gnu", 142 "x86_64-pc-windows-gnullvm", 143 "x86_64-pc-windows-msvc", 144 ]; 145 static MINGW: &[&str] = &[ 146 "aarch64-pc-windows-gnullvm", 147 "i686-pc-windows-gnu", 148 "x86_64-pc-windows-gnu", 149 "x86_64-pc-windows-gnullvm", 150 ]; ``` r? `@Mark-Simulacrum`
2 parents 7fb6933 + f4729f2 commit 8c88f02

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

src/tools/build-manifest/build.rs

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ fn main() {
6060
let mut output = String::new();
6161

6262
writeln!(output, "static HOSTS: &[&str] = &[").unwrap();
63-
for host in targets.hosts {
63+
for host in &targets.hosts {
6464
writeln!(output, " {:?},", host).unwrap();
6565
}
6666
writeln!(output, "];").unwrap();
@@ -71,6 +71,22 @@ fn main() {
7171
}
7272
writeln!(output, "];").unwrap();
7373

74+
writeln!(output, "static MSI_INSTALLERS: &[&str] = &[").unwrap();
75+
for host in &targets.hosts {
76+
if host.contains("-windows-") {
77+
writeln!(output, " {:?},", host).unwrap();
78+
}
79+
}
80+
writeln!(output, "];").unwrap();
81+
82+
writeln!(output, "static MINGW: &[&str] = &[").unwrap();
83+
for host in targets.hosts {
84+
if host.contains("-windows-gnu") {
85+
writeln!(output, " {:?},", host).unwrap();
86+
}
87+
}
88+
writeln!(output, "];").unwrap();
89+
7490
std::fs::write(PathBuf::from(std::env::var_os("OUT_DIR").unwrap()).join("targets.rs"), output)
7591
.unwrap();
7692
}

src/tools/build-manifest/src/main.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,18 +29,8 @@ static DOCS_FALLBACK: &[(&str, &str)] = &[
2929
("", "x86_64-unknown-linux-gnu"),
3030
];
3131

32-
static MSI_INSTALLERS: &[&str] = &[
33-
"aarch64-pc-windows-msvc",
34-
"i686-pc-windows-gnu",
35-
"i686-pc-windows-msvc",
36-
"x86_64-pc-windows-gnu",
37-
"x86_64-pc-windows-msvc",
38-
];
39-
4032
static PKG_INSTALLERS: &[&str] = &["x86_64-apple-darwin", "aarch64-apple-darwin"];
4133

42-
static MINGW: &[&str] = &["i686-pc-windows-gnu", "x86_64-pc-windows-gnu"];
43-
4434
static NIGHTLY_ONLY_COMPONENTS: &[PkgType] =
4535
&[PkgType::Miri, PkgType::JsonDocs, PkgType::RustcCodegenCranelift];
4636

0 commit comments

Comments
 (0)