-
Notifications
You must be signed in to change notification settings - Fork 888
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
Binary named rust-analyzer
added to cargo bin path even when component is not added
#3846
Comments
I can make this less annoying by putting homebrew path before the cargo path, but I don't understand why its installing these dummy binaries into the PATH in the first place |
@praveenperera Thanks for filing this issue!
Yes, since
AFAIK you can't, unfortunately. However this point has been pointed out in the original PR by @ehuss:
If you are a VSCode user, it would be okay if you just use the plugin-bundled version of @rbtcollins Do you think it'll be fine if we only add shims for installed components (or |
Thanks, ya I meant is there a reason that the dummy binary needs to added when the component is not added? I guess the current method gives a message that shows people how to install it using |
@praveenperera Looking at Lines 804 to 832 in 454e8dc
... a possible workaround would be manually adding a symlink under |
Don't we decide which components to install on a per-toolchain basis? If that is the case, it would be tricky to decide which shims to install. |
@djc Indeed, although this is a qualitative description. I'm not sure about this idea security-wise, but I was thinking about implementing a If you think that sounds too disruptive (or even unrealistic), another solution could be confirming and solidifying the hack in #3846 (comment). Maybe by adding a help message or something. |
Sounds reasonable to me... Security-wise it seems okay to me because we're merely relying on the |
Fundamentally this is out of our hands. Either the rust project is shipping rust analyser as part of versioned releases, in which case the shim is needed to permit running the command. Or it is not, in which case we can remove the shim. I think it is reasonable for things like editor plugins which choose to manage a single version of rust analyser to +not+ depend on PATH to locate it, since there are many such editor plugins, as well as single version distributions like homebrew. |
I'm not sure if the bug reported here is 'i get an error', or, 'the wrong version runs': consider that we might teach this one proxy to fall back to path, but then the bug changes to be 'wrong version because I had the component installed'. I suggest finding out the plans of rust analyser. If the situation is transitory , I recommend doing nothing.. Users can put their own bin before the cargo bin anyway. If we add special case complexity, it affects our users as it becomes one more thing they have to learn about when the system behaves in a surprising manner. |
I can confirm this issue on linux. However I don't seem to get the suggestion to add the component. Unknown binary 'rust-analyzer' in official toolchain '1.80-x86_64-unknown-linux-gnu' |
Verification
Problem
Rustup keeps adding a binary named
rust-analyzer
to the .cargo/bin folder. But I didn't add it because I want homebrew to managerust-analyzer
version, because I want the latest version. But since there is arust-analyer
in my path at~/.cargo/bin/rust-analyzer
my editor tries to use it.Opening it i get a message
This is very annoying because I keep having to delete this dummy binary everytime i run rustup so my editor can find the actual binary. Is there any reason to create these dummy binaries? Can I disable this?
Steps
Possible Solution(s)
No response
Notes
No response
Rustup version
Installed toolchains
OS version
MacOS Version 14.5 (23F79)
The text was updated successfully, but these errors were encountered: