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 metadata --no-deps includes all packages in the workspace #7893

Closed
sfackler opened this issue Feb 17, 2020 · 3 comments · Fixed by #7927
Closed

cargo metadata --no-deps includes all packages in the workspace #7893

sfackler opened this issue Feb 17, 2020 · 3 comments · Fixed by #7927
Labels

Comments

@sfackler
Copy link
Member

Problem

The --no-deps flag of cargo-metadata is documented as such

        --no-deps                     Output information only about the root package and don't fetch dependencies

From that, I would expect that the output would only include a single package. However, when run in a workspace, information about all packages in the workspace is output.

Steps

  1. Find a workspace with multiple packages.
  2. Run cargo metadata --no-deps --format-version 1
  3. Observe multiple packages in output

Notes

Output of cargo version: cargo 1.41.0 (626f0f40e 2019-12-03)

@sfackler sfackler added the C-bug Category: bug label Feb 17, 2020
@ehuss
Copy link
Contributor

ehuss commented Feb 17, 2020

Would you be OK with just updating the help page? I don't think it's something we can change. Does it cause a problem in some way?

@sfackler
Copy link
Member Author

Ideally there'd be a better way of using cargo-metadata with crate-oriented operations, but minimally the help docs should say how it behaves here.

@ehuss
Copy link
Contributor

ehuss commented Feb 25, 2020

I filed #7927 as a simple doc fix. As for the way cargo metadata handles the "current" package, I agree it is limiting and confusing. I think #4018 and #7754 cover that problem, though.

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

Successfully merging a pull request may close this issue.

2 participants