Skip to content
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

Client examples panic: error: Unknown binary 'rust-analyzer.exe' in official toolchain 'nightly-x86_64-pc-windows-msvc' #13

Closed
Boscop opened this issue Sep 19, 2024 · 4 comments
Labels
question Further information is requested

Comments

@Boscop
Copy link

Boscop commented Sep 19, 2024

Thanks for making this crate, it seems better than tower-lsp for writing clients.
I just tried to run the examples on Win11 but they panic for me:

cargo r --example client_builder --features="omni-trait tracing tokio"
Finished dev profile [unoptimized + debuginfo] target(s) in 0.13s
Running target\debug\examples\client_builder.exe
error: Unknown binary 'rust-analyzer.exe' in official toolchain 'nightly-x86_64-pc-windows-msvc'.
thread 'main' panicked at examples\client_builder.rs:89:52:
called Result::unwrap() on an Err value: Eof


cargo r --example client_trait --features="omni-trait tracing tokio"

Compiling async-lsp v0.2.0 (D:\dev\3rdparty\async-lsp)
Finished dev profile [unoptimized + debuginfo] target(s) in 1.79s
Running target\debug\examples\client_trait.exe
error: Unknown binary 'rust-analyzer.exe' in official toolchain 'nightly-x86_64-pc-windows-msvc'.
thread 'main' panicked at examples\client_trait.rs:106:52:
called Result::unwrap() on an Err value: Eof


Any idea why? 🙂

Btw, rust-analyzer is working fine inside VS Code.

@Boscop
Copy link
Author

Boscop commented Sep 19, 2024

Btw, the inspector example also fails with error: Unknown binary 'rust-analyzer.exe' in official toolchain 'nightly-x86_64-pc-windows-msvc'. but panics on another line:

cargo r --example inspector --features="forward tracing tokio" -- rust-analyzer.exe
Finished dev profile [unoptimized + debuginfo] target(s) in 0.12s
Running target\debug\examples\inspector.exe rust-analyzer.exe
error: Unknown binary 'rust-analyzer.exe' in official toolchain 'nightly-x86_64-pc-windows-msvc'.
thread 'main' panicked at D:\dev\3rdparty\async-lsp\src\lib.rs:553:69:
Sender is alive

@oxalica oxalica added the question Further information is requested label Sep 20, 2024
@oxalica
Copy link
Owner

oxalica commented Sep 20, 2024

error: Unknown binary 'rust-analyzer.exe' in official toolchain 'nightly-x86_64-pc-windows-msvc'

This error message seems to come from rustup. I believe it's because rust-lang/rustup#3846 . So you don't have rust-analyzer component installed for the default rustup toolchain, and rustup installed a fake rust-analyzer to show your this error message. If you run rust-analyzer directly in your terminal, you'll also see that error.

The solution is to install rust-analyzer of your default toolchain by rustup component add rust-analyzer.

@oxalica oxalica closed this as completed Sep 20, 2024
@Boscop
Copy link
Author

Boscop commented Sep 29, 2024

Ah yeah, I was confused because the executable was there but it was just a shim.
I thought I had it installed but it turned out that VS code used its own bundled version..

@Boscop
Copy link
Author

Boscop commented Sep 29, 2024

@oxalica Btw, what's the difference between the client_builder and client_trait examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants