Skip to content

proc macro not expanded: failed to write request: Broken pipe (os error 32) #14289

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

Closed
rohel01 opened this issue Mar 8, 2023 · 2 comments
Closed
Labels
C-support Category: support questions

Comments

@rohel01
Copy link

rohel01 commented Mar 8, 2023

Hello,

This is similar to #12673, so I will provide similar information.

The diagnostic in VSCode

image

This is the Component proc-macro from bevy 0.10 BTW

In the VSCode "Rust Analyzer Language Server" output tab, I get the following message:

[ERROR rust_analyzer] Unexpected error: expected initialize request, got error: receiving on an empty and disconnected channel
expected initialize request, got error: receiving on an empty and disconnected channel

Infos from the terminal

$ rustup toolchain list
stable-x86_64-unknown-linux-gnu (default)
nightly-2023-03-07-x86_64-unknown-linux-gnu (override)
nightly-x86_64-unknown-linux-gnu

$ rustup --version
rustup 1.25.2 (17db695f1 2023-02-01)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.70.0-nightly (f63ccaf25 2023-03-06)`

$ rustc --version
rustc 1.70.0-nightly (f63ccaf25 2023-03-06)

$ /home/melchiore/.rustup/toolchains/nightly-2023-03-07-x86_64-unknown-linux-gnu/bin/rust-analyzer --version
rust-analyzer 1.70.0-nightly (f63ccaf 2023-03-06)

I am using vscode with an overriden rust-analyzer (as I tried to fix this issue).
Here is my .vscode/settings.json

{
    "rust-analyzer.procMacro.server": "/home/melchiore/.rustup/toolchains/nightly-2023-03-07-x86_64-unknown-linux-gnu/bin/rust-analyzer"
}
@lnicola
Copy link
Member

lnicola commented Mar 8, 2023

"rust-analyzer.procMacro.server": "/home/melchiore/.rustup/toolchains/nightly-2023-03-07-x86_64-unknown-linux-gnu/bin/rust-analyzer"

That's not the right path to the proc macro server, but rather /home/melchiore/.rustup/toolchains/nightly-2023-03-07-x86_64-unknown-linux-gnu/libexec/rust-analyzer-proc-macro-srv. But I don't recommend setting it, because we pick it up by default anyway.

The LSP server path is rust-analyzer.server.path, but then again, you shouldn't change it.

@lnicola lnicola added the C-support Category: support questions label Mar 13, 2023
@rohel01
Copy link
Author

rohel01 commented Mar 15, 2023

Hello,

Thanks for your answer. I tried to change these settings since I was getting a "Wrong ABI" error in VScode on proc macro expansion. Resetting everything to default value has fixed everything.

@rohel01 rohel01 closed this as completed Mar 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-support Category: support questions
Projects
None yet
Development

No branches or pull requests

2 participants