haskell infra: nativeGhc != ghc.bootPkgs.ghc

There's no reason to wait for non-binary native to *build* cross ghc,
but we want a nix-built GHC for Setup.hs or things won't work.
This commit is contained in:
John Ericson
2018-01-21 23:31:04 -05:00
parent 8560c025bc
commit 81553124cf
4 changed files with 47 additions and 32 deletions
@@ -4,6 +4,10 @@
{ # package-set used for build tools (all of nixpkgs)
buildPackages
, # A haskell package set for Setup.hs, compiler plugins, and similar
# build-time uses.
buildHaskellPackages
, # package-set used for non-haskell dependencies (all of nixpkgs)
pkgs
@@ -18,8 +22,8 @@
, # compiler to use
ghc
, # A function that takes `{ pkgs, stdenv, callPackage }` as the first arg and `self`
# as second, and returns a set of haskell packages
, # A function that takes `{ pkgs, stdenv, callPackage }` as the first arg and
# `self` as second, and returns a set of haskell packages
package-set
, # The final, fully overriden package set usable with the nixpkgs fixpoint
@@ -36,15 +40,12 @@ let
inherit (stdenv.lib) fix' extends makeOverridable;
inherit (haskellLib) overrideCabal;
buildHaskellPackages = if hostPlatform != buildPlatform
then self.ghc.bootPkgs
else self;
mkDerivationImpl = pkgs.callPackage ./generic-builder.nix {
inherit stdenv;
nodejs = buildPackages.nodejs-slim;
inherit (buildHaskellPackages) jailbreak-cabal;
inherit buildHaskellPackages;
inherit (self) ghc;
inherit (buildHaskellPackages) jailbreak-cabal;
hscolour = overrideCabal buildHaskellPackages.hscolour (drv: {
isLibrary = false;
doHaddock = false;