{"action":"closed","issue":{"url":"https://api.github.com/repos/commercialhaskell/stack/issues/1683","labels_url":"https://api.github.com/repos/commercialhaskell/stack/issues/1683/labels{/name}","comments_url":"https://api.github.com/repos/commercialhaskell/stack/issues/1683/comments","events_url":"https://api.github.com/repos/commercialhaskell/stack/issues/1683/events","html_url":"https://github.com/commercialhaskell/stack/issues/1683","id":127642777,"number":1683,"title":"Stack is not using nix cached packages for cabal dependencies","user":{"login":"ericsagnes","id":367880,"avatar_url":"https://avatars.githubusercontent.com/u/367880?v=3","gravatar_id":"","url":"https://api.github.com/users/ericsagnes","html_url":"https://github.com/ericsagnes","followers_url":"https://api.github.com/users/ericsagnes/followers","following_url":"https://api.github.com/users/ericsagnes/following{/other_user}","gists_url":"https://api.github.com/users/ericsagnes/gists{/gist_id}","starred_url":"https://api.github.com/users/ericsagnes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ericsagnes/subscriptions","organizations_url":"https://api.github.com/users/ericsagnes/orgs","repos_url":"https://api.github.com/users/ericsagnes/repos","events_url":"https://api.github.com/users/ericsagnes/events{/privacy}","received_events_url":"https://api.github.com/users/ericsagnes/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":{"login":"YPares","id":1377233,"avatar_url":"https://avatars.githubusercontent.com/u/1377233?v=3","gravatar_id":"","url":"https://api.github.com/users/YPares","html_url":"https://github.com/YPares","followers_url":"https://api.github.com/users/YPares/followers","following_url":"https://api.github.com/users/YPares/following{/other_user}","gists_url":"https://api.github.com/users/YPares/gists{/gist_id}","starred_url":"https://api.github.com/users/YPares/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YPares/subscriptions","organizations_url":"https://api.github.com/users/YPares/orgs","repos_url":"https://api.github.com/users/YPares/repos","events_url":"https://api.github.com/users/YPares/events{/privacy}","received_events_url":"https://api.github.com/users/YPares/received_events","type":"User","site_admin":false},"milestone":null,"comments":1,"created_at":"2016-01-20T09:46:34Z","updated_at":"2016-01-20T14:25:40Z","closed_at":"2016-01-20T14:25:40Z","body":"Stack version: `Version 1.0.0 x86_64`\r\nNixOS version: `16.03.git.5f6af50M`\r\n\r\n**Steps to reproduce**\r\n\r\n1/ Generate a new project using a resolver with nix binary cache available\r\n\r\n```\r\n$ stack new foo --resolver lts-4.1\r\n$ cd foo\r\n```\r\n\r\n2/ enable nix in `stack.yaml`\r\n\r\n```yaml\r\nnix:\r\n  enable: true\r\n```\r\n\r\n3/ setup stack\r\n\r\n```\r\n$ stack setup\r\nstack will use the GHC on your PATH\r\nFor more information on paths, see 'stack path' and 'stack exec env'\r\nTo use this GHC and packages outside of a project, consider using:\r\nstack ghc, stack ghci, stack runghc, or stack exec\r\n```\r\n\r\n```\r\n$ stack path\r\n...\r\nbin-path: /home/eric/.stack/snapshots/x86_64-linux-nix/lts-4.1/7.10.3/bin:/nix/store/20ydc8gy186yrjk06x8cbsqs4mly7xaq-ghc-7.10.3/bin:/nix/store/1z72dcicw4r87vmcnwbmgdw424nrz58c-patchelf-0.8/bin:/nix/store/n27xxmjjmcvwz5pss08qxz9isdh9mgbd-paxctl-0.9/bin:/nix/store/f3q55vxs9i3zxasnhlf5il0byrg456d2-gcc-wrapper-4.9.3/bin:/nix/store/1bwrkqji9jsq0ypip3cpgz5qcn2rad55-coreutils-8.24/bin:/nix/store/05z0y2c87p4z0gcn9wlyxskg5kcyjxmy-findutils-4.4.2/bin:/nix/store/l489hcmi1la2qj5px08g1bszijm9z1hm-diffutils-3.3/bin:/nix/store/s1qfi4hrxvs8bqs148haisgcxzvf2cjy-gnused-4.2.2/bin:/nix/store/vk8b9m1pnlv3vf9l4wnak9grxp5j3c55-gnugrep-2.22/bin:/nix/store/bsiqv3v9dcijgd275fglxxi93a1mfm9w-gawk-4.1.3/bin:/nix/store/60zf1xjmhwbf4g42724wrrj6ydy45cch-gnutar-1.28/bin:/nix/store/nag704c7wqqyv3n86i8zs3b66sgpq02q-gzip-1.6/bin:/nix/store/xx0lhx08rxin0w20j0y7ib4lkvl72vw4-bzip2-1.0.6/bin:/nix/store/zym9b3asfqcyhllrz2r8lzh6ir62ll1s-gnumake-4.1/bin:/nix/store/fx1kaw6faw8vmpwbhmlhl4agxgb110yw-bash-4.3-p42/bin:/nix/store/mqd6mwww0zi14zjnh6pcvb4wr03z8q9g-patch-2.7.5/bin:/nix/store/gnvv792j5jb7xzzjpp602ihs2y5ffjbv-xz-5.2.2/bin:/nix/store/rpdv6pi9z5dq7mcfh3rsavx0aixvcgl1-gcc-4.9.3/bin:/nix/store/3wjska842abcj7k36jnk5233i2x83c66-binutils-2.23.1/bin:/nix/store/jlmb88f5hgigbmc3c74ynxgn3frlzxkr-glibc-2.21/bin:/nix/store/1bwrkqji9jsq0ypip3cpgz5qcn2rad55-coreutils-8.24/bin\r\n...\r\n```\r\n\r\nStack is using `ghc` from the nix store, all good.\r\n\r\n4/  Adding a dependency to `foo.cabal`, eg. `lens`\r\n\r\n```\r\nlibrary\r\n  hs-source-dirs:      src\r\n  exposed-modules:     Lib\r\n  build-depends:       base >= 4.7 && < 5\r\n                      ,lens\r\n  default-language:    Haskell2010\r\n```\r\n\r\n5/ building with `stack build`\r\n\r\n```shell\r\n$ stack build\r\n```\r\n**Expected**\r\n\r\nUsing the nix binary cache/nix store as `haskell.packages.lts-4_1.lens` is in the binary cache (S flag) and in the local nix store (P flag): \r\n\r\n```shell\r\n$ nix-env -f \"<nixpkgs>\" -qaPs -A haskell.packages.lts-4_1.lens\r\n-PS  haskell.packages.lts-4_1.lens  lens-4.13\r\n$ nix-shell -p haskell.packages.lts-4_1.lens\r\n[nix-shell:~]$\r\n```\r\n\r\n**Actual**\r\n\r\nStack build `lens`:\r\n\r\n```shell\r\nbase-orphans-0.4.5: copying precompiled package\r\nmtl-2.2.1: copying precompiled package\r\nparallel-3.2.1.0: copying precompiled package\r\nprelude-extras-0.4.0.2: copying precompiled package\r\nprimitive-0.6.1.0: copying precompiled package\r\ntagged-0.8.2: copying precompiled package\r\nstm-2.4.4.1: copying precompiled package\r\ntransformers-compat-0.4.0.4: copying precompiled package\r\ntext-1.2.2.0: configure\r\nStateVar-1.1.0.2: copying precompiled package\r\ndistributive-0.4.4: copying precompiled package\r\nexceptions-0.8.0.2: copying precompiled package\r\ntext-1.2.2.0: build\r\nvector-0.11.0.0: configure\r\nreflection-2.1.1.1: download\r\nvector-0.11.0.0: build\r\nreflection-2.1.1.1: configure\r\nreflection-2.1.1.1: build\r\nreflection-2.1.1.1: copy/register\r\n...\r\n```\r\n\r\n---\r\n\r\nAm I missing some settings or using nix packages cache for dependencies is not yet implemented?\r\n\r\n"}}