cargo-features = ["rename-dependency"])diesel/examples/sqlite/getting_started_step_1$ cargo check
Updating crates.io index
error: failed to select a version for `diesel`.
... required by package `infer_schema_internals v1.3.0`
... which is depended on by `infer_schema_macros v1.3.0`
... which is depended on by `diesel_infer_schema v1.3.0`
... which is depended on by `diesel_tests v0.1.0 (/tmp/2/diesel/diesel_tests)`
versions that meet the requirements `~1.3.0` are: 1.3.3, 1.3.2, 1.3.0
all possible versions conflict with previously selected packages.
previously selected package `diesel v1.4.0`
... which is depended on by `diesel_demo_step_2_sqlite v0.1.0 (/tmp/2/diesel/examples/sqlite/getting_started_step_2)`
failed to select a version for `diesel` which could resolve this conflict
git clone repocd diesel/examples/sqlite/getting_started_step_1cargo checkerror: failed to parse manifest at `/tmp/2/diesel/diesel/Cargo.toml`
Caused by:
feature `rename-dependency` is required
consider adding `cargo-features = ["rename-dependency"]` to the manifest
Cargo.toml cargo checkCorrection, I cannot cheat the rename-dependency:
getting_started_step_1$ cargo build
Updating crates.io index
Downloading dotenv v0.10.1
Downloading diesel v1.4.0
error: unable to get packages from source
Caused by:
failed to parse manifest at `/home/grin/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-1.4.0/Cargo.toml`
Caused by:
feature `rename-dependency` is required
consider adding `cargo-features = ["rename-dependency"]` to the manifest
The first part of the issue is known an could be worked around by copying the example project out of the work space.
The second part is caused be a unsupported rustc version. The minimal supported version was bumped to 1.31 which supports that feature.
I don't get the second part, my rustc is 1.31.0.
The first part cannot be fixed since it's in the cargo-pulled config from diesel upstream:
failed to parse manifest at
/home/grin/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel-1.4.0/Cargo.toml
The first part cannot be fixed since it's in the cargo-pulled config from diesel upstream:
$ cp /path/to/diesel/git/clone/examples/examples/sqlite/getting_started_step_2 /somewhere/out/of/git/repo/ -r
$ cd /somewhere/out/of/git/repo/
$ cargo build
works fine for me.
Alternatively change the root Cargo.toml in the cloned git repository to not contain diesel_tests as workspace member.
(I will fix that as soon as I've some time)
I don't get the second part, my rustc is 1.31.0.
There is certainly something wrong with your rustc setup and you are using a older cargo version, because that feature was stabilized in 1.31.
Turned out that debian uses a funky versioning: 0.31 contains 1.30.x, 0.32 contains 1.31.x cargo. Upgrading to 0.32 in fact upgraded cargo to 1.31 which in turn is able to build the sample.
Still, it won't work unless I move it out of the directory structure.
Thanks.
Seems to be resolved.
Most helpful comment
works fine for me.
Alternatively change the root Cargo.toml in the cloned git repository to not contain
diesel_testsas workspace member.(I will fix that as soon as I've some time)
There is certainly something wrong with your rustc setup and you are using a older cargo version, because that feature was stabilized in 1.31.