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

Missing rust-src which is causing rust-analyzer to fatal in vscodium #263

Open
Kreyren opened this issue Aug 16, 2021 · 1 comment
Open

Comments

@Kreyren
Copy link
Contributor

Kreyren commented Aug 16, 2021

Afaik this is a component of rustup which is not used in this environment?

image

Nix-shell

# NixOS shell configuration to bootstrap the required dependencies
# NOTE(Krey): Uses mozilla's overlay, because nix's upstream is slow

let
	moz_overlay = import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz);
	nixpkgs = import <nixpkgs> { overlays = [ moz_overlay ]; };
in
	with nixpkgs;
	stdenv.mkDerivation {
		name = "moz_overlay_shell";
		buildInputs = [
			# NOTE(Krey): Using nightly for 2021 edition
			(nixpkgs.rustChannelOf { date = "2021-08-15"; channel = "nightly"; }).rust
		];
	}
	

Editor

[nix-shell:~/Repositories/RiXotStudio/editors/nix/codium]$ cat default.nix 
#!/usr/bin/env nix-shell
# NixOS shell configuration to bootstrap the required dependencies and start the editor

with import <nixpkgs> {};
stdenv.mkDerivation {
	name = "RiXotStudio";
	buildInputs = [
		pkgs.vscodium-fhs
		pkgs.texlive.combined.scheme-full
	];
}

[kreyren@leonid:~/Repositories/RiXotStudio]$ ls "$(rustc --print sysroot)/bin"
cargo         cargo-fmt   clippy-driver  rls            rustc           rustdoc  rust-gdb     rust-lldb
cargo-clippy  cargo-miri  miri           rust-analyzer  rust-demangler  rustfmt  rust-gdbgui

May be relevant to rust-lang/rust-analyzer#4172

@nbp
Copy link
Collaborator

nbp commented Nov 4, 2021

When using rust-analysis, you should explicit it as part of the extensions to be included:

  ((nixpkgs.rustChannelOf { date = "2021-08-15"; channel = "nightly"; }).rust.override (old:
      { extensions = ["rust-src" "rust-analysis"]; }))

Adding a bad extension name, such as "foo" will exit with an error containing the list of available extensions.

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