bootstrap: revert cross-build breaking change
authorFabian Grünbichler <f.gruenbichler@proxmox.com>
Tue, 21 Jan 2025 09:43:33 +0000 (10:43 +0100)
committerFabian Grünbichler <debian@fabian.gruenbichler.email>
Tue, 21 Jan 2025 10:38:15 +0000 (11:38 +0100)
this reverts 68034f837a39387e49fc7d7c5b088f5372a1127e modulo file split that
happened afterwards.

Forwarded: https://github.com/rust-lang/rust/issues/133629

Signed-off-by: Fabian Grünbichler <f.gruenbichler@proxmox.com>
Gbp-Pq: Topic bootstrap
Gbp-Pq: Name bootstrap-revert-cross-build-breaking-change.patch

src/bootstrap/src/core/builder/cargo.rs

index 0e53660349a1dce40a7c0f357f64bda58bca019e..e76bcb24667a4d1669a56a8369d9ddc14ad0aeef 100644 (file)
@@ -655,24 +655,10 @@ impl Builder<'_> {
         match mode {
             Mode::Std | Mode::ToolBootstrap | Mode::ToolStd => {}
             Mode::Rustc | Mode::Codegen | Mode::ToolRustc => {
-                // Build proc macros both for the host and the target unless proc-macros are not
-                // supported by the target.
+                // Build proc macros both for the host and the target
                 if target != compiler.host && cmd_kind != Kind::Check {
-                    let error = command(self.rustc(compiler))
-                        .arg("--target")
-                        .arg(target.rustc_target_arg())
-                        .arg("--print=file-names")
-                        .arg("--crate-type=proc-macro")
-                        .arg("-")
-                        .run_capture(self)
-                        .stderr();
-                    let not_supported = error
-                        .lines()
-                        .any(|line| line.contains("unsupported crate type `proc-macro`"));
-                    if !not_supported {
-                        cargo.arg("-Zdual-proc-macros");
-                        rustflags.arg("-Zdual-proc-macros");
-                    }
+                    cargo.arg("-Zdual-proc-macros");
+                    rustflags.arg("-Zdual-proc-macros");
                 }
             }
         }