git.iko.soy/typeable/nixpkgs
on master help sign in
stdenv/linux: use isCompatible to find bootstrap tools

This avoids part of the issue where things like armv7a don’t work because the system doesn’t realize it can use the armv7l bootstrap tools.

commitdd584d8eeb8c76d82cbac50ace0f7a08586a31e9 authorMatthew Bauer <mjbauer95@gmail.com> dateWed 10 Apr 2019, 18:38 (8 years ago) parent59bb1dc
2 files changed+17−3
pkgs/stdenv/default.nix+6 pkgs/stdenv/linux/default.nix+11−3
pkgs/stdenv/default.nix+6
@@ -43,8 +43,14 @@ in
4343 "x86_64-linux" = stagesLinux;
4444 "armv5tel-linux" = stagesLinux;
4545 "armv6l-linux" = stagesLinux;
46+ "armv6m-linux" = stagesLinux;
4647 "armv7a-linux" = stagesLinux;
4748 "armv7l-linux" = stagesLinux;
49+ "armv7r-linux" = stagesLinux;
50+ "armv7m-linux" = stagesLinux;
51+ "armv8a-linux" = stagesLinux;
52+ "armv8r-linux" = stagesLinux;
53+ "armv8m-linux" = stagesLinux;
4854 "aarch64-linux" = stagesLinux;
4955 "mipsel-linux" = stagesLinux;
5056 "powerpc-linux" = /* stagesLinux */ stagesNative;
pkgs/stdenv/linux/default.nix+11−3
@@ -13,7 +13,6 @@
1313 "x86_64-linux" = import ./bootstrap-files/x86_64.nix;
1414 "armv5tel-linux" = import ./bootstrap-files/armv5tel.nix;
1515 "armv6l-linux" = import ./bootstrap-files/armv6l.nix;
16− "armv7a-linux" = import ./bootstrap-files/armv7l.nix;
1716 "armv7l-linux" = import ./bootstrap-files/armv7l.nix;
1817 "aarch64-linux" = import ./bootstrap-files/aarch64.nix;
1918 "mipsel-linux" = import ./bootstrap-files/loongson2f.nix;
@@ -26,10 +25,19 @@
2625 "powerpc64le-linux" = import ./bootstrap-files/ppc64le-musl.nix;
2726 };
2827 };
28+
29+ # Try to find an architecture compatible with our current system. We
30+ # just try every bootstrap we’ve got and test to see if it is
31+ # compatible with or current architecture.
32+ getCompatibleTools = lib.foldl (v: system:
33+ if v != null then v
34+ else if localSystem.isCompatible (lib.systems.elaborate { inherit system; }) then archLookupTable.${system}
35+ else null) null (lib.attrNames archLookupTable);
36+
2937 archLookupTable = table.${localSystem.libc}
3038 or (abort "unsupported libc for the pure Linux stdenv");
31− files = archLookupTable.${localSystem.system}
32− or (abort "unsupported platform for the pure Linux stdenv");
39+ files = archLookupTable.${localSystem.system} or (if getCompatibleTools != null then getCompatibleTools
40+ else (abort "unsupported platform for the pure Linux stdenv"));
3341 in files
3442}:
3543