How to install `rust-analyzer-proc-macro-srv-cli`?

I'm trying to understand how to properly install rust-analyzer-proc-macro-srv-cli (the final goal is packaging rust-analyzer for the Linux distribution Guix).

So far, I've been able to understand that ./x.py build src/tools/rust-analyzer then ./x.py install rust-analyzer is deploying the rust-analyzer binary in the expected place (with the help of prefix in config.toml).

I've looked for a similar path to provide the rust-analyzer-proc-macro-srv-cli binary and found in "How to build and run" a section mentioning ./x.py build proc-macro-srv-cli. And indeed, after running that command, I'm able to find the rust-analyzer-proc-macro-srv-cli binary built in my build/ folder (and I was not seeing the binary before that). However, I'm not able to find the right incantation to install this binary. I've looked in ./x.py install --help --verbose that show a list of (exhaustive?) options and none of them seems to correspond.

Where did I miss something?

1 Like

The rust-analyzer-proc-macro-srv is part of the rustc component and as such installed together with rustc. You can find it in libexec. I strongly recommend packaging it in the package that contains rustc rather than the package that contains rust-analyzer in case someone wants to use a different rust-analyzer version (for example the one bundled with the vscode extension or downloaded by zed). Each rust-analyzer-proc-macro-srv works only with the respective rustc version, but works with a range of rust-analyzer versions.

4 Likes