rust-analyzer: Linker error on proc macros that depend on `defmt`
First of all, thank you for the immense work you’ve been doing.
Issue description
Apologies, I haven’t been able to make a minimal reproduction of the issue I’m running into while working on proc-macros in zenoh’s keformatter branch. I’ll try to provide as much information as possible.
Behaviour
Since working on new proc-macros last week, rust-analyzer keeps on showing a failed to run build scripts error, stating in server logs that it “could not compile zenoh-macros” (belongs to the workspace, commons/zenoh-macros).
In VSCode, this causes every usage of zenoh-macros’s members to be marked with “proc macro unstable not expanded: no proc macro dylib present” (unstable for instance expands correctly on master).
In Lapce, the error notification appears, but macros appear to be expanded correctly regardless, since type inference and documentation in the examples/examples/z_formats.rs file works.
Note that when building the project, zenoh-macros builds fine, so this issue seems to be RA-specific.
Suspected cause
It appears that rust-analyzer drives the build slightly differently, leading to invalid linkage description files, since linkers on both Windows and Linux complain about syntax errors in lib.def and list (passed through --version-script) respectively.
Server logs on Windows Server logs on Linux
The directories that contain the incriminated files are deleted by the time I get their path in the logs, so I haven’t been able to inspect the files to try and find out more.
Impacted platforms
Linux (Manjaro)
rust-analyzer version: 0.3.1412-standalone rustc version: rustc 1.67.1 (d5a82bbd2 2023-02-07) relevant settings: None to my knowledge
Windows
rust-analyzer version: 0.3.1410-standalone (a6603fc21 2023-02-16) rustc version: rustc 1.67.1 (d5a82bbd2 2023-02-07) relevant settings: None to my knowledge
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 1
- Comments: 19 (9 by maintainers)
Again, thank you very much, you’ve been very helpful and very quick. Feel free to close this issue, unless you want to keep track of that
defmtthing.I am satisfied with my care 😃
Ahah, removing ALL of my rust related settings did work, now to find the true culprit. Thanks for letting me know that it could work, I have Settings Sync enabled so whatever setting is messing it up, it was synced between my machines.