-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proc macro server crashed #12600
Comments
Confirmed, looks like another ABI change. As a workaround you can downgrade to a nightly from around 2022-06-08. |
This broke between 2022-06-18 and 2022-06-19. |
There are probably going to be a couple of other abi breakages in the near future. There are several PR's affecting libproc_macro open at the moment. |
This workaround seems to work for me with VSCode:
|
@dacut That's a different problem, caused by using an x86 VSCode and an ARM Rust toolchain. In that case, yours is indeed a possible workaround. (The other option would be to just install an aarch64 VSCode build.) This is unrelated to the problem in this issue though. |
@flodiebold Where did you get the idea that I'm running x86 VSCode? I'm running ARM VSCode (from the Universal binary), ARM rust-analyzer, etc.: % file /Applications/Visual\ Studio\ Code.app/Contents/MacOS/Electron
/Applications/Visual Studio Code.app/Contents/MacOS/Electron: Mach-O universal binary with 2 architectures: [x86_64:Mach-O 64-bit executable x86_64
- Mach-O 64-bit executable x86_64] [arm64:Mach-O 64-bit executable arm64
- Mach-O 64-bit executable arm64]
/Applications/Visual Studio Code.app/Contents/MacOS/Electron (for architecture x86_64): Mach-O 64-bit executable x86_64
/Applications/Visual Studio Code.app/Contents/MacOS/Electron (for architecture arm64): Mach-O 64-bit executable arm64
% file ~/.vscode/extensions/rust-lang.rust-analyzer-0.4.1101-darwin-arm64/server/rust-analyzer
/Users/dacut/.vscode/extensions/rust-lang.rust-analyzer-0.4.1101-darwin-arm64/server/rust-analyzer: Mach-O 64-bit executable arm64 Same issue as here, with the |
@dacut It was a guess for the actual problem you're having, because the issue described here cannot be fixed by running another version of rust-analyzer. What's your rustc version, and what does the "Show RA Version" VSCode command say if you don't set |
Hmm... it was suggested that ABI mismatches were at fault here from this Twitter reply by Lukas Wirth, hence my attempt to keep Without
Interestingly, the version installed by
|
Ah yeah, the older version in rustup is likely just not showing the error message. |
Hello! I've been slowly downgrading using VS marketplace so I can tell this broke in release |
@Galster-dev downgrading just hides the issue, it doesn't fix it. To hide it you could also just disable the diagnostic. |
For those (like me) who might be curious as what to the proc macro PRs in flight might be that this issue depends upon (from #12600 (comment)), this is the list of PRs with "proc" in their title; what I found that seem to be relevant (recent):
That said, I'm about as far from an expert as one could be on proc_macro issues; this list is almost certainly inaccurate, but might provide some insight as to what's going on behind the scenes. |
…chievink fix: Update 1.61 proc macro ABI to match rustc This updates us to the ABI used by rustc 1.63.0-beta.5, which will likely be the ABI of the next stable Rust release. It should also work on nightly (for now, but future changes won't be supported until the rustc version is bumped). cc #12600
…chievink fix: Update 1.63 proc macro ABI to match rustc This updates us to the ABI used by rustc 1.63.0-beta.5, which will likely be the ABI of the next stable Rust release. It should also work on nightly (for now, but future changes won't be supported until the rustc version is bumped). cc #12600
#12747 should fix this issue, at least on beta and the current nightly. Please let us know if it still doesn't work. |
Doesn't seem to work, I am getting the same assert as OP. |
I am pretty sure that rust-analyzer version doesn't yet include the fix. |
well 4cbf23c is exactly the commit id of the fix. |
Nightly indeed still seems to be broken, but beta is fixed. I think nightly already had some additional changes since beta branched (namely rust-lang/rust#98188). |
Confirm fixed in the nightly build, but go-to-definition doesn't work for the idents inside the function-like proc macro. Maybe the ident span is get discarded. |
I tried using @dacut's method to fix my issue, which did not work since I could not locate the Running arm64 vscode on an m1 but r-a seems convinced im running on an x86 system. The error:
Rust version: rustc 1.60.0 (7737e0b5c 2022-04-04) |
@RohanKapurDEV make sure you're using the arm64 Rust toolchain if you're using arm64 VSCode ( |
@flodiebold running that command yields the following error:
Checking the provided link does lead me to a possible valid target: |
Yes |
Switched my toolchain to beta and it worked. |
I'm using rust toolchain The error message in question:
|
The latest known-good pair is today's nightly of both rustc and rust-analyzer. And from now on, rust nightlies contain a rust-analyzer proc-macro server that is guaranteed to use the same proc-macro bridge version as rustc, which the rust-analyzer extension will check for and use (as of today), so expect no more breakage of this kind :) You can read about all the details on fasterthanlime's blog. |
Awesome news and of course also an awesome and informative blog post. Thanks for the answer+update & thanks to everyone who contributed for your work on this. |
I have had the same issue, my code can be found at https://github.com/SturdyFool10/RustResourceMonitor.git, setup goes commit, cargo build, cargo run, it seems to only effect rust analyzer tho? it compiles and runs but that's still weird behavior, specifically my derive macro invocations on Serde::Serialize |
I don't think this is a duplicate of the other macro issues, I haven't seen this error message in them:
Similarly to the other issues, the entire macro site is marked as an error with
failed to write request: Broken pipe (os error 32)
.Happens with at least all serde derives, tracing
#[instrument]
,#[async_trait]
and tonic'sinclude_proto!
.rust-analyzer version: 0.0.0 (427061d 2022-06-19)
rustc version: rustc 1.63.0-nightly (bb8c2f411 2022-06-19) on Arch Linux
relevant settings: rust-analyzer.procMacro.attributes.enable is true, no macros have been ignored.
The text was updated successfully, but these errors were encountered: