paritytech/parity-db

v0.2.3 has a broken Cargo.toml

bernardoaraujor opened this issue · 5 comments

I'm trying to follow https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/setup

but my build fails with:

$ cargo build --release
error: failed to download `parity-db v0.2.3`

Caused by:
  unable to get packages from source

Caused by:
  failed to parse manifest at `/home/bear/.cargo/registry/src/github.com-1ecc6299db9ec823/parity-db-0.2.3/Cargo.toml`

Caused by:
  failed to parse the version requirement `0.11	` for dependency `parking_lot`

Caused by:
  expected comma after minor version number, found '\t'

I downloaded parity-db==0.2.3 via cargo-download and found that Cargo.toml indeed has an extra \t on the parking_lot declaration:

# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO
#
# When uploading crates to the registry Cargo will automatically
# "normalize" Cargo.toml files for maximal compatibility
# with all versions of Cargo and also rewrite `path` dependencies
# to registry (e.g., crates.io) dependencies
#
# If you believe there's an error in this file please file an
# issue against the rust-lang/cargo repository. If you're
# editing this file be aware that the upstream Cargo.toml
# will likely look very different (and much more reasonable)

[package]
edition = "2018"
name = "parity-db"
version = "0.2.3"
authors = ["Parity Technologies <admin@parity.io>"]
description = "Key-value database for the blockchain"
homepage = "https://substrate.dev"
license = "MIT OR Apache-2.0"
repository = "https://github.com/paritytech/parity-db/"
[profile.release]
lto = "fat"
codegen-units = 1
debug = true
panic = "abort"
[dependencies.blake2-rfc]
version = "0.2.18"

[dependencies.crc32fast]
version = "1.2.0"

[dependencies.fs2]
version = "0.4.3"

[dependencies.hex]
version = "0.4.2"

[dependencies.libc]
version = "0.2"

[dependencies.log]
version = "0.4.8"

[dependencies.memmap2]
version = "0.2"

[dependencies.parking_lot]
version = "0.11\t"

[dependencies.rand]
version = "0.8.2"
[dev-dependencies.env_logger]
version = "0.8.2"

0.2.2 has it too

error: failed to parse manifest at `/cargo-home/registry/src/github.com-1ecc6299db9ec823/parity-db-0.2.2/Cargo.toml`

Caused by:
  failed to parse the version requirement `0.11 ` for dependency `parking_lot`

Caused by:
  expected comma after minor version number, found '\t'

This was fixed in 0.2.4. Try using the v3.0.0+monthly-2021-07 tag when following the tutorial.

@arkpar Can you please do it for every package that has this one as dependency? I don't have it directly, it's somewhere in 3rd party module.

@Atomosk The only package that directly depends on this is sc-client-db. It is going to be published with other substrate crates, but I'm not sure when.
In any case, you can update your local dependency with cargo update -p parity-db even if it is indirect. Or use patch section in Cargo.toml

@arkpar @Atomosk just FYI Substrate Recipes is broken with the same problem.
Reproduced it on both master and v3.0.0 tag.

cargo update -p parity-db solved the problem.