Index | Thread | Search

From:
Sebastien Marie <semarie@kapouay.eu.org>
Subject:
Re: rust-analyzer: proc-macro support broken
To:
Edd Barrett <edd@theunixzoo.co.uk>, ports@openbsd.org
Date:
Mon, 22 Jan 2024 13:49:16 +0100

Download raw body.

Thread
Edd Barrett <edd@theunixzoo.co.uk> writes:

>
> This does not occur when using the LSP with a rustup-installed toolchain on
> Linux.
>
> I don't recall seeing this error when I was building RA from source (the magic
> command I used to use to build/install was `cargo xtask install --server`).
>
> I notice that in the source code there is a crate called `proc-macro-srv` and
> on my linux box there is a binary `rust-analyzer-proc-macro-srv`. Perhaps this
> is missing?
>

the `rust-analyzer-proc-macro-srv` binary is built with
`crates/proc-macro-srv-cli`.

> I've not had time to look deeper, but wanted to report it here in case someone
> already knows the fix.

I have the following diff for build and installing it:

diff /data/semarie/repos/openbsd/ports
commit - 6e2565794a185e8cfd1a5e1e3f80bc1884d1b0cd
path + /data/semarie/repos/openbsd/ports
blob - a56a1e753ce83d0c6527997479470230c8d4b3b4
file + devel/rust-analyzer/Makefile
--- devel/rust-analyzer/Makefile
+++ devel/rust-analyzer/Makefile
@@ -5,6 +5,8 @@ GH_ACCOUNT =	rust-lang
 GH_PROJECT =	rust-analyzer
 GH_TAGNAME =	2023-12-18
 
+REVISION =	0
+
 DISTNAME =	${GH_PROJECT}-${GH_TAGNAME:S/-//g}
 
 HOMEPAGE =	https://rust-analyzer.github.io/
@@ -22,7 +24,9 @@ WANTLIB += ${MODCARGO_WANTLIB} m
 
 MODULES =	devel/cargo
 
-MODCARGO_INSTALL_TARGET_PATHS =	crates/rust-analyzer
+MODCARGO_INSTALL_TARGET_PATHS =	\
+		crates/rust-analyzer \
+		crates/proc-macro-srv-cli
 
 SEPARATE_BUILD =	Yes
 
blob - d4e086558c5f76385160a7c7e168c38ef6ddc975
file + devel/rust-analyzer/pkg/PLIST
--- devel/rust-analyzer/pkg/PLIST
+++ devel/rust-analyzer/pkg/PLIST
@@ -1,4 +1,5 @@
 @bin bin/rust-analyzer
+@bin bin/rust-analyzer-proc-macro-srv
 share/doc/rust-analyzer/
 share/doc/rust-analyzer/manual.adoc
 share/doc/rust-analyzer/manual.html



The drawback is the build target isn't enough to build all the parts,
and it is during the fake target that some parts (for
proc-macro-srv-cli) are build.

It would be interesting to know if it is enough for the user who
contacted you.

Thanks.
-- 
Sebastien Marie