From 9861cf4a7f5f39f82878c7669232eb68eadf7f78 Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Wed, 22 Mar 2023 10:48:11 +1000 Subject: [PATCH] rustPlatform.fetchCargoTarball: use sparse protocol for crates.io --- pkgs/build-support/rust/fetch-cargo-tarball/default.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix index adbfe98d8103..8c6a97888c10 100644 --- a/pkgs/build-support/rust/fetch-cargo-tarball/default.nix +++ b/pkgs/build-support/rust/fetch-cargo-tarball/default.nix @@ -62,6 +62,10 @@ in stdenv.mkDerivation ({ export CARGO_HOME=$(mktemp -d cargo-home.XXX) CARGO_CONFIG=$(mktemp cargo-config.XXXX) + # https://blog.rust-lang.org/2023/03/09/Rust-1.68.0.html#cargos-sparse-protocol + # planned to become the default in 1.70 + export CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse + if [[ -n "$NIX_CRATES_INDEX" ]]; then cat >$CARGO_HOME/config.toml <