rust-analyzer: Regression in v0.2.686: `OUT_DIR` not set, enable "run build scripts" to fix
Repro: https://github.com/shikhar/bazel-tonic/tree/4a27fbf7fe15a26804a3eb5eb3f7b62dafa9fba4

The error does not make sense because that setting defaults to true.
The error is gone after after rolling back to the last release v0.2.678.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 8
- Comments: 25 (6 by maintainers)
Same as @asaaki & @trentbb: discovered this when using bindgen in a workspace member crate. Made a reproduction repo with a minimal bindgen
rust-analyzer --version:rust-analyzer 516eb40ba 2021-09-13 stableOS: Arch Linux x86_64 (5.14.2) Editor: Neovim 0.5I have seen this issue right now myself, currently running RA nightly / 0.3.708 (VSC 1.59.0, Win10). Have not a repro repo, but I have a suspicion: The error happens when I work in a VSCode workspace with multiple folders/projects, but it does not happen when I open the project individually.
From a freshly generated one using tonic. Interestingly, it works perfectly fine on windows, but not on ubuntu (over VsCode SSH)
The project is basically their hello-world example
Reopening as folks are running into it, although I am not currently experiencing this problem.
ED: also running into this!
had the same effect on single-project workspace after deleting and rewriting build.rs restarting vs code did solve.
Same as @asaaki I am seeing this error when I have my whole workspace open. Opening up the individual project fixes the issue.
I’m facing the same issue in neovim with rust-tools.nvim in default config.
UPDATE: I’m using one
include!(concat!(env!("OUT_DIR"), ""))fortonic_buildgenerated sources and another for sources generated from a custom binary.rust-analyzer versions tested:
OUT_DIR not set, enable "run build scripts" to fix)OUT_DIR not set, enable "run build scripts" to fix)proc macro server crashed)Versions in use:
You can follow the instructions here: https://github.com/rust-analyzer/rust-analyzer/tree/master/docs/dev#launching-rust-analyzer
Can you post the configuration picked up by the extension? It should be printed to the “Output” tab under “Rust Analyzer Client”.