rust-lang / rust-lang/rust-analyzer

rust-analyzer.cargo.buildScripts.enable appears to be ignored

Open
#12,746 1 comment 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

rust-analyzer version: rust-analyzer version: 0.0.0 (5342f47f4 2022-07-09)

rustc version: rustc 1.61.0 (fe5b13d68 2022-05-18)

relevant settings: none

Thanks for making Rust Analyzer!

There's a problem in my build script, which leads rust-analyzer in VS Code to report "rust-analyzer failed to run build scripts Check the server logs for additional info."

I tried setting rust-analyzer.cargo.buildScripts.enable to false, both using the VS Code UI as well as verifying the change in settings.json. I reloaded the extension and immediately got the "build script failed to run" error - which suggests Rust Analyzer is still attempting to run the build scripts, despite the setting telling it not to. I also tried quitting and reopening VS Code, and still got the same error.

Grepping through the Rust Analyzer code base, it looks like the setting is used here:

https://github.com/rust-lang/rust-analyzer/blob/65874dfff205335840cc9265ba06d74f234b719d/editors/code/src/config.ts#L188-L189

However, grepping for those two other settings in the code base, I'm not seeing where they're used.

Is this config currently a no-op? If so, is there actually a way to get Rust Analyzer not to run build scripts?

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 in editors/code/src/config.ts at the referenced lines and trace rust-analyzer.cargo.buildScripts.enable through the configuration handling. Reproduce the issue in VS Code with a failing build script and the setting disabled; done means disabling the setting prevents build scripts from running and removes the reported failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.