Does Rust support non-internet connected compilation?

The Rust documentation states that crates can

depend on other libraries from crates.io, git repositories, or subdirectories on your local file system.

What happens if I need to develop in an environment where there is no internet connection (for example, because a corporate proxy restricts external network access)? Is this method of operation supported? In a JVM world, I might have some form of Nexus proxy to MavenCentral. Is there a Rust equivalent best-practice mechanism for accessing dependencies?

1 Like

There's --frozen Cargo flag that forbids Internet access during compilation. It requires everything to be cached and Cargo.lock to refer only to crates that have already been downloaded and cached.

There's cargo-vendor that lets you make a copy of all your dependencies in case you want to send them in a bottle to a deserted island.

7 Likes