Diesel: examples/sqlite/getting_started_step_1 won't even start to compile

Created on 22 Jan 2019  路  6Comments  路  Source: diesel-rs/diesel

Setup

Versions

  • Rust: rustc 1.31.0
  • Diesel: -- (cannot resolve deps)
  • Database: --
  • Operating System Debian/sid

Feature Flags

  • diesel: (missing cargo-features = ["rename-dependency"])

Problem Description

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

Steps to reproduce

  • git clone repo
  • cd diesel/examples/sqlite/getting_started_step_1
  • cargo check
error: 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
  • start again
  • update Cargo.toml
  • cargo check
    And what's above is the output.

Checklist

  • [x] I have already looked over the issue tracker for similar issues.
  • [x] This issue can be reproduced on Rust's stable channel. (Your issue will be
    closed if this is not the case)

Most helpful comment

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.

All 6 comments

Correction, 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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

qmx picture qmx  路  3Comments

kanekv picture kanekv  路  3Comments

pwoolcoc picture pwoolcoc  路  3Comments

gliderkite picture gliderkite  路  3Comments

killercup picture killercup  路  4Comments