Skip to content

Instantly share code, notes, and snippets.

@arthurzam
Created January 24, 2025 11:51
Show Gist options
  • Save arthurzam/4096f791c15f9eca8dbbb82bec0d0e66 to your computer and use it in GitHub Desktop.
Save arthurzam/4096f791c15f9eca8dbbb82bec0d0e66 to your computer and use it in GitHub Desktop.
rust-cross-revert-breaker
From df4502d5bdea996d0fbdd68fa40560a891211ce3 Mon Sep 17 00:00:00 2001
From: Arthur Zamarin <arthurzam@gentoo.org>
Date: Fri, 24 Jan 2025 09:07:52 +0200
Subject: [PATCH] Revert: Disable -Zdual-proc-macros if the target doesn't
support proc-macros
Reverts: 68034f837a39387e49fc7d7c5b088f5372a1127e
---
src/bootstrap/src/core/builder.rs | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/bootstrap/src/core/builder.rs b/src/bootstrap/src/core/builder.rs
index 9ac0b0a01f7..0ac9697ba29 100644
--- a/src/bootstrap/src/core/builder.rs
+++ b/src/bootstrap/src/core/builder.rs
@@ -1698,24 +1698,10 @@ fn cargo(
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");
}
}
}
--
2.48.1
From 5283fa7c3347f06972e3e38f3d739cc4d727d228 Mon Sep 17 00:00:00 2001
From: Arthur Zamarin <arthurzam@gentoo.org>
Date: Fri, 24 Jan 2025 13:48:27 +0200
Subject: [PATCH] revert: Disable -Zdual-proc-macros if the target doesn't
support proc-macros
---
src/bootstrap/src/core/builder/cargo.rs | 20 +++-----------------
1 file changed, 3 insertions(+), 17 deletions(-)
diff --git a/src/bootstrap/src/core/builder/cargo.rs b/src/bootstrap/src/core/builder/cargo.rs
index 0688a1d6892..8ec9747af5c 100644
--- a/src/bootstrap/src/core/builder/cargo.rs
+++ b/src/bootstrap/src/core/builder/cargo.rs
@@ -643,24 +643,10 @@ fn cargo(
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");
}
}
}
--
2.48.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment