[Nix-dev] A Journey into our brand-new Haskell infrastructure: Part II

Richard Wallace rwallace at thewallacepack.net
Sat Jan 17 21:36:05 CET 2015


Hi Peter,

I don't think I was very clear, sorry about that.  The thing that I'm
seeing is that when I run `nix-build default.nix -A AesonBson` with no
overrides, as in this `default.nix`

 | with (import <nixpkgs> {}).pkgs;
 | let
 |   modifiedHaskellPackages = haskellngPackages.override {
 |     overrides = self: super: {
 |     };
 |   };
 | in
 |   modifiedHaskellPackages


 everything gets built and installed.

 | $ nix-build default.nix -A AesonBson
 | these derivations will be built:
 |   /nix/store/y5di9g2vh8x29pqmml88x3bpx1rw1q81-hscolour-1.20.3.tar.gz.drv
 |   /nix/store/jxddl4xj26bzgp05vp71ifzz6gry7b79-hscolour-1.20.3.drv
 |   /nix/store/qqvhdndhxi63bsgvvcq2pshx0yvx1sh8-random-1.1.tar.gz.drv
 |   /nix/store/0d3x7pw7lq04xi2qvbvy3w4811dgqxcx-haskell-random-1.1.drv
 |   /nix/store/flkvyc5237pfiashxrscqybzgf1pv039-QuickCheck-2.7.6.tar.gz.drv
 |   /nix/store/c2zmcykwvw7bmajfjb4cxpxshyqa90xq-text-1.2.0.4.tar.gz.drv
 |   /nix/store/83q87v3baa1c7vcjwfpadr8qhighk1i5-haskell-text-1.2.0.4.drv
 |   /nix/store/9b6irma4l006vg1m303qc6fl0h1pkamz-xml-1.3.13.tar.gz.drv
 |   /nix/store/1ikx1hrndyz7ay2ss0b6252xk57qf8gi-haskell-xml-1.3.13.drv
 |   /nix/store/wqnrvx62dcy7ayd5nfd37pdzbcxywm5h-mtl-2.1.3.1.tar.gz.drv
 | <snip>

Then I change my default.nix to add the overridden AesonBsonm, as you have
above, and rerun `nix-build default.nix -A AesonBson`.  Now, AesonBson and
all of it's dependencies get rebuilt.  I had hoped/expected that only
 AesonBson would need to be rebuilt and not things like text and friends.

I'm not sure I understand nix well enough to say why this is, but I think
it's because we're using an entirely new derivation for haskellngPackages,
which means everything needs to be rebuilt and not just AesonBson.  This is
unfortunate because it makes nix worse for development than just using
cabal sandboxing. With the old wrapper behavior of haskellPackages, I only
needed to built a specific version of text and lens once.  Now I'll be
rebuilding them everytime I change any dependencies.  This is unfortunate
and I'd like to avoid it. Is that even possible?

Thanks,
Rich

On Sat, Jan 17, 2015 at 4:12 AM, Peter Simons <simons at cryp.to> wrote:

> Hi Richard,
>
>  > Everytime I try and override a package with ghcWithPackages, it ends
>  > up rebuilding every Haskell library. For instance, I have this
>  > shell.nix <https://gist.github.com/purefn/026625ad116b05ff9a8d>.
>
> I cannot reproduce this phenomenon. I saved your configuration to
> "default.nix"
>
>  | with (import <nixpkgs> {}).pkgs;
>  | let
>  |   modifiedHaskellPackages = haskellngPackages.override {
>  |     overrides = self: super: {
>  |       AesonBson = self.callPackage
>  |         ({ mkDerivation, aeson, attoparsec, base, bson, hspec, HUnit,
> stdenv
>  |         , text, unordered-containers, vector
>  |         }:
>  |         mkDerivation {
>  |           pname = "AesonBson";
>  |           version = "0.2.1";
>  |           src = fetchgit {
>  |             url = "https://github.com/fujimura/aesonbson.git";
>  |             rev = "7ac58f74317fe0f61098654e231f03adc219989d";
>  |             sha256 =
> "1miic2lq08ply6mjqdmamwsamxv2dnz5hj1yyjb74bgklh3mc36l";
>  |           };
>  |           buildDepends = [
>  |             aeson attoparsec base bson unordered-containers vector
>  |           ];
>  |           testDepends = [ aeson base bson hspec HUnit text ];
>  |           homepage = "https://github.com/nh2/AesonBson";
>  |           description = "Mapping between Aeson's JSON and Bson objects";
>  |           license = "unknown";
>  |         }) {};
>  |     };
>  |   };
>  | in
>  |   modifiedHaskellPackages
>
> and ran:
>
>  | $ nix-build default.nix -A Agda --dry-run
>  | these paths will be fetched (0.00 MiB download, 184.82 MiB unpacked):
>  |   /nix/store/1h61xarq9xg07i1llir8614dpi2sj42z-haskell-geniplate-0.6.0.5
>  |   /nix/store/2jys12fgb7mg76mp409mi4s00h0gxhsz-haskell-haskeline-0.7.1.3
>  |   /nix/store/3nbq1p5pbi86qk3jh847a09jgnn5yd7y-haskell-equivalence-0.2.5
>  |   /nix/store/g1z56xzv909x64hjjz69ic3jrx018axj-haskell-boxes-0.1.4
>  |   /nix/store/kj13l38gqpy34v55z68rjzfpvy64ibv8-haskell-data-hash-0.2.0.0
>  |   /nix/store/lw5bi37cm64l7rl5n43khigjl8j2pakn-haskell-STMonadTrans-0.3.2
>  |   /nix/store/pr8mgqmswraryw8r719j7bpj9ci0xn06-haskell-strict-0.3.2
>  |   /nix/store/svrr5kp8dk5dhg09q6spj82fq6h0g1rw-haskell-Agda-2.4.2.2
>  |   /nix/store/xa8wgxcmwbgf32pva55gjwivj7ssjvxp-haskell-terminfo-0.4.0.0
>  |
>  | $ nix-build default.nix -A AesonBson --dry-run
>  | these derivations will be built:
>  |   /nix/store/5yqdwlpkp7axnmgpi1g8xdfj1pcrmir6-aesonbson-7ac58f7.drv
>  |
>  /nix/store/n3lgwsg30hzs9mvypkf6n3s8svbgd6kz-haskell-AesonBson-0.2.1.drv
>  | these paths will be fetched (0.00 MiB download, 3.57 MiB unpacked):
>  |
>  /nix/store/sphsnkamvvc1jyirpnbjf2fcr5c70mkh-haskell-data-binary-ieee754-0.4.4
>  |   /nix/store/z5s0srhcv6bi03bckin6dr8zb2zmmckd-haskell-bson-0.3.1
>
> As far as I can tell, no unnecessary re-building takes place.
>
> Best regards,
> Peter
>
> _______________________________________________
> nix-dev mailing list
> nix-dev at lists.science.uu.nl
> http://lists.science.uu.nl/mailman/listinfo/nix-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20150117/b0e1188c/attachment-0001.html 


More information about the nix-dev mailing list