rustPlatform.importCargoLock: download crates from static.crates.io

The crates.io API server's 1 req/sec rate limit currently surfaces as
intermittent HTTP 403 errors when vendoring lockfiles. Switch to the CDN
endpoint as recommended by upstream (rust-lang/crates.io#13482), mirroring
the fix already applied to fetchCargoVendor in #512735.

fetchurl is content-addressed by sha256, so the URL change does not affect
any downstream store paths.

Fixes #524979
This commit is contained in:
Philip Taron
2026-05-27 12:47:02 -07:00
parent 07d762e6c7
commit f830e6112b

View File

@@ -130,7 +130,10 @@ let
};
registries = {
"https://github.com/rust-lang/crates.io-index" = "https://crates.io/api/v1/crates";
# Use static.crates.io (CDN) instead of crates.io/api to avoid the 1 req/sec
# rate limit on the API servers, which currently returns intermittent 403s.
# See https://github.com/rust-lang/crates.io/issues/13482
"https://github.com/rust-lang/crates.io-index" = "https://static.crates.io/crates";
}
// extraRegistries;