From a37017ffd60c740c28ca3f524679173f7b80b3d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tom=20Houl=C3=A9?= Date: Tue, 4 Oct 2022 12:09:52 +0200 Subject: [PATCH] makeRustPlatform: inherit cargo in import-cargo-lock The main purpose of `makeRustPlatform` is to enable users to override the `rustc` and `cargo` versions used by the `rustPlatform` derivations. In all attributes of the result of `makeRustPlatform`, `rustc` and/or `cargo` are overriden, except in `importCargoLock`. I think this is an oversight / bug, and passing the received cargo derivation is the right behaviour. If `importCargoLock` always using the global cargo package even in `makeRustPlatform` is the intended behaviour, I think it should be documented at least in a comment. --- pkgs/development/compilers/rust/make-rust-platform.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/compilers/rust/make-rust-platform.nix b/pkgs/development/compilers/rust/make-rust-platform.nix index b859d01dc085..f210f8063cbd 100644 --- a/pkgs/development/compilers/rust/make-rust-platform.nix +++ b/pkgs/development/compilers/rust/make-rust-platform.nix @@ -18,7 +18,7 @@ rec { fetchCargoTarball importCargoLock rustc; }; - importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix {}; + importCargoLock = buildPackages.callPackage ../../../build-support/rust/import-cargo-lock.nix { inherit cargo; }; rustcSrc = callPackage ./rust-src.nix { inherit runCommand rustc;