Skip to content

Rust-analyzer failing to work. #1427

@gleocadie

Description

@gleocadie

I have a Dev Container config where I use rust:1 devcontainer feature .

I open my repo using VS Code inside WSL, I get the Open in container... and click on it. The container is successfully created and at some point rust-analyzer reports an issue

Image
ERROR failed fetching data layout for ManifestPath { file: AbsPathBuf("/workspaces/libdatadog/Cargo.toml") } workspace e=unable to fetch target-data-layout via `cd "/workspaces/libdatadog" && RUSTC_BOOTSTRAP="1" RUSTUP_TOOLCHAIN="/usr/local" "/usr/local/cargo/bin/rustc" "-Z" "unstable-options" "--print" "target-spec-json"`
2025-08-01T10:38:30.932545354Z ERROR failed fetching data layout for ManifestPath { file: AbsPathBuf("/workspaces/libdatadog/Cargo.toml") } workspace e=unable to fetch target-data-layout via `cd "/workspaces/libdatadog" && RUSTC_BOOTSTRAP="1" RUSTUP_TOOLCHAIN="/usr/local" "/usr/local/cargo/bin/rustc" "-Z" "unstable-options" "--print" "target-spec-json"`
2025-08-01T10:38:31.529452361Z ERROR Flycheck failed to run the following command: CommandHandle { program: "/usr/local/cargo/bin/cargo", arguments: ["check", "--workspace", "--message-format=json-diagnostic-rendered-ansi", "--manifest-path", "/workspaces/libdatadog/Cargo.toml", "--keep-going", "--all-targets"], current_dir: Some("/workspaces/libdatadog") }, error=Cargo watcher failed, the command produced no valid metadata (exit code: ExitStatus(unix_wait_status(25856))):
warning: /workspaces/libdatadog/datadog-crashtracker-ffi/Cargo.toml: unused manifest key: target.cfg(windows).features
error: process didn't exit successfully: `rustc -vV` (exit status: 1)
--- stderr
error: 'rustc' is not installed for the custom toolchain '/usr/local'.
note: this is a custom toolchain, which cannot use `rustup component add`
help: if you built this toolchain from source, and used `rustup toolchain link`, then you may be able to build the component with `x.py`

Any idea how to make this work please ?

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions