Skip to content
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

all cargo commands error, because some manifest is broken #3851

Closed
2 tasks done
Skgland opened this issue May 31, 2024 · 0 comments · Fixed by #3853
Closed
2 tasks done

all cargo commands error, because some manifest is broken #3851

Skgland opened this issue May 31, 2024 · 0 comments · Fixed by #3853
Labels

Comments

@Skgland
Copy link
Contributor

Skgland commented May 31, 2024

Verification

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. ![image](https://github.com/rust-lang/cargo/assets/3877590/d51f520f-9e40-49f5-b6a9-7c07c6032ff3)

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

  1. somehow corrupt the manifest file
  2. 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant