Skip to content
This repository has been archived by the owner on Jun 5, 2020. It is now read-only.

cargo dependency rename breaks cargo-tree #38

Closed
dekellum opened this issue Jun 1, 2018 · 7 comments
Closed

cargo dependency rename breaks cargo-tree #38

dekellum opened this issue Jun 1, 2018 · 7 comments

Comments

@dekellum
Copy link

dekellum commented Jun 1, 2018

Using the feature of rust-lang/cargo#4953 to rename a dependency in order to use parts from two versions of same crate, results in the following error when attempting to use cargo tree:

error: failed to parse manifest at /home/david/src/bar/Cargo.toml

Caused by:
Dependency 'foo' has different source paths depending on the build target. Each
dependency must have a single canonical source path irrespective of build target.

This is of course an interesting case to want to see the dependency tree and check duplicates!

I will share an actual Cargo.toml that exhibits the problem, shortly.

@dekellum
Copy link
Author

dekellum commented Jun 1, 2018

A Cargo.toml that demonstrates the problem is here: dekellum/body-image/Cargo.toml#L42

I didn't end up going with this renaming solution for reasons including that the cargo feature is only available in nightly:

error: failed to parse manifest at /home/travis/build/dekellum/body-image/Cargo.toml
Caused by:
the cargo feature rename-dependency requires a nightly version of Cargo, but this is the stable channel

@dekellum
Copy link
Author

dekellum commented Jun 1, 2018

Oh and forgot to mention, this problem is exhibitted with:

cargo-tree 0.18.0
rustc 1.28.0-nightly (990d8aa74 2018-05-25)
cargo 1.28.0-nightly (f352115d5 2018-05-15)

@sfackler
Copy link
Owner

sfackler commented Jun 4, 2018

Can cargo build the project?

@dekellum
Copy link
Author

dekellum commented Jun 4, 2018

yes.

@sfackler
Copy link
Owner

sfackler commented Jun 4, 2018

This probably has the same cause as #27 - we're talking to cargo the wrong way. #20 is the "right" way of fixing this. I spent a while trying to get patch to work and never did :(

@ErichDonGubler
Copy link

Since #20 is merged (and #27) is closed, can this be closed too?

@dekellum
Copy link
Author

Yes, in short I have updated to cargo-tree 0.29.0. If I check out the exact same tree as the repro link I reported above, the failure no longer happens. Thanks!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants