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

Consider using cargo_metadata instead of cargo crate #76

Open
malbarbo opened this issue Sep 27, 2017 · 5 comments
Open

Consider using cargo_metadata instead of cargo crate #76

malbarbo opened this issue Sep 27, 2017 · 5 comments

Comments

@malbarbo
Copy link

It take too long to compile cargo. An alternative is to use cargo_metadata, which offers an api over the cargo metadata command.

@Frederick888
Copy link
Collaborator

As cargo-outdated is supposed to be merged into cargo ultimately in the future, I don't think this would be an appropriate action to take.

@WiSaGaN
Copy link

WiSaGaN commented Dec 8, 2017

@Frederick888 any tracking issue for this incorporation?

@Frederick888
Copy link
Collaborator

@WiSaGaN rust-lang/cargo#4309

But even if we put this issue aside, since cargo-outdated has used too many cargo functions, e.g. resolving dependencies, updating various sources, querying crates.io registry, etc, etc, it's just too expensive to duplicate all of these.

@matklad
Copy link

matklad commented Feb 3, 2019

Note that there's https://github.com/theduke/crates_io_api for querying crates.io API.

So it seems to me that it should not be significantly harder to avoid depending on Cargo? Specifically:

  • call cargo-metadata to learn about project structure and dependencies.
  • call crates_io_api to figure out about newer major versions
  • do a "create temp workspace" trick, but run cargo metadata on the workspace as a subprocess, to simulate cargo update.

@kornelski
Copy link
Collaborator

It'd be ideal if Cargo exposed its dependency resolution algorithm as a library. Then even the "temp workspace" hack wouldn't be needed — cargo-outdated could read and evaluate data straight from the API.

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

No branches or pull requests

5 participants