Skip to content

Add cargo-metadata crate. #3176

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

Closed
wants to merge 1 commit into from
Closed

Add cargo-metadata crate. #3176

wants to merge 1 commit into from

Conversation

ahmedcharles
Copy link

This allows parsing the result of cargo metadata without having to
implement the json serialization in each caller, independently.

This is intended to be used by: rust-lang/rust#36032

This is the bare minimum required to implement the functionality required by rustc's bootstrap to determine the transitive dependency closure. Obviously, it would be nice if this were more fully featured. I initially tried copying the implementations from cargo with the intent of having cargo depend on this crate through a path dependency, just like it does with crates-io. However, this ended up being non-trivial, so I decided to limit the scope and start from scratch. Any thoughts on whether that would be a worthwhile approach (likely longer term)?

@rust-highfive
Copy link

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @brson (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.

@ahmedcharles
Copy link
Author

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned brson Oct 7, 2016
@alexcrichton
Copy link
Member

Thanks for the PR! I wouldn't mind including this, but how about we hook up the tests to literally the output of cargo metadata itself? That is, we could make this a dev-dependency of Cargo itself, and then modify tests/metadata.rs to exercise this crate?

This allows parsing the result of `cargo metadata` without having to
implement the json serialization in each caller, independently.
@alexcrichton
Copy link
Member

ping @ahmedcharles, any update on avoiding vendoring the json and using the output of a literal execution of cargo metadata instead?

@ahmedcharles
Copy link
Author

Sorry, I've gotten busy and won't be able to work on this soon.

@alexcrichton
Copy link
Member

Ah ok, no worries! I'm going to close this for now to help clear out the queue, but feel free to resubmit!

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

Successfully merging this pull request may close these issues.

4 participants