dhuseby / cargo-bootstrap

Bootstrapping script for Rust Cargo when cross-compilation is difficult or impossible.
BSD 2-Clause "Simplified" License
37 stars 9 forks source link

Add a --no-download flag to avoid fetching crates #7

Closed stevenjm closed 9 years ago

stevenjm commented 9 years ago

In theory, cargo-bootstrap would previously have worked in no-download mode, as long as all of the versions installed are the latest versions in the crates index. For use in a networkless environment, or a package build system that needs to be usable without networking, it's sometimes useful to have a set of pre-downloaded crates that satisfy dependencies without being the latest versions available.

This commit adds a --no-download flag which forces cargo-bootstrap to look only for locally downloaded versions of crates, and fail if a dependency cannot be resolved that way.

stevenjm commented 9 years ago

I've realised that this implementation is actually incomplete. In particular, it doesn't verify that the version available actually satisfies the required version range. I'll open a new PR once I've polished the patch a bit more.