about summary refs log tree commit diff
path: root/pkgs/development/compilers/rust
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2023-05-12 14:17:32 +0000
committerAlyssa Ross <hi@alyssa.is>2023-05-12 15:31:21 +0000
commit46cb0eb1a950a3032fa1236cd747137e623ca936 (patch)
tree814b98b1f4561fabddde6a8d93fd74f08bfa9180 /pkgs/development/compilers/rust
parent5e06b3cb197047072fc25e0eb1a507bbd7bf847e (diff)
downloadnixlib-46cb0eb1a950a3032fa1236cd747137e623ca936.tar
nixlib-46cb0eb1a950a3032fa1236cd747137e623ca936.tar.gz
nixlib-46cb0eb1a950a3032fa1236cd747137e623ca936.tar.bz2
nixlib-46cb0eb1a950a3032fa1236cd747137e623ca936.tar.lz
nixlib-46cb0eb1a950a3032fa1236cd747137e623ca936.tar.xz
nixlib-46cb0eb1a950a3032fa1236cd747137e623ca936.tar.zst
nixlib-46cb0eb1a950a3032fa1236cd747137e623ca936.zip
rustPlatform.rust: deprecate
It is almost never correct to use these attributes, because they don't
work correctly with splicing.  Compare:

	% nix repl -f . --argstr crossSystem aarch64-linux
	Welcome to Nix 2.10.3. Type :? for help.

	Loading installable ''...
	Added 18988 variables.
	nix-repl> callPackage ({ stdenv, rustc }: (stdenv.mkDerivation { name = ""; nativeBuildInputs = [ rustc ]; }).nativeBuildInputs) {}
	«derivation /nix/store/bjrkg8kcq3hvg5kb03ivb856zy91qpbk-aarch64-unknown-linux-gnu-rustc-1.69.0.drv» ]

	nix-repl> callPackage ({ stdenv, rustPlatform }: (stdenv.mkDerivation { name = ""; nativeBuildInputs = [ rustPlatform.rust.rustc ]; }).nativeBuildInputs) {}
	«derivation /nix/store/ra5r07j52y7akclr827r3dzxzvqnvfbl-rustc-1.69.0.drv» ]

I'm not sure this is fixable.  I don't think it's worth keeping them
around considering we have top level attributes.  It makes overriding
slightly more annoying, but only slightly.
Diffstat (limited to 'pkgs/development/compilers/rust')
-rw-r--r--pkgs/development/compilers/rust/make-rust-platform.nix5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkgs/development/compilers/rust/make-rust-platform.nix b/pkgs/development/compilers/rust/make-rust-platform.nix
index d4f3e4b08fbf..e22cb6d594af 100644
--- a/pkgs/development/compilers/rust/make-rust-platform.nix
+++ b/pkgs/development/compilers/rust/make-rust-platform.nix
@@ -1,4 +1,4 @@
-{ buildPackages, callPackage, cargo-auditable, stdenv, runCommand }@prev:
+{ lib, buildPackages, callPackage, cargo-auditable, stdenv, runCommand }@prev:
 
 { rustc
 , cargo
@@ -9,7 +9,8 @@
 
 rec {
   rust = {
-    inherit rustc cargo;
+    rustc = lib.warn "rustPlatform.rust.rustc is deprecated. Use rustc instead." rustc;
+    cargo = lib.warn "rustPlatform.rust.cargo is deprecated. Use cargo instead." cargo;
   };
 
   fetchCargoTarball = buildPackages.callPackage ../../../build-support/rust/fetch-cargo-tarball {