From f4729f2c55c689e66b354b1e9b7f37710fff1562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mateusz=20Miku=C5=82a?= Date: Tue, 2 Dec 2025 19:15:38 +0100 Subject: [PATCH] build-manifest: generate MSI and MINGW arrays from rustc --- src/tools/build-manifest/build.rs | 18 +++++++++++++++++- src/tools/build-manifest/src/main.rs | 10 ---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/tools/build-manifest/build.rs b/src/tools/build-manifest/build.rs index c804921408a93..3ecfd30b8260d 100644 --- a/src/tools/build-manifest/build.rs +++ b/src/tools/build-manifest/build.rs @@ -60,7 +60,7 @@ fn main() { let mut output = String::new(); writeln!(output, "static HOSTS: &[&str] = &[").unwrap(); - for host in targets.hosts { + for host in &targets.hosts { writeln!(output, " {:?},", host).unwrap(); } writeln!(output, "];").unwrap(); @@ -71,6 +71,22 @@ fn main() { } writeln!(output, "];").unwrap(); + writeln!(output, "static MSI_INSTALLERS: &[&str] = &[").unwrap(); + for host in &targets.hosts { + if host.contains("-windows-") { + writeln!(output, " {:?},", host).unwrap(); + } + } + writeln!(output, "];").unwrap(); + + writeln!(output, "static MINGW: &[&str] = &[").unwrap(); + for host in targets.hosts { + if host.contains("-windows-gnu") { + writeln!(output, " {:?},", host).unwrap(); + } + } + writeln!(output, "];").unwrap(); + std::fs::write(PathBuf::from(std::env::var_os("OUT_DIR").unwrap()).join("targets.rs"), output) .unwrap(); } diff --git a/src/tools/build-manifest/src/main.rs b/src/tools/build-manifest/src/main.rs index d646d9102ba3e..42db12e5e1173 100644 --- a/src/tools/build-manifest/src/main.rs +++ b/src/tools/build-manifest/src/main.rs @@ -29,18 +29,8 @@ static DOCS_FALLBACK: &[(&str, &str)] = &[ ("", "x86_64-unknown-linux-gnu"), ]; -static MSI_INSTALLERS: &[&str] = &[ - "aarch64-pc-windows-msvc", - "i686-pc-windows-gnu", - "i686-pc-windows-msvc", - "x86_64-pc-windows-gnu", - "x86_64-pc-windows-msvc", -]; - static PKG_INSTALLERS: &[&str] = &["x86_64-apple-darwin", "aarch64-apple-darwin"]; -static MINGW: &[&str] = &["i686-pc-windows-gnu", "x86_64-pc-windows-gnu"]; - static NIGHTLY_ONLY_COMPONENTS: &[PkgType] = &[PkgType::Miri, PkgType::JsonDocs, PkgType::RustcCodegenCranelift];