rust-lang / rust-lang/rust-analyzer

ERROR Flycheck failed to run the following command

Open
#22,688 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

rust-analyzer version: 0.3.2955
rustc version: 1.96.1
editor or extension: Visual Studio Code
relevant settings: none
OS: Windows 11 Home 25H2(26200.8655)
Others: Windows 11 SDK(10.0.28000.1839)

Summary:
I have a rust bin project. In Cargo.toml file, if I add a mimalloc(mimalloc = "0.1") dependencies to this project, it will report a error in VSCode:

2026-07-01T08:15:32.0928241+08:00 ERROR FetchBuildDataError: error: failed to run custom build command for libmimalloc-sys v0.1.49 note: To improve backtraces for build dependencies, set the CARGO_PROFILE_DEV_BUILD_OVERRIDE_DEBUG=true environment variable to enable debug information generation.

Caused by: process didn't exit successfully: C:\prjs_rust_git_src\rust_learning\mytest02\target\debug\build\libmimalloc-sys-bb484ed7d47cad91\build-script-build (exit code: 1) --- stderr

error occurred in cc-rs: command did not execute successfully (status code exit code: 2): "C:\Program Files (x86)\Microsoft Visual Studio\18\BuildTools\VC\Tools\MSVC\14.51.36231\bin\HostX64\x64\cl.exe" "-nologo" "-MD" "-Z7" "-Brepro" "-std:c++17" "-I" "c_src/mimalloc/v3/include" "-I" "c_src/mimalloc/v3/src" "-W4" "/Zc:__cplusplus" "-DMI_DEBUG=0" "-FoC:\prjs_rust_git_src\rust_learning\mytest02\target\debug\build\libmimalloc-sys-e1725bc60f4f3fe1\out\ea87f1564a68d277-mimalloc-static.o" "-c" "C:\prjs_rust_git_src\rust_learning\mytest02\target\debug\build\libmimalloc-sys-e1725bc60f4f3fe1\out\mimalloc-static.cc"

2026-07-01T08:16:08.3452738+08:00 ERROR Flycheck failed to run the following command: CommandHandle { program: "C:\Users\ddaixi.cargo\bin\cargo.exe", arguments: ["check", "--workspace", "--message-format=json-diagnostic-rendered-ansi", "--manifest-path", "C:\prjs_rust_git_src\rust_learning\mytest02\Cargo.toml", "--keep-going", "--all-targets"], current_dir: Some("C:\prjs_rust_git_src\rust_learning\mytest02") }, error=Cargo watcher failed, the command produced no valid metadata (exit code: ExitStatus(ExitStatus(101))): Blocking waiting for file lock on package cache Blocking waiting for file lock on package cache 1.822438700s INFO prepare_target{force=false package_id=mytest02 v0.1.0 (C:\prjs_rust_git_src\rust_learning\mytest02) target="mytest02"}: cargo::core::compiler::fingerprint: fingerprint error for mytest02 v0.1.0 (C:\prjs_rust_git_src\rust_learning\mytest02)/Check { test: true }/TargetInner { name_inferred: true, ..: lib_target("mytest02", ["lib"], "C:\prjs_rust_git_src\rust_learning\mytest02\src\lib.rs", Edition2024) } 1.824259400s INFO prepare_target{force=false package_id=mytest02 v0.1.0 (C:\prjs_rust_git_src\rust_learning\mytest02) target="mytest02"}: cargo::core::compiler::fingerprint: err: failed to read C:\prjs_rust_git_src\rust_learning\mytest02\target\debug.fingerprint\mytest02-707d0ba1f50f9ee3\test-lib-mytest02

Cargo.toml:
[dev-dependencies]
mimalloc = "0.1"


It looks like FlyCheck can not run normally. I re-install VSCode, rust-analyzer, and all plugins in VSCode, and clean cc, mimalloc libmimalloc-sys sources file and cache in .cargo/registry/cache & .cargo/registry/src, and call cargo clean and delete Cargo.lock, but none of them solves the problem.
If i use cargo check or cargo run command in PowerShell, it can run normally.

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

No repository file or test is named. Start by reproducing the Cargo.toml [dev-dependencies] mimalloc case with the logged cargo check command, then compare its rust-analyzer Cargo watcher behavior with cargo check in PowerShell. Done means the Windows-specific failure is isolated to an actionable rust-analyzer component or ruled out as an external build issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, vscode
Domain
developer-experience, devtools, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.