rust-lang / rust-lang/rust-analyzer

Environment variable for build.rs script

Open
#16,623 9 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

I've been having to figure out how to detect rust-analyzer in my build script to selectively disable a function that only needs to run during actual builds and not during code checking. I just submitted an issue about stack overflowing to the build-info crate team at https://github.com/danielschemmel/build-info/issues/16 about this very same issue.

I'm currently implementing a custom environment variable in my IDE just for rust-analyzer, but it would be nice for this to be universal

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 reviewing the issue's build.rs use case and how rust-analyzer distinguishes code checking from actual builds. Compare the proposed universal environment variable with the linked build-info issue, then identify the integration points and tests needed to show that the variable is consistently available during analysis and absent or different during normal builds.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.