haskell: don't lose packageOverrides for native-bignum and integer-simple#167956
Conversation
75ceffd to
49d1461
Compare
|
Here is a file that can be used to test this change:
let
nixpkgs-src = /some/path/to/your/nixpkgs/repo;
my-overlay = final: prev: {
haskell = prev.haskell // {
packageOverrides =
final.lib.composeExtensions
(prev.haskell.packageOverrides or (_: _: {}))
(hfinal: hprev: {
my-new-package = hfinal.conduit;
});
};
};
pkgs = import nixpkgs-src { overlays = [my-overlay]; };
in
pkgs.haskell.packages.native-bignum.ghc902.my-new-packageIf you build this with the change from this PR, it successfully builds $ nix-build test.nix
...
/nix/store/hcd5c14hcx0dw76cbk9xhnbyf0xs9181-conduit-1.3.4.2However, if you're not using this PR, then you get an error about the $ nix-build test.nix
error: attribute 'my-new-package' missing
at /home/illabout/temp/what012.nix:21:1:
21| pkgs.pkgsStatic.haskellPackages.my-new-package
| ^ |
| native-bignum = | ||
| let | ||
| nativeBignumGhcNames = pkgs.lib.filter | ||
| (name: builtins.elem name nativeBignumIncludes) | ||
| (pkgs.lib.attrNames compiler); | ||
| in | ||
| pkgs.lib.genAttrs nativeBignumGhcNames | ||
| (name: | ||
| packages.${name}.override (oldAttrs: { | ||
| ghc = bh.compiler.native-bignum.${name}; | ||
| buildHaskellPackages = bh.packages.native-bignum.${name}; | ||
| overrides = | ||
| pkgs.lib.composeExtensions | ||
| (oldAttrs.overrides or (_: _: {})) | ||
| (_: _: { integer-gmp = null; }); | ||
| }) | ||
| ); |
There was a problem hiding this comment.
I refactored this to make it a little easier to see exactly what is going on.
The only non-whitespace change is going from
overrides = _self : _super : {
integer-gmp = null;
};to
overrides =
pkgs.lib.composeExtensions
(oldAttrs.overrides or (_: _: {}))
(_: _: { integer-gmp = null; });With this change, we make sure to keep any old overrides.
This is important because package.${name} is going to refer to one of the Haskell package sets. For instance:
nixpkgs/pkgs/top-level/haskell-packages.nix
Lines 222 to 226 in af5b994
You can see that this is defined with callPackage, which is defined in that same file:
nixpkgs/pkgs/top-level/haskell-packages.nix
Lines 31 to 34 in af5b994
callPackage specifically defines overrides as packageOverrides. The change in this PR makes sure not to lose this.
49d1461 to
aaf6ac1
Compare
It appears that integer-gmp is already set to null for all compilers, so there is no need to explicitly set it to null in the integer-simple and native-bignum package sets.
aaf6ac1 to
1be5cae
Compare
Description of changes
This updates
haskell.packages.{native-bignum,integer-simple}.*so that the new haskell packages added topackageOverridesare kept in the native-bignum and integer-simple package sets.Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/)nixos/doc/manual/md-to-db.shto update generated release notes