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

RUST_SRC_PATH = "${pkgs.rustc.src}/lib/rustlib/src/rust/src/"; is wrong? #60

Open
dpc opened this issue Jul 30, 2021 · 6 comments
Open

Comments

@dpc
Copy link

dpc commented Jul 30, 2021

pkgs.rustc.src is a

/nix/store/wrxr7nvx9zkhs0sp8rna227n47hyc3fl-rustc-1.51.0-src.tar.gz: gzip compressed data, max compression, original size modulo 2^32 1051570176

rust-analyzer doesn't seem to work with it.

@dpc dpc changed the title RUST_SRC_PATH = "${pkgs.rustc.src}/lib/rustlib/src/rust/src/"; is wrong RUST_SRC_PATH = "${pkgs.rustc.src}/lib/rustlib/src/rust/src/"; is wrong? Jul 30, 2021
@dpc
Copy link
Author

dpc commented Jul 30, 2021

Or maybe rust-analyzer is supposed to handle tar.gz files? Well. In that case it doesn't work for me. I tried with mozilla overlay and standalone rust-src and it still doesn't work. Oh well.

@dpc dpc closed this as completed Jul 30, 2021
@dpc dpc reopened this Jul 30, 2021
@dpc
Copy link
Author

dpc commented Jul 30, 2021

I don't think it does since it tries to lookup the exact directory to check if it's valid rust-lang/rust-analyzer@85db47a

@dpc
Copy link
Author

dpc commented Jul 30, 2021

After more digging it seems that the root cause is a need for more recnet rust-analyzer than what's available in nixpkgs.

Though that RUST_SRC_PATH indeed seems wrong, and rust-analyzer will just switch to use rustc --print sysroot to detect library source code instead.

@symphorien
Copy link
Contributor

In recent versions of nixpkgs, rust-analyzer is wrapped to use the right value of this env var, so this could be removed.

@dpc
Copy link
Author

dpc commented Aug 9, 2021

@symphorien I'm not sure if I understand. The main problem that I've seen is that this env var points to a tar file, and rust-analyzer does not seem to support anything like this. I just wanted to point it out to potentially help , and if I'm just confused about something, feel free to close.

@symphorien
Copy link
Contributor

I meant: rust-analyzer works fine if you remove the env var, because of https://github.com/NixOS/nixpkgs/blob/nixos-unstable/pkgs/development/tools/rust/rust-analyzer/wrapper.nix#L14
So I'm in favor of removing this env var.

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

No branches or pull requests

2 participants