I'm trying to develop using embassy on a Fedora 37, unfortunately I constantly get the following error on every proc macro in the code:
proc macro `task` not expanded: no proc macro dylib present
I suspect I am missing some library in my system, but unfortunately the error is not helpful enough for me to solve the issue myself. Is there some way that I can get more information on what dylib is missing and how I can solve it?
Which rustc and rust-analyzer versions are you using? And are you using a rustup version of rustc or the one included in Fedora? Does $(rustc --print sysroot)/libexec/rust-analyzer-proc-macro-srv or $(rustc --print sysroot)/lib/rust-analyzer-proc-macro-srv exist and if so which one exists?
(rustc --print sysroot)/libexec/rust-analyzer-proc-macro-srv exists, the other one does not.
I had a strong suspicion that rust-analyzer doesn't like what Fedora Kionite/Silverblue 37 is doing with the home directory - the /home directory is a symlink to /var/home. To verify if that may be a problem I performed the following tests:
Prepared the same setup on a normal Fedora 37 and it seems to work there.
Prepared the same setup in a different (not-symlinked) directory (/tmp to be precise). Seems to work as well.
Did a cd /var/home/.../embassy/example && code ./std (so used the real path, not the symlinked one) and it seems to resolve the proc-macros too.
There's clearly some bug somewhere, either in how Fedora Kionite/Silverblue 37 handles the symlink or setup of some environmental variables, or how rust-analyzer handles cases where the parent directory has a symlink.
Bjorn, do you have any idea how can I help debug this issue so it can be fixed in the right place?
There is issue for rust-analyzer misbehaving with symlinked paths: Spurious rebuilds when VSCode opened through symlink · Issue #13593 · rust-lang/rust-analyzer · GitHub This is an issue about cargo rebuilding things unnecessarily though and not about proc macros not working. Would you mind opening an issue? As for debugging, could you set the RA_LOG env var to warn;project_model=info before starting VSCode and then show what the "Rust Analyzer Language Server" output tab shows for the broken configuration?