@@ -439,7 +439,7 @@ rec {
439
439
{
440
440
name = "libc" ;
441
441
packageId = "libc" ;
442
- target = { target , features } : ( pkgs . rust . lib . toRustTarget stdenv . hostPlatform == "aarch64-linux-android" ) ;
442
+ target = { target , features } : ( stdenv . hostPlatform . rust . rustcTarget == "aarch64-linux-android" ) ;
443
443
}
444
444
{
445
445
name = "libc" ;
@@ -470,11 +470,7 @@ rec {
470
470
requiredFeatures = [ ] ;
471
471
}
472
472
] ;
473
- # We can't filter paths with references in Nix 2.4
474
- # See https://github.com/NixOS/nix/issues/5410
475
- src = if ( ( lib . versionOlder builtins . nixVersion "2.4pre20211007" ) || ( lib . versionOlder "2.5" builtins . nixVersion ) )
476
- then lib . cleanSourceWith { filter = sourceFilter ; src = ./. ; }
477
- else ./. ;
473
+ src = lib . cleanSourceWith { filter = sourceFilter ; src = ./. ; } ;
478
474
authors = [
479
475
"Peter Kolloch <[email protected] >"
480
476
] ;
@@ -2695,12 +2691,12 @@ rec {
2695
2691
{
2696
2692
name = "winapi-i686-pc-windows-gnu" ;
2697
2693
packageId = "winapi-i686-pc-windows-gnu" ;
2698
- target = { target , features } : ( pkgs . rust . lib . toRustTarget stdenv . hostPlatform == "i686-pc-windows-gnu" ) ;
2694
+ target = { target , features } : ( stdenv . hostPlatform . rust . rustcTarget == "i686-pc-windows-gnu" ) ;
2699
2695
}
2700
2696
{
2701
2697
name = "winapi-x86_64-pc-windows-gnu" ;
2702
2698
packageId = "winapi-x86_64-pc-windows-gnu" ;
2703
- target = { target , features } : ( pkgs . rust . lib . toRustTarget stdenv . hostPlatform == "x86_64-pc-windows-gnu" ) ;
2699
+ target = { target , features } : ( stdenv . hostPlatform . rust . rustcTarget == "x86_64-pc-windows-gnu" ) ;
2704
2700
}
2705
2701
] ;
2706
2702
features = {
@@ -2783,14 +2779,11 @@ rec {
2783
2779
fuchsia = true ;
2784
2780
test = false ;
2785
2781
2786
- /* We are choosing an arbitrary rust version to grab `lib` from,
2787
- which is unfortunate, but `lib` has been version-agnostic the
2788
- whole time so this is good enough for now.
2789
- */
2790
- os = pkgs . rust . lib . toTargetOs platform ;
2791
- arch = pkgs . rust . lib . toTargetArch platform ;
2792
- family = pkgs . rust . lib . toTargetFamily platform ;
2793
- vendor = pkgs . rust . lib . toTargetVendor platform ;
2782
+ inherit ( platform . rust . platform )
2783
+ arch
2784
+ os
2785
+ vendor ;
2786
+ family = platform . rust . platform . target-family ;
2794
2787
env = "gnu" ;
2795
2788
endian =
2796
2789
if platform . parsed . cpu . significantByte . name == "littleEndian"
@@ -3033,7 +3026,7 @@ rec {
3033
3026
let
3034
3027
self = {
3035
3028
crates = lib . mapAttrs ( packageId : value : buildByPackageIdForPkgsImpl self pkgs packageId ) crateConfigs ;
3036
- target = makeTarget pkgs . stdenv . hostPlatform ;
3029
+ target = makeTarget stdenv . hostPlatform ;
3037
3030
build = mkBuiltByPackageIdByPkgs pkgs . buildPackages ;
3038
3031
} ;
3039
3032
in
@@ -3108,8 +3101,6 @@ rec {
3108
3101
buildRustCrateForPkgsFunc pkgs
3109
3102
(
3110
3103
crateConfig // {
3111
- # https://github.com/NixOS/nixpkgs/issues/218712
3112
- dontStrip = stdenv . hostPlatform . isDarwin ;
3113
3104
src = crateConfig . src or (
3114
3105
pkgs . fetchurl rec {
3115
3106
name = "${ crateConfig . crateName } -${ crateConfig . version } .tar.gz" ;
0 commit comments