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

Make cargo metadata --no-deps print all path deps (including other workspaces) #9024

wants to merge 2 commits into
base: master
Choose a base branch


Copy link

Yet another solution to #7483. (See also #8988, #8994.)

This solution avoids users to get all the information they need with a single cargo invocation, rather than having to recursively call cargo themselves.

The first commit implements the functionality, and the second speeds it up to the point of feasibility, at the cost of some code complexity.

Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 29, 2020
Including those outside the current workspace.

This allows for finding all local code without having to recursively
call Cargo, which is useful for rustfmt and other tools.

Fixes: rust-lang#7483
Workspace::new is very expensive.  Doing it over and over again like
the initial implementation made cargo metadata --no-deps take several
minutes in a big workspace.  By only calling Workspace::new once per
workspace, we can save a lot of time.  Now the same command in the
same workspace takes only 0.16 seconds.
Copy link

ehuss commented Jan 6, 2021

Thanks for the PR! We discussed this in the team meeting, and decided to move forward with #8994 for now, and to put this on hold. There are some concerns noted in #8994 (comment) that this may not be so straightforward. @alyssais will #8994 address what you are interested in? I'm fine with leaving this PR open for now if you'd like, until we have more experience with #8994 to see how the performance is.

Copy link

alyssais commented Jan 6, 2021 via email

Copy link

andir commented Apr 13, 2021

I've just run into a problem that is very similar to what @alyssais solved with this PR. Do you have any thoughts regarding rethinking the decision you took here?

I also want to known the path of a given workspace member within a hermetic build.

Copy link

bors commented Jan 12, 2022

The latest upstream changes (presumably #10269) made this pull request unmergeable. Please resolve the merge conflicts.

@alexcrichton alexcrichton removed their assignment Mar 8, 2022
Copy link

yerke commented Jan 12, 2023

Since #8994 has landed, I think this PR can be closed.

Copy link

alyssais commented Feb 4, 2023

Since #8994 has landed, I think this PR can be closed.

As I've already explained at great length, #8994 does not fully solve the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
None yet

Successfully merging this pull request may close these issues.

None yet

7 participants