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

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

Closed
rekka opened this Issue Dec 7, 2018 · 13 comments

Comments

Projects
None yet
9 participants
@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

This comment has been minimized.

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

This comment has been minimized.

Copy link
Member

alexheretic commented Dec 7, 2018

@nrc goto-definition is not fixed in stable

@RReverser

This comment has been minimized.

Copy link

RReverser commented Dec 7, 2018

I have the problem both on Linux and macOS

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

@nrc

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

Copy link

petergardfjall commented Dec 11, 2018

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

This comment has been minimized.

Copy link
Member

pietroalbini commented Dec 17, 2018

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 17, 2018

Auto merge of #56911 - rust-lang:stable-1.31.1, r=Mark-Simulacrum
[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

bors added a commit to rust-lang/rust that referenced this issue Dec 18, 2018

Auto merge of #56911 - rust-lang:stable-1.31.1, r=Mark-Simulacrum
[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

bors added a commit to rust-lang/rust that referenced this issue Dec 18, 2018

Auto merge of #56911 - rust-lang:stable-1.31.1, r=Mark-Simulacrum
[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

This comment has been minimized.

Copy link
Member

pietroalbini commented Dec 19, 2018

@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

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link

petergardfjall commented Dec 20, 2018

It appears to be working on my end as well!

@DanielJoyce

This comment has been minimized.

Copy link

DanielJoyce commented Dec 20, 2018

Yay finally.

@doxxx

This comment has been minimized.

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

he
Upgrade rust to version 1.31.1.
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment