Skip to content
This repository has been archived by the owner on Dec 29, 2022. It is now read-only.

rust-src and rust-analysis components out of sync? #1171

Closed
rekka opened this issue Dec 7, 2018 · 14 comments
Closed

rust-src and rust-analysis components out of sync? #1171

rekka opened this issue Dec 7, 2018 · 14 comments
Labels

Comments

@rekka
Copy link

rekka commented Dec 7, 2018

Not sure if this is the place to report this. The rust-src and rust-analysis components seem to be out of sync on Rust 1.31.0 stable: The go-to-definition on std items tries to open a file with a slightly different location:

For example, Go to definition for HashMap tries to open

~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libstd/collections/hash/map.rs

(note the missing src directory between rust and libstd) while the file is located at

~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libstd/collections/hash/map.rs

I have the problem both on Linux and macOS (while running rls through vim if that makes any difference). Installed using rustup component add rls rust-analysis rust-src. Even after I tried to rustup uninstall stable and reinstall it the problem persists.

@alexheretic
Copy link
Member

alexheretic commented Dec 7, 2018

Disappointing that this "src" issue managed to fall into the stable release. You may be right that out of date dependencies on the stable channel are to blame.

As a workaround switch to beta or nightly.

Related: rust-lang/rust#53586, #1140

@alexheretic
Copy link
Member

@nrc goto-definition is not fixed in stable

@RReverser
Copy link

I have the problem both on Linux and macOS

Can confirm same on Windows (just to rule out platform-specific issue).

@nrc
Copy link
Member

nrc commented Dec 7, 2018

Hmm, so both #1138 and #1147 made it to stable, which they probably shouldn't have done, however, the latter undoes the former, so I'm not sure what is going on. On Rust, rust-lang/rust#56194 should have fixed the breakage done by rust-lang/rust#53586 but I don't think either of them made it to master.

@nrc nrc added the P-high label Dec 7, 2018
@nrc
Copy link
Member

nrc commented Dec 7, 2018

We're using 0.16.10 of rls-analysis. We probably want a fork, that has the most recent commits, but with d5d2f98d6f7668e2b6139c6cd93a8d20e28c396b reverted.

@Xanewok
Copy link
Member

Xanewok commented Dec 10, 2018

@nrc I pushed rls-analysis branch and rls branch using that at (based on what's in 1.31 rust/stable now):
https://github.com/rust-dev-tools/rls-analysis/tree/1.31-stable-src-prefix-fix
https://github.com/rust-lang/rls/tree/1.31-stable-src-prefix-fix

However, rls now points to a branch at rust-dev-tools/ team, which I'm not sure we accept in-tree.
Should we vendor the rls-analysis fork inside the Rust tree on stable channel?

@petergardfjall
Copy link

I'm seeing the same issue on emacs with lsp-rust.

When trying to go to definition on, for example, String::from, emacs (LSP) answers:
Cannot read ~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/libcore/convert.rs

The real location is:
~/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/src/libcore/convert.rs

Running on stable-x86_64-unknown-linux-gnu unchanged - rustc 1.31.0 (abe02cefd 2018-12-04)

@pietroalbini
Copy link
Member

This will be fixed in Rust 1.31.1, scheduled to be released on Thursday 20th.

bors added a commit to rust-lang/rust that referenced this issue Dec 18, 2018
[stable] 1.31.1 point release

Rust 1.31.1 is scheduled to be released on Thursday 20th, with the following changes:

* #56562: Update libc version required by rustc *(different patch made by me)*
* #56615: Update the book to fix some edition-related bugs
* rls submodule update to [`b379ef7`](rust-lang/rls@b379ef7), including:
  * rust-lang/rls#1170: Fix for common infinte loop regression
  * rust-lang/rls#1171: Can't jump to std defs

r? @Mark-Simulacrum
cc @rust-lang/core @rust-lang/release
@pietroalbini
Copy link
Member

@rekka @RReverser @petergardfjall can you check if this is fixed in Rust 1.31.1? You can download the pre-release with:

RUSTUP_DIST_SERVER=https://dev-static.rust-lang.org rustup update stable

@rekka
Copy link
Author

rekka commented Dec 19, 2018

@pietroalbini Seems to work now with no problems on macOS and Linux for me. Thanks for the fix! And as a nice bonus, RLS now respects the target directory in .cargo/config!

@petergardfjall
Copy link

It appears to be working on my end as well!

@DanielJoyce
Copy link

Yay finally.

@doxxx
Copy link

doxxx commented Dec 21, 2018

Working on Windows using Rust 1.31.1! Thanks!

netbsd-srcmastr pushed a commit to NetBSD/pkgsrc that referenced this issue Dec 22, 2018
Pkgsrc changes:
 * Sadly, I had to reinstate the "make tar files" rust code to make
   it possible to build cross-compiled bootstrap kits.
 * Add an adjustable "BUILD_TARGET", "dist" for cross-building
   a bootstrap kit, "build" for a normal native build.
 * New bootstrap kits built for NetBSD/powerpc, NetBSD/earmv7hf,
   and NetBSD/sparc64 version 1.31.1.
 * gcc-wrap script amended to also drop -Wl,--enable-new-dtags
   (so it could be used outside pkgsrc)
 * Worked around use of AtomicU64 in release build tool (ugly band-aid patch).
   Some platforms lack support for that type and associated operations.

Upstream changes:
 - [Fix Rust failing to build on `powerpc-unknown-netbsd`][56562]
 - [Fix broken go-to-definition in RLS][rls/1171]
 - [Fix infinite loop on hover in RLS][rls/1170]

[56562]: rust-lang/rust#56562
[rls/1171]: rust-lang/rls#1171
[rls/1170]: rust-lang/rls#1170
@dsietz
Copy link

dsietz commented Feb 10, 2019

Is this issue resolved for the target x86_64-pc-windows-msvc?
It is working for i686-pc-windows-msvc, but not x86_64-pc-windows-msvc in my appveyor job.

Just wondering.

Running Install scripts
curl -sSf -o rustup-init.exe https://win.rustup.rs/
rustup-init.exe -y --default-host %TARGET%
info: syncing channel updates for 'stable-x86_64-pc-windows-msvc'
info: latest update on 2019-01-17, rust version 1.32.0 (9fda7c223 2019-01-16)
info: downloading component 'rustc'
info: downloading component 'rust-std'
info: downloading component 'cargo'
info: downloading component 'rust-docs'
info: installing component 'rustc'
info: installing component 'rust-std'
info: installing component 'cargo'
info: installing component 'rust-docs'
info: default toolchain set to 'stable'

stable installed - rustc 1.32.0 (9fda7c223 2019-01-16)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

10 participants