Re: [PATCH] scripts: generate_rust_analyzer: reduce the output file size

From: Jesung Yang
Date: Fri Jan 02 2026 - 08:12:17 EST


On Fri, Jan 2, 2026 at 7:36 PM Gary Guo <gary@xxxxxxxxxxx> wrote:
>
> On Fri, 2 Jan 2026 10:04:08 +0900
> Jesung Yang <y.j3ms.n@xxxxxxxxx> wrote:
>
> > On Fri, Jan 2, 2026 at 7:09 AM Gary Guo <gary@xxxxxxxxxxx> wrote:
> > >
> > > On Thu, 01 Jan 2026 08:21:24 +0000
> > > Jesung Yang via B4 Relay <devnull+y.j3ms.n.gmail.com@xxxxxxxxxx> wrote:
> > >
> > > > From: Jesung Yang <y.j3ms.n@xxxxxxxxx>
> > > >
> > > > Use the `cfg_groups` field to aggregate common configurations into a
> > > > single project-level definition. This avoids repeating identical `cfg`s
> > > > across crates.
> > > >
> > > > As a result, the size of the generated `rust-project.json` is reduced
> > > > from 11MiB to 406KiB (about 96% reduction).
> > >
> > > This feature is not available with Rust Analyzer 1.78.
> >
> > I suspect you are referring to the rust-analyzer component shipped via
> > rustup when the 1.78 toolchain is active.
> >
> > Do we apply our MSRV policy to rust-analyzer as well? The latest
> > rust-analyzer release supports older Rust versions, including 1.78.
>
> This statement is not generally true. Rust analyzer needs the ability to
> talk directly with proc macro dylibs and AFAIK it only retains limited
> backward compatibility with old rustc versions.
>
> https://rust-analyzer.github.io/book/installation.html also mentions that
> the only officially supported version is the latest stable and users are
> recommended to use older Rust analyzer versions with older compilers.

You're right, I missed that point.

> > practice, I believe many people who rely on a language server use the
> > version provided by their editor extension or IDE, which is usually the
> > most recent release. AFAIK, it is actually more difficult to use an old
> > release of rust-analyzer, as it often requires extra setup to manually
> > downgrade or pin the version.
>
> Many editors just use rust analyzer binaries in the PATH, which can quite
> often be the one provided by rustup. I guess the "IDE" you're talking
> about here is VSCode, and I just configure it to use the one in path too,
> instead of the binary shipped with the extension.
>
> This the Rust analyzer version string of the one that I am using:
>
> rust-analyzer 1.78.0 (9b00956 2024-04-29)
>
> So I'd say while your change is desired, we need to wait until we bump
> MSRV to a high enough version as I suspect there're a lot more developers
> that use Rust analyzer in the same way I do.

Overall, I think I overlooked the diversity of local setups; I was
indeed focused on the VSCode extension's default behavior.

Thanks!

Best regards,
Jesung