on iko/ghcjs-patch-master help sign in
Fix arm cross compilation with ghc 8.6.5 (#654)
80e0e61Hamish Mackenzie
materialized/bootstrap/alex/.plan.nix/alex.nix → materialized/bootstrap/ghc844/alex/.plan.nix/alex.nixrenamed

The content is the same.

materialized/bootstrap/alex/default.nix → materialized/bootstrap/ghc844/alex/default.nixrenamed

The content is the same.

materialized/bootstrap/happy/.plan.nix/happy.nix → materialized/bootstrap/ghc844/happy-1.19.11/.plan.nix/happy.nixrenamed

The content is the same.

materialized/bootstrap/happy/default.nix → materialized/bootstrap/ghc844/happy-1.19.11/default.nixrenamed

The content is the same.

materialized/bootstrap/hscolour/.plan.nix/hscolour.nix → materialized/bootstrap/ghc844/hscolour/.plan.nix/hscolour.nixrenamed

The content is the same.

materialized/bootstrap/hscolour/default.nix → materialized/bootstrap/ghc844/hscolour/default.nixrenamed+2−1
@@ -1,3 +1,4 @@
1+
1{
2{
2 pkgs = hackage:
3 pkgs = hackage:
3 {
4 {
@@ -30,4 +31,4 @@
30 ({ lib, ... }:
31 ({ lib, ... }:
31 { packages = { "hscolour" = { flags = {}; }; }; })
32 { packages = { "hscolour" = { flags = {}; }; }; })
32 ];
33 ];
33− }
34+ }
nix-tools/regenerate.nix+1−1
@@ -55,7 +55,7 @@ in
55 ];
55 ];
56 }];
56 }];
57 }).nix-tools.components.exes.plan-to-nix;
57 }).nix-tools.components.exes.plan-to-nix;
58− bootstrap = if pkgs.targetPlatform.isAarch64
58+ bootstrap = if pkgs.targetPlatform.isAarch64 && pkgs.buildPlatform.isAarch64
59 then haskell-nix.bootstrap.compiler.ghc882
59 then haskell-nix.bootstrap.compiler.ghc882
60 else haskell-nix.bootstrap.compiler.ghc844;
60 else haskell-nix.bootstrap.compiler.ghc844;
61 in
61 in
overlays/bootstrap.nix+13−16
@@ -32,26 +32,21 @@ let
32 # - What GHC version we should use for bootstrapping.
32 # - What GHC version we should use for bootstrapping.
33 # - What Happy version we should use for bootstrapping.
33 # - What Happy version we should use for bootstrapping.
34 buildBootstrapper =
34 buildBootstrapper =
35− if final.targetPlatform.isAarch64
35+ if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
36 then {
36 then {
37− ghc = final.buildPackages.haskell-nix.bootstrap.compiler.ghc882;
37+ compilerNixName = "ghc882";
38 happyVersion = "1.19.12";
38 happyVersion = "1.19.12";
39 }
39 }
40 else {
40 else {
41− ghc = final.buildPackages.haskell-nix.bootstrap.compiler.ghc844;
41+ compilerNixName = "ghc844";
42 happyVersion = "1.19.11";
42 happyVersion = "1.19.11";
43 };
43 };
44− # For buildPackages.buildPackages, we just care about the GHC version:
45− buildBuildBootstrapper =
46− if final.targetPlatform.isAarch64
47− then final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler.ghc882
48− else final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler.ghc844;
49in {
44in {
50 haskell-nix = prev.haskell-nix // {
45 haskell-nix = prev.haskell-nix // {
51 # Use this to disable the existing haskell infra structure for testing purposes
46 # Use this to disable the existing haskell infra structure for testing purposes
52 compiler =
47 compiler =
53 let bootPkgs = with final.buildPackages; {
48 let bootPkgs = with final.buildPackages; {
54− ghc = buildBuildBootstrapper;
49+ ghc = final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
55 alex = final.haskell-nix.bootstrap.packages.alex-tool {
50 alex = final.haskell-nix.bootstrap.packages.alex-tool {
56 checkMaterialization = false;
51 checkMaterialization = false;
57 };
52 };
@@ -338,9 +333,9 @@ in {
338 '' + installDeps targetPrefix);
333 '' + installDeps targetPrefix);
339 })));
334 })));
340
335
341− # Need to use something from 8.8.x as the default on aarch64:
336+ # Need to use something from 8.8.x as the default to build aarch64 native compiler:
342 defaultCompilerNixName =
337 defaultCompilerNixName =
343− if final.targetPlatform.isAarch64
338+ if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
344 then "ghc883"
339 then "ghc883"
345 else "ghc865";
340 else "ghc865";
346 ghc = final.haskell-nix.compiler."${final.haskell-nix.defaultCompilerNixName}";
341 ghc = final.haskell-nix.compiler."${final.haskell-nix.defaultCompilerNixName}";
@@ -426,7 +421,7 @@ in {
426 } // args);
421 } // args);
427 alex = final.buildPackages.haskell-nix.alex-tool {};
422 alex = final.buildPackages.haskell-nix.alex-tool {};
428 happy-tool = args: final.haskell-nix.tool "happy" ({
423 happy-tool = args: final.haskell-nix.tool "happy" ({
429− version = buildBootstrapper.happyVersion;
424+ version = "1.19.12";
430 index-state = final.haskell-nix.internalHackageIndexState;
425 index-state = final.haskell-nix.internalHackageIndexState;
431 materialized = ../materialized + "/${
426 materialized = ../materialized + "/${
432 args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
427 args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
@@ -460,7 +455,9 @@ in {
460
455
461
456
462 # the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
457 # the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...)
463− bootstrap = with final.haskell-nix; let ghc = buildBootstrapper.ghc; in {
458+ bootstrap = with final.haskell-nix;
459+ let ghc = final.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
460+ in {
464 # XXX: import ../. will throw away all other overlays, config values, ...
461 # XXX: import ../. will throw away all other overlays, config values, ...
465 # this is not ideal!
462 # this is not ideal!
466 # get binary compilers for bootstrapping. We'll put the eventual proper
463 # get binary compilers for bootstrapping. We'll put the eventual proper
@@ -492,7 +489,7 @@ in {
492 # Only a boot compiler is suitable here
489 # Only a boot compiler is suitable here
493 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
490 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
494 index-state = final.haskell-nix.internalHackageIndexState;
491 index-state = final.haskell-nix.internalHackageIndexState;
495− materialized = ../materialized/bootstrap/alex;
492+ materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/alex";
496 } // args);
493 } // args);
497 alex = bootstrap.packages.alex-tool {};
494 alex = bootstrap.packages.alex-tool {};
498 happy-tool = args: tool "happy" ({
495 happy-tool = args: tool "happy" ({
@@ -501,7 +498,7 @@ in {
501 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
498 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
502 inherit (bootstrap.packages) cabal-install nix-tools hpack;
499 inherit (bootstrap.packages) cabal-install nix-tools hpack;
503 index-state = final.haskell-nix.internalHackageIndexState;
500 index-state = final.haskell-nix.internalHackageIndexState;
504− materialized = ../materialized/bootstrap/happy;
501+ materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/happy-${buildBootstrapper.happyVersion}";
505 } // args);
502 } // args);
506 happy = bootstrap.packages.happy-tool {};
503 happy = bootstrap.packages.happy-tool {};
507 hscolour-tool = args: (hackage-package ({
504 hscolour-tool = args: (hackage-package ({
@@ -510,7 +507,7 @@ in {
510 # Only a boot compiler is suitable here
507 # Only a boot compiler is suitable here
511 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
508 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
512 index-state = final.haskell-nix.internalHackageIndexState;
509 index-state = final.haskell-nix.internalHackageIndexState;
513− materialized = ../materialized/bootstrap/hscolour;
510+ materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/hscolour";
514 } // args)).components.exes.HsColour;
511 } // args)).components.exes.HsColour;
515 hscolour = bootstrap.packages.hscolour-tool {};
512 hscolour = bootstrap.packages.hscolour-tool {};
516 };
513 };
overlays/haskell.nix+1−1
@@ -173,7 +173,7 @@ final: prev: {
173 snapshots = import ../snapshots.nix { inherit (final) lib ghc-boot-packages; inherit mkPkgSet stackage excludeBootPackages; };
173 snapshots = import ../snapshots.nix { inherit (final) lib ghc-boot-packages; inherit mkPkgSet stackage excludeBootPackages; };
174 # Pick a recent LTS snapshot to be our "default" package set.
174 # Pick a recent LTS snapshot to be our "default" package set.
175 haskellPackages =
175 haskellPackages =
176− if final.targetPlatform.isAarch64
176+ if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
177 then snapshots."lts-15.13"
177 then snapshots."lts-15.13"
178 else snapshots."lts-14.13";
178 else snapshots."lts-14.13";
179
179