Description
I ran into a odd situation where after running bazel run @rules_rust//tools/rust_analyzer:gen_rust_project
I got an error
Error: Failed to make progress on building crate dependency graph
However, I was confused because on a different machine (same code and commit) the tool worked just fine. After running
RUST_LOG=debug bazel run @rules_rust//tools/rust_analyzer:gen_rust_projec
and diffing logs from the working machine and broken machine, I noticed the working machine had
[WARN gen_rust_project_lib::aquery] Skipping missing crate_spec file: ....
but the broken machine didn't have this log and instead had
[DEBUG gen_rust_project_lib::aquery] CrateSpec {crate_id: "ID-external/....." }
This lead me to the following code which suggests that any leftover outputs from other configurations might impact generating rust-project.json
and lead to the failure above
rules_rust/tools/rust_analyzer/aquery.rs
Lines 148 to 152 in 64deada
The "solution" was to run bazel clean
and retry generating rust-project.json
. This solution is not acceptable to me and should be considered a big. The tool should behave consistently even if there's some leftover files in bazel-out/
.
I don't yet have a consistent repro but hoping someone else does 😅. Either way, thought this info would be useful.