-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
(Related to: long-term proc macro support plan)
Before (submodule)
RA is a git submodule in src/tools. When a "sync" happens, rust-lang/rust is updated to point to a different commit (example).
The changes suggested in #12803 (use the sysroot proc_macro crate) make RA/rustc incompatibilities more visible in that the submodule could then stop building.
Fixing that would involve two PRs:
- One to
rust-analyzer, fixingproc-macro-srvto followproc_macrobridge changes - One to
rust, bumpingrust-analyzer
If the sync cycle isn't changed, this means the rust-analyzer RA component could be missing for up to a week, or even more, if the bridge changes haven't been followed in the rust-analyzer repo.
After (subtree)
Just like clippy, rust-analyzer would be a subtree (also in src/tools).
Feature development / bug fixes to RA happen as usual in the rust-lang/rust-analyzer repository. These can be synced to rust-lang/rust whenever convenient (clippy->rust example PR).
Changes to the proc_macro bridge are followed in the rust-lang/rust repository. These can be synced to rust-lang/rust-analyzer whenever convenient (rust->clippy example commit)
proc-macro-srv never breaks again (in the rustup component version of rust-analyzer), because it's immediately fixed as part of any PRs to rust-lang/rust.
Why does this matter?
A PR was just merged to "add support for the 1.64 ABI", but there's no such thing as "the 1.64 ABI", and it's going to be instabroken, see #12806.
Prior art
Similar discussion for rustfmt: rust-lang/rust#82385 (converted to a subtree in May 2021)
Tagging:
- @mystor who's been making proc_macro bridge changes, to confirm that
rust-lang/rustfolks are happy to keep theproc-macro-srvcrate up-to-date with bridge changes (pinging other maintainers as needed) - @jonas-schievink who's been keeping the "multi ABI support" approach up-to-date by manually vendoring+tuning several copies of the
proc_macrobridge in the rust-analyzer repo - @lnicola who's been doing most of the syncs I've seen in
rust-lang/rusthistory - @jyn514 who discussed using subtrees on Zulip
- @flodiebold, @Veykril, @bjorn3 who interacted with Resolving proc-macro ABI breakage for rustc nightly users: one way forward #12803
- @oli-obk who offered to connect with clippy folks in case RA folks have any questions about git subtree
- @cuviper who started work on getting RA tests to run on rust CI