I’m trying to run Cargo programmatically against crates I’ve downloaded. Since a project might have/distribute multiple crates and single crates are downloaded, I could use some advice on the following:
Is there any API that will automatically resolve path dependencies that don’t exist on the file system by falling back to the crates registry as a source? Hope for this comes from the [documentation] (http://doc.crates.io/specifying-dependencies.html#specifying-path-dependencies). Crates that have been uploaded to crates.io are guaranteed to have a version associated with them.
If not, is it possible/easy to build a “fake” manifest/package that replaces the the path dependency with a registry dependency?
Is this a ridiculous thing to try to attempt and going against the Rust philosophy?
It turns out replacements must have specific versions and not version requirements (e.g. >= 1.0.0). This wasn’t going to do the trick for me. So I recreated the entire Package + Manifest + Summary with a new set of dependencies with the path dependencies replaced by registry backed dependencies.
Not quite, but you can programmaticaly construct a package with dependencies whose source is crates.io (just ignoring the path parameter), and then it'll pull them all from crates.io. This is how cargo package works.