Closed
Description
Verification
- I searched for recent similar issues at https://github.com/rust-lang/rustup/issues?q=is%3Aissue+is%3Aopen%2Cclosed and found no duplicates.
- I am on the latest version of Rustup according to https://github.com/rust-lang/rustup/tags and am still able to reproduce my issue.
Problem
Independent of the directory and command I run cargo errors with the following error message:
rustup show active-toolchain
error: error parsing manifest: TOML parse error at line 1478, column 23
|
1478 | [[pkg.rust.target.aarcwin.extensions]]
| ^
invalid table header
expected `.`, `]]`
cargo --help
error: error parsing manifest: TOML parse error at line 1478, column 23
|
1478 | [[pkg.rust.target.aarcwin.extensions]]
| ^
invalid table header
expected `.`, `]]`
in vscode the rust-analyzer log is a bit more helpfull with:
rust-analyzer failed to load workspace: Failed to load the project at /home/bennet/git/project/Cargo.toml: Failed to query rust toolchain version at /home/bennet/git/project, is your toolchain setup correctly?: cd "/home/bennet/git/project" && "/home/bennet/.cargo/bin/cargo" "--version" failed, exit status: 1
stderr:
error: error parsing manifest: TOML parse error at line 1478, column 23
|
1478 | [[pkg.rust.target.aarc<!--a bunch of nul bytes-->win.extensions]]
| ^
invalid table header
expected `.`, `]]`
It shows a bunch of null bytes where `<!--a bunch of nul bytes-->` is.
This is under WSL2 Ubuntu on Windows 11, I believe the corruption might be due to a recent export import of the WSL Image/distribution.
But I think cargo should handle this better, at least a filename of the manifest that failed to parse would be good.
Steps
- somehow corrupt the manifest file
- run any of the command show above
Possible Solution(s)
Include manifest path in error message
Notes
No response
Rustup version
$> rustup --version
rustup 1.27.1 (54dd3d00f 2024-04-24)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.78.0 (9b00956e5 2024-04-29)`
Installed toolchains
$> rustup show
Default host: x86_64-unknown-linux-gnu
rustup home: /home/bennet/.rustup
installed toolchains
--------------------
stable-x86_64-unknown-linux-gnu (default)
nightly-x86_64-unknown-linux-gnu
esp
active toolchain
----------------
(error: error parsing manifest, TOML parse error at line 1478, column 23
|
1478 | [[pkg.rust.target.aarcwin.extensions]]
| ^
invalid table header
expected `.`, `]]`
)
OS version
WSL2 under Windows 11 with
$> lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.6 LTS
Release: 20.04
Codename: focal