From c0085404bd9dd6721eed9b6a5a36a310ca31b286 Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Sun, 10 Apr 2022 01:59:20 -0700 Subject: lib/systems/inspect.nix: remove isPowerPC Very confusingly, the `isPowerPC` predicate in `lib/systems/inspect.nix` does *not* match `powerpc64le`! This is because `isPowerPC` is defined as isPowerPC = { cpu = cpuTypes.powerpc; }; Where `cpuTypes.powerpc` is: { bits = 32; significantByte = bigEndian; family = "power"; }; This means that the `isPowerPC` predicate actually only matches the subset of machines marketed under this name which happen to be 32-bit and running in big-endian mode which is equivalent to: with stdenv.hostPlatform; isPower && isBigEndian && is32bit This seems like a sharp edge that people could easily cut themselves on. In fact, that has already happened: in `linux/kernel/common-config.nix` there is a test which will always fail: (stdenv.hostPlatform.isPowerPC && stdenv.hostPlatform.is64bit) A more subtle case of the strict isPowerPC being used instead of the moreg general isPower accidentally are the GHC expressions: Update pkgs/development/compilers/ghc/8.10.7.nix Update pkgs/development/compilers/ghc/8.8.4.nix Update pkgs/development/compilers/ghc/9.2.2.nix Update pkgs/development/compilers/ghc/9.0.2.nix Update pkgs/development/compilers/ghc/head.nix Since the remaining legitimate use sites of isPowerPC are so few, remove the isPowerPC predicate completely. The alternative expression above is noted in the release notes as an alternative. Co-authored-by: sternenseemann --- pkgs/development/compilers/ghc/9.0.2.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pkgs/development/compilers/ghc/9.0.2.nix') diff --git a/pkgs/development/compilers/ghc/9.0.2.nix b/pkgs/development/compilers/ghc/9.0.2.nix index a4cefe7294d..6de0f201599 100644 --- a/pkgs/development/compilers/ghc/9.0.2.nix +++ b/pkgs/development/compilers/ghc/9.0.2.nix @@ -14,7 +14,7 @@ libffi ? null , useLLVM ? !(stdenv.targetPlatform.isx86 - || stdenv.targetPlatform.isPowerPC + || stdenv.targetPlatform.isPower || stdenv.targetPlatform.isSparc) , # LLVM is conceptually a run-time-only depedendency, but for # non-x86, we need LLVM to bootstrap later stages, so it becomes a -- cgit 1.4.1