rust-lang / rust-lang/rust-analyzer

Runnable env per build configuration (debug, release)

Open
#12,300 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Hello!

First I would like to say a big thank you for this wonderful extension, really makes working with Rust in VSCode a breeze once a bit of configuration is done 🙂

I'm currently facing a case where we use different RUSTFLAGS between our debug and release builds. rust-analyzer seems to be using mostly the debug build, I tried setting some RUSTFLAGS (the ones for the release profile) through the runnableEnv config, this invalidated the build cache as there was a mismatch between the standard debug flags I use to build stuff in my terminal and the ones (for release) that rust-analyzer used as I set them in the configuration.

So the question is: how hard would it be to have runnableEnvs on a per config basis (debug, release) and more (?) (test, bench) not sure if it makes sense to have additional envs for test and benches, but I guess it could be useful.

Maybe it's already doable and I don't see it!

Otherwise maybe you can point to the relevant code in here and I might be able to contribute something if it's not a high priority feature!

Cheers

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

Start by tracing rust-analyzer's runnableEnv configuration and how runnable commands select debug and release build configurations. Compare the existing environment handling with the requested debug, release, test, and bench cases; done means each supported configuration can use its own environment without invalidating unrelated build caches.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Feature
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.