jeremyletang / rust-sfml

SFML bindings for Rust
Other
638 stars 88 forks source link

`cargo install` fails, due to 'failed to parse manifest' #254

Closed richelbilderbeek closed 2 years ago

richelbilderbeek commented 2 years ago

Hi rust-sfml maintainers, hi @jeremyletang,

rust-sfml seems very promising to me. However, already installing it gave me -a rustling- an error I do not know how to fix:

Install (from The Cargo Book):

cargo install --git https://github.com/jeremyletang/rust-sfml

results in:

    Updating git repository `https://github.com/jeremyletang/rust-sfml`
error: failed to parse manifest at `/home/richel/.cargo/git/checkouts/rust-sfml-57dacbb744fc0106/7a0df69/Cargo.toml`

Caused by:
  feature `edition2021` is required

  consider adding `cargo-features = ["edition2021"]` to the manifest

How can I fix this? What did I do wrong?

Thanks for helping out a Rust beginner and cheers, Richel Bilderbeek

I use Ubuntu 20.04 LTS with all packages updated as well as rustc v1.57.0, rustup v1.24.3 and cargo v1.53.0.

(base) richel@N141CU:~/GitHubs/search_and_destroy_chess_2$ rustup --version
rustup 1.24.3 (ce5817a94 2021-05-31)
info: This is the version for the rustup toolchain manager, not the rustc compiler.
info: The currently active `rustc` version is `rustc 1.57.0 (f1edd0429 2021-11-29)`
(base) richel@N141CU:~/GitHubs/search_and_destroy_chess_2$ cargo --version
cargo 1.53.0
richelbilderbeek commented 2 years ago

I am unsure how to fix this, but it was an unnatural thing to do anyways.

The problem I had: in Cargo.toml, do not use

[...]

[dependencies]
[...]
rust-sfml = "0.16.0"

But use the sfml crate:

[...]

[dependencies]
[...]
sfml = "0.16.0"

Sorry for the noise!

crumblingstatue commented 2 years ago

You're not supposed to install dependencies with cargo install. cargo install is for installing applications. Also, that error was probably because your cago/rustc are old and don't support Rust 2021 edition.

richelbilderbeek commented 2 years ago

Thanks @crumblingstatue for clarifying that!