-
Notifications
You must be signed in to change notification settings - Fork 238
Commit
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -55,7 +55,7 @@ in | |
]; | ||
}]; | ||
}).nix-tools.components.exes.plan-to-nix; | ||
bootstrap = if pkgs.targetPlatform.isAarch64 | ||
bootstrap = if pkgs.targetPlatform.isAarch64 && pkgs.buildPlatform.isAarch64 | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
angerman
Collaborator
|
||
then haskell-nix.bootstrap.compiler.ghc882 | ||
else haskell-nix.bootstrap.compiler.ghc844; | ||
in | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,26 +32,21 @@ let | |
# - What GHC version we should use for bootstrapping. | ||
# - What Happy version we should use for bootstrapping. | ||
buildBootstrapper = | ||
if final.targetPlatform.isAarch64 | ||
if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64 | ||
This comment has been minimized.
Sorry, something went wrong. |
||
then { | ||
ghc = final.buildPackages.haskell-nix.bootstrap.compiler.ghc882; | ||
compilerNixName = "ghc882"; | ||
happyVersion = "1.19.12"; | ||
} | ||
else { | ||
ghc = final.buildPackages.haskell-nix.bootstrap.compiler.ghc844; | ||
compilerNixName = "ghc844"; | ||
happyVersion = "1.19.11"; | ||
}; | ||
# For buildPackages.buildPackages, we just care about the GHC version: | ||
buildBuildBootstrapper = | ||
if final.targetPlatform.isAarch64 | ||
then final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler.ghc882 | ||
else final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler.ghc844; | ||
in { | ||
haskell-nix = prev.haskell-nix // { | ||
# Use this to disable the existing haskell infra structure for testing purposes | ||
compiler = | ||
let bootPkgs = with final.buildPackages; { | ||
ghc = buildBuildBootstrapper; | ||
ghc = final.buildPackages.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}"; | ||
alex = final.haskell-nix.bootstrap.packages.alex-tool { | ||
checkMaterialization = false; | ||
}; | ||
|
@@ -338,9 +333,9 @@ in { | |
'' + installDeps targetPrefix); | ||
}))); | ||
|
||
# Need to use something from 8.8.x as the default on aarch64: | ||
# Need to use something from 8.8.x as the default to build aarch64 native compiler: | ||
defaultCompilerNixName = | ||
if final.targetPlatform.isAarch64 | ||
if final.targetPlatform.isAarch64 && final.buildPlatform.isAarch64 | ||
This comment has been minimized.
Sorry, something went wrong. |
||
then "ghc883" | ||
else "ghc865"; | ||
ghc = final.haskell-nix.compiler."${final.haskell-nix.defaultCompilerNixName}"; | ||
|
@@ -426,7 +421,7 @@ in { | |
} // args); | ||
alex = final.buildPackages.haskell-nix.alex-tool {}; | ||
happy-tool = args: final.haskell-nix.tool "happy" ({ | ||
version = buildBootstrapper.happyVersion; | ||
version = "1.19.12"; | ||
This comment has been minimized.
Sorry, something went wrong.
TravisWhitaker
Contributor
|
||
index-state = final.haskell-nix.internalHackageIndexState; | ||
materialized = ../materialized + "/${ | ||
args.compiler-nix-name or final.haskell-nix.defaultCompilerNixName | ||
|
@@ -460,7 +455,9 @@ in { | |
|
||
|
||
# the bootstrap infra structure (pre-compiled ghc; bootstrapped cabal-install, ...) | ||
bootstrap = with final.haskell-nix; let ghc = buildBootstrapper.ghc; in { | ||
bootstrap = with final.haskell-nix; | ||
let ghc = final.buildPackages.haskell-nix.bootstrap.compiler."${buildBootstrapper.compilerNixName}"; | ||
in { | ||
# XXX: import ../. will throw away all other overlays, config values, ... | ||
# this is not ideal! | ||
# get binary compilers for bootstrapping. We'll put the eventual proper | ||
|
@@ -492,7 +489,7 @@ in { | |
# Only a boot compiler is suitable here | ||
ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; }; | ||
index-state = final.haskell-nix.internalHackageIndexState; | ||
materialized = ../materialized/bootstrap/alex; | ||
materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/alex"; | ||
} // args); | ||
alex = bootstrap.packages.alex-tool {}; | ||
happy-tool = args: tool "happy" ({ | ||
|
@@ -501,7 +498,7 @@ in { | |
ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; }; | ||
inherit (bootstrap.packages) cabal-install nix-tools hpack; | ||
index-state = final.haskell-nix.internalHackageIndexState; | ||
materialized = ../materialized/bootstrap/happy; | ||
materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/happy-${buildBootstrapper.happyVersion}"; | ||
} // args); | ||
happy = bootstrap.packages.happy-tool {}; | ||
hscolour-tool = args: (hackage-package ({ | ||
|
@@ -510,7 +507,7 @@ in { | |
# Only a boot compiler is suitable here | ||
ghcOverride = ghc // { isHaskellNixCompiler = ghc.isHaskellNixBootCompiler; }; | ||
index-state = final.haskell-nix.internalHackageIndexState; | ||
materialized = ../materialized/bootstrap/hscolour; | ||
materialized = ../materialized/bootstrap + "/${buildBootstrapper.compilerNixName}/hscolour"; | ||
} // args)).components.exes.HsColour; | ||
hscolour = bootstrap.packages.hscolour-tool {}; | ||
}; | ||
|
@hamishmack Hmm, shouldn't this be
||
instead? The ghc 8.8.x branch is the first that produces good code for arm, and ghc 8.6.5 can with patches. I don't think any previous versions will at all.