Skip to content

Failed to read Cargo metadata from Cargo.toml file /Cargo.toml #14507

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
vilinski opened this issue Apr 6, 2023 · 2 comments
Closed

Failed to read Cargo metadata from Cargo.toml file /Cargo.toml #14507

vilinski opened this issue Apr 6, 2023 · 2 comments
Labels
C-bug Category: bug

Comments

@vilinski
Copy link

vilinski commented Apr 6, 2023

rust-analyzer version: (eg. output of "rust-analyzer: Show RA Version" command, accessible in VSCode via Ctrl/⌘+Shift+P)
rust-analyzer version: 0.3.1463-standalone

rustc version: (eg. output of rustc -V)
rustc 1.68.2 (9eb3afe9e 2023-03-27)

relevant settings: (eg. client settings, or environment variables like CARGO, RUSTC, RUSTUP_HOME or CARGO_HOME)
nothing is set

MacOS Ventura 13.3
M1 Max 32GB
There are no problems in local rust repos.
But this workspace is opened over ssh connections. The rust-analyser is installed.
Is it possible that Cargo.toml path is wrong? I is shown as /Cargo.toml, but really it is under /home/username/workspace/reponame/Cargo.toml

[ERROR rust_analyzer::main_loop] FetchWorkspaceError:
rust-analyzer failed to load workspace: Failed to read Cargo metadata from Cargo.toml file /Cargo.toml, Some(Version { major: 1, minor: 68, patch: 2 }): Failed to run `cd "/" && "cargo" "metadata" "--format-version" "1" "--manifest-path" "/Cargo.toml" "--filter-platform" "x86_64-unknown-linux-gnu"`: `cargo metadata` exited with an error: error: manifest path `/Cargo.toml` does not exist
@vilinski vilinski added the C-bug Category: bug label Apr 6, 2023
@lnicola
Copy link
Member

lnicola commented Apr 6, 2023

Probably a duplicate of #14480. Can you install a nightly version (there's an option on the extension page) and then remove rust-analyzer.linkedProjects from your settings?

@vilinski
Copy link
Author

vilinski commented Apr 6, 2023

that worked.
closing as a duplicate of #14480

@vilinski vilinski closed this as completed Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants