Update haskellPackages to use new features of makeOverridable

Instead of manually using `makeExtensible`, which broke `override`.

Fixes #26561
This commit is contained in:
Will Fancher 2017-07-11 22:27:44 -04:00
parent af479c182f
commit e11dbc3710
3 changed files with 30 additions and 34 deletions

View File

@ -7,6 +7,8 @@
, configurationNix ? import ./configuration-nix.nix , configurationNix ? import ./configuration-nix.nix
}: }:
self: # Provided by `callPackageWithSelf`
let let
inherit (stdenv.lib) extends makeExtensible; inherit (stdenv.lib) extends makeExtensible;
@ -14,19 +16,15 @@ let
haskellPackages = makePackageSet { haskellPackages = makePackageSet {
package-set = initialPackages; package-set = initialPackages;
inherit ghc extensible-self; extensible-self = self;
inherit ghc;
}; };
commonConfiguration = configurationCommon { inherit pkgs; }; commonConfiguration = configurationCommon { inherit pkgs; };
nixConfiguration = configurationNix { inherit pkgs; }; nixConfiguration = configurationNix { inherit pkgs; };
extensible-self = makeExtensible in (extends overrides
(extends overrides (extends packageSetConfig
(extends packageSetConfig (extends compilerConfig
(extends compilerConfig (extends commonConfiguration
(extends commonConfiguration (extends nixConfiguration haskellPackages))))) self
(extends nixConfiguration haskellPackages)))));
in
extensible-self

View File

@ -5481,9 +5481,7 @@ with pkgs;
haskell = callPackage ./haskell-packages.nix { }; haskell = callPackage ./haskell-packages.nix { };
haskellPackages = haskell.packages.ghc802.override { haskellPackages = haskell.packages.ghc802.extend (config.haskellPackageOverrides or (self: super: {}));
overrides = config.haskellPackageOverrides or (self: super: {});
};
inherit (haskellPackages) ghc; inherit (haskellPackages) ghc;

View File

@ -1,4 +1,4 @@
{ pkgs, callPackage, stdenv, buildPlatform, targetPlatform }: { pkgs, callPackage, callPackageWithSelf, stdenv, buildPlatform, targetPlatform }:
let # These are attributes in compiler and packages that don't support integer-simple. let # These are attributes in compiler and packages that don't support integer-simple.
integerSimpleExcludes = [ integerSimpleExcludes = [
@ -118,79 +118,79 @@ in rec {
packages = { packages = {
# Support for this compiler is broken, because it can't deal with directory-based package databases. # Support for this compiler is broken, because it can't deal with directory-based package databases.
# ghc6104 = callPackage ../development/haskell-modules { ghc = compiler.ghc6104; }; # ghc6104 = callPackageWithSelf ../development/haskell-modules { ghc = compiler.ghc6104; };
ghc6123 = callPackage ../development/haskell-modules { ghc6123 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc6123; ghc = compiler.ghc6123;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-6.12.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-6.12.x.nix { };
}; };
ghc704 = callPackage ../development/haskell-modules { ghc704 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc704; ghc = compiler.ghc704;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.0.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.0.x.nix { };
}; };
ghc722 = callPackage ../development/haskell-modules { ghc722 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc722; ghc = compiler.ghc722;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.2.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.2.x.nix { };
}; };
ghc742 = callPackage ../development/haskell-modules { ghc742 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc742; ghc = compiler.ghc742;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.4.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.4.x.nix { };
}; };
ghc763 = callPackage ../development/haskell-modules { ghc763 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc763; ghc = compiler.ghc763;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.6.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.6.x.nix { };
}; };
ghc783 = callPackage ../development/haskell-modules { ghc783 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc783; ghc = compiler.ghc783;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.8.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.8.x.nix { };
}; };
ghc784 = callPackage ../development/haskell-modules { ghc784 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc784; ghc = compiler.ghc784;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.8.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.8.x.nix { };
}; };
ghc7102 = callPackage ../development/haskell-modules { ghc7102 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc7102; ghc = compiler.ghc7102;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { };
}; };
ghc7103 = callPackage ../development/haskell-modules { ghc7103 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc7103; ghc = compiler.ghc7103;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { };
}; };
ghc801 = callPackage ../development/haskell-modules { ghc801 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc801; ghc = compiler.ghc801;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { };
}; };
ghc802 = callPackage ../development/haskell-modules { ghc802 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc802; ghc = compiler.ghc802;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { };
}; };
ghc821 = callPackage ../development/haskell-modules { ghc821 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc821; ghc = compiler.ghc821;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { };
}; };
ghcHEAD = callPackage ../development/haskell-modules { ghcHEAD = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghcHEAD; ghc = compiler.ghcHEAD;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
}; };
# TODO Support for multiple variants here # TODO Support for multiple variants here
ghcCross = callPackage ../development/haskell-modules { ghcCross = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghcHEAD.crossCompiler; ghc = compiler.ghcHEAD.crossCompiler;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-head.nix { };
}; };
ghcCross821 = callPackage ../development/haskell-modules { ghcCross821 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghc821.crossCompiler; ghc = compiler.ghc821.crossCompiler;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.2.x.nix { };
}; };
ghcjs = callPackage ../development/haskell-modules { ghcjs = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghcjs; ghc = compiler.ghcjs;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-7.10.x.nix { };
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { }; packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { };
}; };
ghcjsHEAD = callPackage ../development/haskell-modules { ghcjsHEAD = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghcjsHEAD; ghc = compiler.ghcjsHEAD;
compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-ghc-8.0.x.nix { };
packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { }; packageSetConfig = callPackage ../development/haskell-modules/configuration-ghcjs.nix { };
}; };
ghcHaLVM240 = callPackage ../development/haskell-modules { ghcHaLVM240 = callPackageWithSelf ../development/haskell-modules {
ghc = compiler.ghcHaLVM240; ghc = compiler.ghcHaLVM240;
compilerConfig = callPackage ../development/haskell-modules/configuration-halvm-2.4.0.nix { }; compilerConfig = callPackage ../development/haskell-modules/configuration-halvm-2.4.0.nix { };
}; };