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

dependency is listed only with -e normal,dev but not with -e normal or -e dev #14114

Open
themighty1 opened this issue Jun 20, 2024 · 5 comments
Labels
C-bug Category: bug Command-tree S-triage Status: This issue is waiting on initial triage.

Comments

@themighty1
Copy link

themighty1 commented Jun 20, 2024

Problem

The dependency is listed only when running cargo tree -e normal,dev. When running either cargo tree -e normal or cargo tree -e dev it is not listed.

Steps

To reproduce:

git clone https://github.com/tlsnotary/tlsn
cd tlsn/components/tls/tls-mpc/
git checkout 68b9474015b817255c226fec38e80addd16191d1
cargo tree -e normal,dev | grep mio
cargo tree -e normal | grep mio
cargo tree -e dev | grep mio

You will only see that the dependency was found on the first invocation of cargo tree but not found on the 2nd or the 3rd.

Possible Solution(s)

No response

Notes

No response

Version

cargo 1.79.0 (ffa9cf99a 2024-06-03)
release: 1.79.0
commit-hash: ffa9cf99a594e59032757403d4c780b46dc2c43a
commit-date: 2024-06-03
host: x86_64-unknown-linux-gnu
libgit2: 1.7.2 (sys:0.18.3 vendored)
libcurl: 8.6.0-DEV (sys:0.4.72+curl-8.6.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 22.4.0 (jammy) [64-bit]
@themighty1 themighty1 added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Jun 20, 2024
@epage
Copy link
Contributor

epage commented Jun 21, 2024

$ cargo tree -e normal,dev -i mio
mio v0.8.11
└── tokio v1.38.0
    ├── h2 v0.3.26
    │   └── hyper v0.14.29
    │       └── tls-server-fixture v0.0.0 (/home/epage/src/personal/dump/tlsn/components/tls/tls-server-fixture)
    │           [dev-dependencies]
    │           └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    ├── hyper v0.14.29 (*)
    ├── tls-server-fixture v0.0.0 (/home/epage/src/personal/dump/tlsn/components/tls/tls-server-fixture) (*)
    ├── tlsn-utils-aio v0.1.0 (https://github.com/tlsnotary/tlsn-utils?rev=51f313d#51f313d1)
    │   ├── mpz-garble v0.1.0 (https://github.com/privacy-scaling-explorations/mpz?rev=9f7403b#9f7403be)
    │   │   ├── tlsn-aead v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/aead)
    │   │   │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   │   ├── tlsn-block-cipher v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/cipher/block-cipher)
    │   │   │   ├── tlsn-aead v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/aead) (*)
    │   │   │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   │   ├── tlsn-hmac-sha256 v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/prf/hmac-sha256)
    │   │   │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   │   ├── tlsn-key-exchange v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/key-exchange)
    │   │   │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   │   ├── tlsn-stream-cipher v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/cipher/stream-cipher)
    │   │   │   ├── tlsn-aead v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/aead) (*)
    │   │   │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   ├── mpz-ot v0.1.0 (https://github.com/privacy-scaling-explorations/mpz?rev=9f7403b#9f7403be)
    │   │   ├── mpz-garble v0.1.0 (https://github.com/privacy-scaling-explorations/mpz?rev=9f7403b#9f7403be) (*)
    │   │   ├── mpz-share-conversion v0.1.0 (https://github.com/privacy-scaling-explorations/mpz?rev=9f7403b#9f7403be)
    │   │   │   ├── tlsn-point-addition v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/point-addition)
    │   │   │   │   ├── tlsn-key-exchange v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/key-exchange) (*)
    │   │   │   │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   │   │   ├── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   │   │   └── tlsn-universal-hash v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/universal-hash)
    │   │   │       ├── tlsn-aead v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/aead) (*)
    │   │   │       └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   │   └── tlsn-key-exchange v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/key-exchange) (*)
    │   │   [dev-dependencies]
    │   │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   ├── mpz-share-conversion v0.1.0 (https://github.com/privacy-scaling-explorations/mpz?rev=9f7403b#9f7403be) (*)
    │   ├── tlsn-aead v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/aead) (*)
    │   ├── tlsn-hmac-sha256 v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/prf/hmac-sha256) (*)
    │   ├── tlsn-key-exchange v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/key-exchange) (*)
    │   ├── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    │   └── uid-mux v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/uid-mux)
    │       [dev-dependencies]
    │       └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    └── tokio-util v0.7.11
        ├── h2 v0.3.26 (*)
        ├── tls-server-fixture v0.0.0 (/home/epage/src/personal/dump/tlsn/components/tls/tls-server-fixture) (*)
        ├── tlsn-tls-client-async v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-client-async)
        │   [dev-dependencies]
        │   └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
        └── tlsn-utils-aio v0.1.0 (https://github.com/tlsnotary/tlsn-utils?rev=51f313d#51f313d1) (*)
        [dev-dependencies]
        └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
    [dev-dependencies]
    └── tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)

@epage
Copy link
Contributor

epage commented Jun 21, 2024

mio is an optional dependency of tokio if net, process, or signal features are enabled

@epage
Copy link
Contributor

epage commented Jun 21, 2024

Helps if I look at the most basic output

cargo tree -e dev
tlsn-tls-mpc v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-mpc)
[dev-dependencies]
├── mpz-ot v0.1.0 (https://github.com/privacy-scaling-explorations/mpz?rev=9f7403b#9f7403be)
├── tls-server-fixture v0.0.0 (/home/epage/src/personal/dump/tlsn/components/tls/tls-server-fixture)
├── tlsn-tls-client v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-client)
├── tlsn-tls-client-async v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/tls/tls-client-async)
├── tokio v1.38.0
├── tokio-util v0.7.11
├── tracing-subscriber v0.3.18
└── uid-mux v0.1.0-alpha.5 (/home/epage/src/personal/dump/tlsn/components/uid-mux)

Notice that this doesn't go any deeper. It looks like -e dev doesn't show "what are my dependencies when I do a dev build" but include the dev edges". To see all of your dev-dependencies, you also have to look at their normal dependencies.

@themighty1
Copy link
Author

@epage , thanks for looking into this. I just want to make sure: are you confirming that this is a bug or is this the expected behaviour?

@themighty1
Copy link
Author

Note that if you run
cargo tree -e normal,dev,features | grep mio -A10 -B10
you will see this snippet

│   │   │   │       │   ├── tokio feature "default"
│   │   │   │       │   │   └── tokio v1.38.0
│   │   │   │       │   │       ├── mio v0.8.11

which shows that cargo thinks that mio is a dep of tokio with the default feature.
This is wrong - mio is an optional dep.

I don't know if this is a separate bug or whether it is related to this one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug Command-tree S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

2 participants