@@ -62,6 +62,7 @@ let
6262 then final.buildPackages.buildPackages.haskell-nix.compiler.ghc8107
6363 else final.buildPackages.buildPackages.haskell-nix.compiler.ghc884;
6464 latestVer = {
65+ "8.4" = "8.4.4";
6566 "8.6" = "8.6.5";
6667 "8.8" = "8.8.4";
6768 "8.10" = "8.10.7";
@@ -69,11 +70,18 @@ let
6970 "9.2" = "9.2.2";
7071 };
7172 traceWarnOld = v: x:
72− # There is no binary for aarch64-linux ghc 8.8.4 so don't warn about 8.8.3
73− if x.src-spec.version == "8.8.3" && (final.targetPlatform.isAarch64 || final.buildPlatform.isAarch64)
73+ let
74+ bootstrapGhc = final.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
75+ in
76+ if builtins.compareVersions x.src-spec.version bootstrapGhc.version < 0 then
77+ throw "Desired GHC (${x.src-spec.version}) is older than the bootstrap GHC (${bootstrapGhc.version}) for this platform (${final.targetPlatform.config})."
78+ # There is no binary for aarch64-linux ghc 8.8.4 so don't warn about 8.8.3 not being the latest version
79+ else if x.src-spec.version == "8.8.3" && (final.targetPlatform.isAarch64 || final.buildPlatform.isAarch64)
7480 then x
75− else __trace
76− "WARNING: ${x.src-spec.version} is out of date, consider using ${latestVer.${v}}." x;
81+ else if builtins.compareVersions x.src-spec.version latestVer.${v} < 0
82+ then __trace
83+ "WARNING: ${x.src-spec.version} is out of date, consider using ${latestVer.${v}}." x
84+ else x;
7785 errorOldGhcjs = v: up: throw "ghcjs ${v} is no longer supported by haskell.nix. Consider using ${latestVer.${up}}";
7886in {
7987 haskell-nix = prev.haskell-nix // {
@@ -213,7 +221,7 @@ in {
213221 ++ final.lib.optional (versionAtLeast "8.10" && versionLessThan "9.0" && final.targetPlatform.isAndroid) ./patches/ghc/android-base-needs-iconv.patch
214222 ;
215223 in ({
216− ghc844 = final.callPackage ../compiler/ghc {
224+ ghc844 = final.callPackage ../compiler/ghc (traceWarnOld "8.4" {
217225 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc844; };
218226
219227 inherit sphinx installDeps;
@@ -234,7 +242,7 @@ in {
234242 ghc-patches = ghc-patches "8.4.4"
235243 ++ [ hsc2hs-align-conditionals-patch D5123-patch ]
236244 ++ final.lib.optional final.stdenv.isDarwin ./patches/ghc/ghc-8.4.4-backport-dylib-command-size-limit.patch;
237− };
245+ });
238246 ghc861 = final.callPackage ../compiler/ghc (traceWarnOld "8.6" {
239247 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc861; };
240248
@@ -318,7 +326,7 @@ in {
318326 ghc-patches = ghc-patches "8.6.4"
319327 ++ [ D5123-patch ];
320328 });
321− ghc865 = final.callPackage ../compiler/ghc {
329+ ghc865 = final.callPackage ../compiler/ghc (traceWarnOld "8.6" {
322330 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc865; };
323331
324332 inherit sphinx installDeps;
@@ -338,7 +346,7 @@ in {
338346
339347 ghc-patches = ghc-patches "8.6.5"
340348 ++ [ D5123-patch haddock-900-patch ];
341− };
349+ });
342350 ghc881 = final.callPackage ../compiler/ghc (traceWarnOld "8.8" {
343351 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc881; };
344352
@@ -387,7 +395,7 @@ in {
387395
388396 ghc-patches = ghc-patches "8.8.3";
389397 });
390− ghc884 = final.callPackage ../compiler/ghc {
398+ ghc884 = final.callPackage ../compiler/ghc (traceWarnOld "8.8" {
391399 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc884; };
392400
393401 inherit bootPkgs sphinx installDeps;
@@ -402,7 +410,7 @@ in {
402410 };
403411
404412 ghc-patches = ghc-patches "8.8.4";
405− };
413+ });
406414 ghc8101 = final.callPackage ../compiler/ghc (traceWarnOld "8.10" {
407415 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc8101; };
408416
@@ -517,7 +525,7 @@ in {
517525
518526 ghc-patches = ghc-patches "8.10.6";
519527 });
520− ghc8107 = final.callPackage ../compiler/ghc {
528+ ghc8107 = final.callPackage ../compiler/ghc (traceWarnOld "8.10" {
521529 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc8107; };
522530
523531 bootPkgs = bootPkgs // {
@@ -535,8 +543,8 @@ in {
535543 };
536544
537545 ghc-patches = ghc-patches "8.10.7";
538− };
539− ghc901 = final.callPackage ../compiler/ghc {
546+ });
547+ ghc901 = final.callPackage ../compiler/ghc (traceWarnOld "9.0" {
540548 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc901; };
541549
542550 bootPkgs = bootPkgs // {
@@ -554,8 +562,8 @@ in {
554562 };
555563
556564 ghc-patches = ghc-patches "9.0.1";
557− };
558− ghc902 = final.callPackage ../compiler/ghc {
565+ });
566+ ghc902 = final.callPackage ../compiler/ghc (traceWarnOld "9.0" {
559567 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc902; };
560568
561569 bootPkgs = bootPkgs // {
@@ -573,8 +581,8 @@ in {
573581 };
574582
575583 ghc-patches = ghc-patches "9.0.2";
576− };
577− ghc921 = final.callPackage ../compiler/ghc {
584+ });
585+ ghc921 = final.callPackage ../compiler/ghc (traceWarnOld "9.2" {
578586 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc921; };
579587
580588 bootPkgs = bootPkgs // {
@@ -593,8 +601,8 @@ in {
593601 };
594602
595603 ghc-patches = ghc-patches "9.2.1";
596− };
597− ghc922 = final.callPackage ../compiler/ghc {
604+ });
605+ ghc922 = final.callPackage ../compiler/ghc (traceWarnOld "9.2" {
598606 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc922; };
599607
600608 bootPkgs = bootPkgs // {
@@ -613,7 +621,7 @@ in {
613621 };
614622
615623 ghc-patches = ghc-patches "9.2.2";
616− };
624+ });
617625 # ghc 8.10.4 with patches needed by plutus
618626 ghc810420210212 = final.callPackage ../compiler/ghc {
619627 extra-passthru = { buildGHC = final.buildPackages.haskell-nix.compiler.ghc810420210212; };