Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cargo tree not showing a package #11444

Closed
xphoniex opened this issue Nov 30, 2022 · 5 comments
Closed

cargo tree not showing a package #11444

xphoniex opened this issue Nov 30, 2022 · 5 comments
Labels
C-bug Category: bug

Comments

@xphoniex
Copy link

Problem

In my Cargo.lock, there is a package called bitvec (and the workspace depends on two versions of it):

[[package]]
name = "parity-scale-codec"
version = "3.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "366e44391a8af4cfd6002ef6ba072bae071a96aafca98d7d448a34c5dca38b6a"
dependencies = [
 "arrayvec 0.7.2",
 "bitvec 1.0.1",
 "byte-slice-cast",
 "impl-trait-for-tuples",
 "parity-scale-codec-derive",
 "serde",
]

But when I run cargo tree even with extra stuff like --workspace --no-dedupe --all-features:

│   ├── ethabi v18.0.0
...
│   │   │   │   │   └── parity-scale-codec v3.2.1
│   │   │   │   │       ├── arrayvec v0.7.2
│   │   │   │   │       ├── byte-slice-cast v1.2.2
│   │   │   │   │       ├── impl-trait-for-tuples v0.2.2 (proc-macro)
...
│   │   │   │   │       ├── parity-scale-codec-derive v3.1.3 (proc-macro)
...
│   │   │   │   │       └── serde v1.0.148 (*)

where is bitvec 1.0.1 ?

Steps

No response

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.65.0 (4bc8f24d3 2022-10-20)
release: 1.65.0
commit-hash: 4bc8f24d3e899462e43621aab981f6383a370365
commit-date: 2022-10-20
host: x86_64-unknown-linux-gnu
libgit2: 1.5.0 (sys:0.15.0 vendored)
libcurl: 7.83.1-DEV (sys:0.4.55+curl-7.83.1 vendored ssl:OpenSSL/1.1.1q)
os: Ubuntu 22.04 (jammy) [64-bit]
@xphoniex xphoniex added the C-bug Category: bug label Nov 30, 2022
@ehuss
Copy link
Contributor

ehuss commented Nov 30, 2022

It's hard to say without knowing all the dependencies you have, but I would suspect it is #10801. When there is a weak dependency (like bitvec?/std), the dependency resolver has to assume that bitvec might be enabled. There is a separate pass that then does feature resolution, which may decide that in the end it isn't enabled. But the lock file is built based on the first pass (the dependency resolver).

@ehuss
Copy link
Contributor

ehuss commented Dec 11, 2022

Without more information, I'm going to close assuming this is #10801. Another possibility is that the dependency is only used on a particular platform. By default cargo tree only shows dependencies for the host target (--target all can be used to show all platforms).

If it looks like it might be something else, feel free to reopen if you can provide a reproduction that we could look at.

@ehuss ehuss closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2022
@xphoniex
Copy link
Author

xphoniex commented Dec 11, 2022

You can clone this repo currently @ e7f2637, and:

$ cat Cargo.lock | grep bitvec
name = "bitvec"
name = "bitvec"
 "bitvec 0.19.6",
 "bitvec 1.0.1",

but

$ cargo tree --workspace --no-dedupe --all-features | grep bitvec
│   │   ├── bitvec v0.19.6

@ehuss
Copy link
Contributor

ehuss commented Dec 11, 2022

Indeed parity-scale-codec has a feature with bitvec?/std, but nothing enables it. So I think it is #10801.

@xphoniex
Copy link
Author

Thanks for clarification.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

2 participants