Rust 1.70.0, released on June 1, 2023, makes Cargo’s sparse protocol the default way to read the crates.io package index. Teams upgrading build machines need to check firewall access and budget for a fresh dependency download: restrictive firewalls must permit index.crates.io, and switching access methods changes the local crate-cache path. The Rust release team warns that dependencies will be downloaded again. [S1]

The change reduces how much index information Cargo retrieves. Under the previous Git protocol, Cargo cloned a repository indexing every crate in the registry. Sparse access downloads information only about the crates being used. Rust’s March 9 announcement had already stabilized the protocol in version 1.68.0, but crates.io users still had to opt in. Version 1.70 changes the default. The release team expects faster index fetching; that is not a measurement of how much faster a particular application will compile. [S1][S2]

The network check belongs on the build machine. The June announcement identifies https://index.crates.io as the address that restrictive firewalls must allow. A practical upgrade check is to try dependency retrieval from a representative continuous-integration runner—the machine performing automated builds—rather than infer readiness from a developer laptop. Installing the compiler does not itself test whether that runner can reach the new index. [S1]

The first fetch also needs a fair comparison. Because the new access method uses a different crate-cache path, the release team says dependencies will be downloaded anew. Comparing an old build with a populated cache against a first build using the new cache would mix the protocol change with that download cost. For a build owner evaluating the upgrade, the useful distinction is initial cache population versus subsequent runs, not simply old compiler versus new compiler. This is a testing consideration, not a reported benchmark. [S1][S2]

A fallback remains available. The registries.crates-io.protocol configuration setting can retain the previous GitHub-hosted Git index, according to the June announcement. A team can therefore upgrade its toolchain while keeping the old index route until it resolves network constraints. There is no need to make cache cleanup part of the same switch: the Rust team suggests removing the old GitHub-associated registry-cache paths only after fully committing to sparse access. [S1]

Source documents

  1. Announcing Rust 1.70.0https://blog.rust-lang.org/2023/06/01/Rust-1.70.0/
  2. Announcing Rust 1.68.0https://blog.rust-lang.org/2023/03/09/Rust-1.68.0/