Do not get proc_macro from the sysroot in rustc

With the stage0 refactor the proc_macro version found in the sysroot
will no longer always match the proc_macro version that proc-macros get
compiled with by the rustc executable that uses this proc_macro. This
will cause problems as soon as the ABI of the bridge gets changed to
implement new features or change the way existing features work.

To fix this, this commit changes rustc crates to depend directly on the
local version of proc_macro which will also be used in the sysroot that
rustc will build.
This commit is contained in:
bjorn3 2025-05-27 10:30:47 +00:00
parent b5eb9893f4
commit 026baa1c6f
15 changed files with 60 additions and 20 deletions

View file

@ -0,0 +1,21 @@
# We need to use a separate crate including library/proc_macro as opposed to a
# direct path dependency on library/proc_macro because doing the latter will
# cause two copies of libproc_macro.rlib to end up in the sysroot, breaking
# proc-macro crates. In addition it confuses the workspace_members function of
# bootstrap.
[package]
name = "rustc_proc_macro"
version = "0.0.0"
edition = "2024"
[lib]
path = "../../library/proc_macro/src/lib.rs"
test = false
doctest = false
[dependencies]
rustc-literal-escaper = "0.0.2"
[features]
rustc-dep-of-std = []