rust-lang / rust-lang/rust-analyzer

Regression: cannot find proc-macro-srv only on Windows

Open
#16,433 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: Anything since 0.3.1498. 0.3.1489 and earlier are unaffected

rustc version: reproduced with 1.67 and 1.75 on Windows. Could not reproduce with either on Linux

relevant settings: none

When cursor is moved over the sad rust-analyzer thing at the bottom in VS Code, you will see cannot find proc-macro-srv, the workspace C:\whatever is missing a sysroot. Repro should be as simple as

rustup default stable
cargo init

and open VS Code in this directory.

It's possible that installing rust-src fixes this. Our nostd-only Rust toolchain isn't shipped with sources so this isn't an option. Though we're interested in this bug because of our nostd-only toolchain, all behavior described above this paragraph applies to Windows stable as well.

I somewhat suspect that the VS Code and Windows changes by @Veykril may be the culprit based on looking at the output of git log --stat 2023-04-24..2023-05-01 --first-parent

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce on Windows with rustup default stable, cargo init, and VS Code, comparing rust-analyzer 0.3.1489 with versions since 0.3.1498. Inspect the VS Code and Windows changes in git log --stat 2023-04-24..2023-05-01 --first-parent, and check behavior with and without rust-src. Done means proc-macro-srv is found for Windows stable and the missing-sysroot error no longer appears.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.