rust-lang / rust-lang/rust-analyzer

PATH env is incorrect for "Run Test" on mac osx

Open
#19,720 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer version: v0.3.2319.

When I click "Run Test", I got the error below:

Image

But if I run the same command in the terminal, it works:

Image

Here is where the cargo binary is located:

% which cargo
/Users/alan.xu/.cargo/bin/cargo

So I think the PATH env is incorrect for "Run Test".
(btw, I'm using zsh, and the PATH is set in ~/.zshrc)

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 Run Test on macOS with zsh and compare the environment's PATH with the terminal PATH, especially the reported /Users/alan.xu/.cargo/bin/cargo location. Trace the Run Test entry point and process-launch environment; done means the generated test command can resolve cargo as it does in the terminal.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.