rust-lang / rust-lang/rust-analyzer
Debug mode fails to set CARGO_MANIFEST_DIR environment variable
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.9k
- Forks
- 2.2k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 72
Description
Running a project in Debug mode fails to set CARGO_MANIFEST_DIR environment variable.
rust-analyzer version: v0.3.1896
rustc version: rustc 1.79.0-nightly (85e449a32 2024-03-22)
relevant settings: Default
code snippet to reproduce:
use std::env;
fn main() {
if let Some(_manifest_dir) = env::var_os("CARGO_MANIFEST_DIR") {
println!("Found CARGO_MANIFEST_DIR");
} else {
println!("Error finding CARGO_MANIFEST_DIR");
}
}
Pressing Run prints "Found CARGO_MANIFEST_DIR".
Pressing Debug prints "Error finding CARGO_MANIFEST_DIR".
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the project in Debug mode with the provided Rust snippet, comparing its environment with Run mode. Trace rust-analyzer's debug launch configuration and identify where CARGO_MANIFEST_DIR should be set; done means Debug prints "Found CARGO_MANIFEST_DIR" consistently with Run.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100