-
Notifications
You must be signed in to change notification settings - Fork 279
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
Automatic source discovery with rust's new rust-src
package
#595
Comments
Cool! Presumably this is aware of the active toolchain in the current directory given that it uses |
@jwilm rustup proxies the |
So right now as an arch linux user I unfortunately have to places to search for rust sources, |
@jplatte I would expect that if racer cannot find the source via this method it would fall-back to the old behaviour, so it shouldn't cause any problems. |
Well yes, but I'd really like to get rid of the need to set I think we should make racer as much of an out-of-the-box experience as possible for as many users as possible (without adding unnecessary complexity though, which is why I proposed to wait for a standard install location to surface instead of trying multiple locations). |
I don't think there will be a standard install location for linux distribution's rust source package. (even, windows, mac), but the and explicit setting |
I've put in a PR |
@jwilm Yes, it would. rustup is factored as a series of libraries exactly for your use case, but we haven't put much effort into making it usable as a library. It would be relatively easy to clean it up and publish a usable build, though that would come with some heavy deps that you might not want, particularly for network access. Creating a library that only queries the local configuration is somewhat more work. |
The main problem I see with this (and why I never pursued this idea further in the past) is that it makes any change to rustup's metadata a breaking change. At the moment, we're free to do pretty much anything as long as we have a migration path in place, but that will not be possible for a library since we have to continue to support arbitrarily old versions of the library and they may be older or newer than the installed rustup. |
@brson we've avoided using stuff like @Diggsey You're right about that. 😞 If only we could dynamically link to a rustup library and then it would just be an API that must be stable versus the metadata itself. Does |
|
D'oh, should have just traced it in the first place. Answer: no it doesn't 😄 |
Bump? |
@C-Bouthoorn bump what? Racer should use |
Then I guess the problem is in |
Hello.. I'd like to alert that setting a PATH is not a user responsibility. The Rust ecosystem (cargo) knows everything about its install, the user definitely does not. https://github.com/racer-rust/racer#configuration has lots of instructions a computer is very able of following. Heck, why should there be additional commands after running Paths are considered evil, the equivalent of dangling pointers in C. That's pain right there. Put humans in the loop to deal with them and you have a recipy for torture. |
@freedaun we'd welcome a PR that interacted with cargo to get that information automatically. For compat reasons, we'd need to honor user-specified values when they exist, but your PR could reduce setup complexity for newcomers. |
Rust now has an "official" location to install sources to (
<toolchain root>/lib/rustlib/src/rust
). Although there is no separate installer for this new component, it can be installed via rustup.edit: scratch everything that was previously here, I'm an idiot 😞
It's as simple as
racer
callingrustc --print sysroot
and locating the source that way. This will then seamlessly work with rustup.The text was updated successfully, but these errors were encountered: