Skip to content

Move rust-analyzer from a git submodule to a git subtree #12815

@fasterthanlime

Description

@fasterthanlime

(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, fixing proc-macro-srv to follow proc_macro bridge changes
  • One to rust, bumping rust-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:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions