From 5f228ebb71def1e24905e3977f3f6e8d027b96e9 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 17 Oct 2025 12:40:48 +0200 Subject: [PATCH 1/4] ignore `build-rust-analyzer` even if it's a symlink --- .gitignore | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index 5988a64916ad8..5fb884e7bf5c5 100644 --- a/.gitignore +++ b/.gitignore @@ -48,7 +48,7 @@ no_llvm_build /llvm/ /mingw-build/ /build -/build-rust-analyzer/ +/build-rust-analyzer /dist/ /unicode-downloads /target From e2a1fae2e0ff35deb116a4dfd475e6a10e7e58d4 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 26 Sep 2025 17:43:25 +0200 Subject: [PATCH 2/4] tweak helix config --- src/bootstrap/src/core/build_steps/setup.rs | 1 + src/etc/rust_analyzer_helix.toml | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bootstrap/src/core/build_steps/setup.rs b/src/bootstrap/src/core/build_steps/setup.rs index 4b0080f1c80a4..a798dcf18026f 100644 --- a/src/bootstrap/src/core/build_steps/setup.rs +++ b/src/bootstrap/src/core/build_steps/setup.rs @@ -596,6 +596,7 @@ Select which editor you would like to set up [default: None]: "; "198c195ed0c070d15907b279b8b4ea96198ca71b939f5376454f3d636ab54da5", "1c43ead340b20792b91d02b08494ee68708e7e09f56b6766629b4b72079208f1", "eec09a09452682060afd23dd5d3536ccac5615b3cdbf427366446901215fb9f6", + "b6143911d3ad8fd73a767f06a263e6ba7f1720f361a28b6e97266db8e21c042b", ], EditorKind::Vim | EditorKind::VsCode => &[ "ea67e259dedf60d4429b6c349a564ffcd1563cf41c920a856d1f5b16b4701ac8", diff --git a/src/etc/rust_analyzer_helix.toml b/src/etc/rust_analyzer_helix.toml index e2de2a374cbed..b3ded63ef79d9 100644 --- a/src/etc/rust_analyzer_helix.toml +++ b/src/etc/rust_analyzer_helix.toml @@ -4,7 +4,7 @@ # # To build rustfmt and proc macro server for r-a run the following command: # ``` -# x b proc-macro-srv-cli rustfmt --stage 0 --build-dir build-rust-analyzer +# x b proc-macro-srv-cli rustfmt --build-dir build-rust-analyzer # ``` [language-server.rust-analyzer.config] @@ -18,7 +18,6 @@ linkedProjects = [ ] [language-server.rust-analyzer.config.check] -invocationLocation = "root" invocationStrategy = "once" overrideCommand = [ "python3", @@ -57,7 +56,7 @@ overrideCommand = [ "x.py", "check", "--json-output", + "--compile-time-deps", "--build-dir", "build-rust-analyzer", - "--compile-time-deps", ] From ba9de4e7ddbaff0ae47db77132cbe42ed2decd65 Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 26 Sep 2025 17:43:25 +0200 Subject: [PATCH 3/4] provide rust analyzer in the nix dev shell --- src/tools/nix-dev-shell/shell.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/nix-dev-shell/shell.nix b/src/tools/nix-dev-shell/shell.nix index 6ca8a7c4652d3..5046acb8001fd 100644 --- a/src/tools/nix-dev-shell/shell.nix +++ b/src/tools/nix-dev-shell/shell.nix @@ -16,6 +16,7 @@ pkgs.mkShell { pkgs.nix pkgs.glibc.out pkgs.glibc.static + pkgs.rust-analyzer x # Get the runtime deps of the x wrapper ] ++ lists.flatten (attrsets.attrValues env); From ae6e555d151ae5b179f8d00e491ef03317a72eee Mon Sep 17 00:00:00 2001 From: Waffle Lapkin Date: Fri, 17 Oct 2025 14:30:57 +0200 Subject: [PATCH 4/4] nix shell: add stage0 rustc/cargo to path this makes r-a pickup on them and use them instead of system (not) installed ones --- src/tools/nix-dev-shell/shell.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/tools/nix-dev-shell/shell.nix b/src/tools/nix-dev-shell/shell.nix index 5046acb8001fd..19c5080da0658 100644 --- a/src/tools/nix-dev-shell/shell.nix +++ b/src/tools/nix-dev-shell/shell.nix @@ -21,6 +21,10 @@ pkgs.mkShell { # Get the runtime deps of the x wrapper ] ++ lists.flatten (attrsets.attrValues env); + shellHook = '' + export PATH=$(pwd)/build/host/stage0/bin:$PATH + ''; + env = { # Avoid creating text files for ICEs. RUSTC_ICE = 0;