rustc: fix name when cross compiled

I made a mistake when trying to add the target prefix to Rust cross
compilers: pkgsCross.aarch64-multiplatform.rustc ended up being called
"aarch64-unknown-linux-gnu-rustc-aarch64-unknown-linux-gnu-1.69.0",
which is a bit verbose.

With this change:

	nix-repl> rustc.name
	"rustc-1.69.0"

	nix-repl> pkgsCross.aarch64-multiplatform.buildPackages.rustc.name
	"aarch64-unknown-linux-gnu-rustc-1.69.0"

	nix-repl> pkgsCross.aarch64-multiplatform.rustc.name
	"rustc-aarch64-unknown-linux-gnu-1.69.0"

As intended.

Fixes: 57e73d23bb ("rustc,rustPlatform.buildRustPackage: broaden platforms")
This commit is contained in:
Alyssa Ross 2023-05-09 17:44:54 +00:00
parent e840c93ea7
commit 454b2058d4
No known key found for this signature in database
GPG key ID: F9DBED4859B271C0

View file

@ -1,4 +1,4 @@
{ lib, stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget
{ lib, stdenv, removeReferencesTo, pkgsBuildBuild, pkgsBuildHost, pkgsBuildTarget, targetPackages
, llvmShared, llvmSharedForBuild, llvmSharedForHost, llvmSharedForTarget, llvmPackages
, fetchurl, file, python3
, darwin, cmake, rust, rustPlatform
@ -21,7 +21,7 @@ let
inherit (lib) optionals optional optionalString concatStringsSep;
inherit (darwin.apple_sdk.frameworks) Security;
in stdenv.mkDerivation rec {
pname = "${pkgsBuildTarget.targetPackages.stdenv.cc.targetPrefix}rustc";
pname = "${targetPackages.stdenv.cc.targetPrefix}rustc";
inherit version;
src = fetchurl {