From f830e6112b4dbdb98cb7668cd291ea07ffc288e8 Mon Sep 17 00:00:00 2001 From: Philip Taron Date: Wed, 27 May 2026 12:47:02 -0700 Subject: [PATCH] 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 --- pkgs/build-support/rust/import-cargo-lock.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkgs/build-support/rust/import-cargo-lock.nix b/pkgs/build-support/rust/import-cargo-lock.nix index 9c172c7842f8..e9ebedfe98a4 100644 --- a/pkgs/build-support/rust/import-cargo-lock.nix +++ b/pkgs/build-support/rust/import-cargo-lock.nix @@ -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;