on iko/ghcjs-patch-master help sign in
Fix arm cross compilation with ghc 8.6.5 (#654)
commit80e0e61a8102fefd3431b3f4ec08664f2812918a authorHamish Mackenzie <Hamish.Mackenzie@iohk.io> dateSat 6 Jun 2020, 13:32 (6 years ago) parentc1b7b46
9 files changed+17−19
materialized/bootstrap/alex/.plan.nix/alex.nix → materialized/bootstrap/ghc844/alex/.plan.nix/alex.nix materialized/bootstrap/alex/default.nix → materialized/bootstrap/ghc844/alex/default.nix materialized/bootstrap/happy/.plan.nix/happy.nix → materialized/bootstrap/ghc844/happy-1.19.11/.plan.nix/happy.nix materialized/bootstrap/happy/default.nix → materialized/bootstrap/ghc844/happy-1.19.11/default.nix materialized/bootstrap/hscolour/.plan.nix/hscolour.nix → materialized/bootstrap/ghc844/hscolour/.plan.nix/hscolour.nix materialized/bootstrap/hscolour/default.nix → materialized/bootstrap/ghc844/hscolour/default.nix+2−1 nix-tools/regenerate.nix+1−1 overlays/bootstrap.nix+13−16 overlays/haskell.nix+1−1
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+
12{
23 pkgs = hackage:
34 {
@@ -30,4 +31,4 @@
3031 ({ lib, ... }:
3132 { packages = { "hscolour" = { flags = {}; }; }; })
3233 ];
33− }
34+ }
nix-tools/regenerate.nix+1−1
@@ -55,7 +55,7 @@ in
5555 ];
5656 }];
5757 }).nix-tools.components.exes.plan-to-nix;
58− bootstrap = if pkgs.targetPlatform.isAarch64
58+ bootstrap = if pkgs.targetPlatform.isAarch64 && pkgs.buildPlatform.isAarch64
5959 then haskell-nix.bootstrap.compiler.ghc882
6060 else haskell-nix.bootstrap.compiler.ghc844;
6161 in
overlays/bootstrap.nix+13−16
@@ -32,26 +32,21 @@ let
3232 # - What GHC version we should use for bootstrapping.
3333 # - What Happy version we should use for bootstrapping.
3434 buildBootstrapper =
35− if final.targetPlatform.isAarch64
35+ if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
3636 then {
37− ghc = final.buildPackages.haskell-nix.bootstrap.compiler.ghc882;
37+ compilerNixName = "ghc882";
3838 happyVersion = "1.19.12";
3939 }
4040 else {
41− ghc = final.buildPackages.haskell-nix.bootstrap.compiler.ghc844;
41+ compilerNixName = "ghc844";
4242 happyVersion = "1.19.11";
4343 };
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;
4944in {
5045 haskell-nix = prev.haskell-nix // {
5146 # Use this to disable the existing haskell infra structure for testing purposes
5247 compiler =
5348 let bootPkgs = with final.buildPackages; {
54− ghc = buildBuildBootstrapper;
49+ ghc = final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}";
5550 alex = final.haskell-nix.bootstrap.packages.alex-tool {
5651 checkMaterialization = false;
5752 };
@@ -338,9 +333,9 @@ in {
338333 '' + installDeps targetPrefix);
339334 })));
340335
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:
342337 defaultCompilerNixName =
343− if final.targetPlatform.isAarch64
338+ if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
344339 then "ghc883"
345340 else "ghc865";
346341 ghc = final.haskell-nix.compiler."${final.haskell-nix.defaultCompilerNixName}";
@@ -426,7 +421,7 @@ in {
426421 } // args);
427422 alex = final.buildPackages.haskell-nix.alex-tool {};
428423 happy-tool = args: final.haskell-nix.tool "happy" ({
429− version = buildBootstrapper.happyVersion;
424+ version = "1.19.12";
430425 index-state = final.haskell-nix.internalHackageIndexState;
431426 materialized = ../materialized + "/${
432427 args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName
@@ -460,7 +455,9 @@ in {
460455
461456
462457 # 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 {
464461 # XXX: import ../. will throw away all other overlays, config values, ...
465462 # this is not ideal!
466463 # get binary compilers for bootstrapping. We'll put the eventual proper
@@ -492,7 +489,7 @@ in {
492489 # Only a boot compiler is suitable here
493490 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
494491 index-state = final.haskell-nix.internalHackageIndexState;
495− materialized = ../materialized/bootstrap/alex;
492+ materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/alex";
496493 } // args);
497494 alex = bootstrap.packages.alex-tool {};
498495 happy-tool = args: tool "happy" ({
@@ -501,7 +498,7 @@ in {
501498 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
502499 inherit (bootstrap.packages) cabal-install nix-tools hpack;
503500 index-state = final.haskell-nix.internalHackageIndexState;
504− materialized = ../materialized/bootstrap/happy;
501+ materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/happy-${buildBootstrapper.happyVersion}";
505502 } // args);
506503 happy = bootstrap.packages.happy-tool {};
507504 hscolour-tool = args: (hackage-package ({
@@ -510,7 +507,7 @@ in {
510507 # Only a boot compiler is suitable here
511508 ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; };
512509 index-state = final.haskell-nix.internalHackageIndexState;
513− materialized = ../materialized/bootstrap/hscolour;
510+ materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/hscolour";
514511 } // args)).components.exes.HsColour;
515512 hscolour = bootstrap.packages.hscolour-tool {};
516513 };
overlays/haskell.nix+1−1
@@ -173,7 +173,7 @@ final: prev: {
173173 snapshots = import ../snapshots.nix { inherit (final) lib ghc-boot-packages; inherit mkPkgSet stackage excludeBootPackages; };
174174 # Pick a recent LTS snapshot to be our "default" package set.
175175 haskellPackages =
176− if final.targetPlatform.isAarch64
176+ if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64
177177 then snapshots."lts-15.13"
178178 else snapshots."lts-14.13";
179179