{"action":"opened","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/48435","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/48435/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/48435/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/48435/events","html_url":"https://github.com/NixOS/nixpkgs/issues/48435","id":369940947,"node_id":"MDU6SXNzdWUzNjk5NDA5NDc=","number":48435,"title":"haskellPackages.shellFor ignores setup-depends","user":{"login":"aherrmann","id":732652,"node_id":"MDQ6VXNlcjczMjY1Mg==","avatar_url":"https://avatars3.githubusercontent.com/u/732652?v=4","gravatar_id":"","url":"https://api.github.com/users/aherrmann","html_url":"https://github.com/aherrmann","followers_url":"https://api.github.com/users/aherrmann/followers","following_url":"https://api.github.com/users/aherrmann/following{/other_user}","gists_url":"https://api.github.com/users/aherrmann/gists{/gist_id}","starred_url":"https://api.github.com/users/aherrmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aherrmann/subscriptions","organizations_url":"https://api.github.com/users/aherrmann/orgs","repos_url":"https://api.github.com/users/aherrmann/repos","events_url":"https://api.github.com/users/aherrmann/events{/privacy}","received_events_url":"https://api.github.com/users/aherrmann/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-10-14T20:35:17Z","updated_at":"2018-10-14T20:35:17Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"## Issue description\r\n\r\n`haskellPackages.shellFor` does not include dependencies that are only listed in the `setup-depends` field in the cabal file. This can cause build failures due to missing dependencies.\r\n\r\n### Steps to reproduce\r\n\r\nCreate the following Cabal file `test.cabal`:\r\n\r\n```\r\nname: test\r\nversion: 0.1.0.0\r\nlicense: BSD3\r\nbuild-type: Custom\r\n\r\ncustom-setup\r\n  setup-depends:\r\n      base >= 4.11 && <4.12\r\n    , Cabal >=1.10\r\n    , cabal-doctest\r\n\r\nlibrary\r\n  build-depends:\r\n      base >=4.11 && <4.12\r\n    --, cabal-doctest\r\n```\r\n\r\nCreate the following Nix shell `shell.nix`:\r\n\r\n```\r\nlet\r\n  nixpkgs = builtins.fetchTarball {\r\n    name = \"nixpkgs-unstable\";\r\n    url = \"https://github.com/nixos/nixpkgs-channels/archive/c65da8b5111b0b78a8cdd021bf90ffc3f4d11bcb.tar.gz\";\r\n    sha256 = \"1zrhrclc3vh3s9f5swysrmsffnhw4j0q4r8ylvnsa1sdk5cc61sf\";\r\n  };\r\n  haskellOverlay = self: super: {\r\n    haskellPackages = super.haskellPackages.override (hpold: {\r\n      overrides = super.lib.composeExtensions\r\n        (hpold.overrides or (_: _: {}))\r\n        (self: super: {\r\n          test = super.callCabal2nix \"test\" ./. {};\r\n        })\r\n      ;\r\n    });\r\n  };\r\n  pkgs = import nixpkgs {\r\n    config = {};\r\n    overlays = [ haskellOverlay ];\r\n  };\r\nin\r\nwith pkgs;\r\nhaskellPackages.shellFor {\r\n  packages = hp: with hp; [ test ];\r\n  nativeBuildInputs = [ cabal-install ];\r\n}\r\n```\r\n\r\nExecute the following command to verify that the `setup-depends` dependency `cabal-doctest` is missing:\r\n\r\n```\r\n$ nix-shell --pure --run 'ghc-pkg list cabal-doctest'\r\n/nix/store/g5ggsbqkwqiiq3qkpw8ji42axrna117y-ghc-8.4.3/lib/ghc-8.4.3/package.conf.d\r\n    (no packages)\r\n```\r\n\r\nIn the cabal file uncomment the `library` `build-depends` line for `cabal-doctest` and then verify that the dependency becomes available:\r\n\r\n```\r\n$ nix-shell --pure --run 'ghc-pkg list cabal-doctest'\r\n/nix/store/a0mn58qh75jycwshvrl3jb3jfrrkp1wj-ghc-8.4.3-with-packages/lib/ghc-8.4.3/package.conf.d\r\n    cabal-doctest-1.0.6\r\n```\r\n\r\nThe expected behavior is that `cabal-doctest` should be available in the Nix shell even if it is only listed under `setup-depends`.\r\n\r\n## Technical details\r\n\r\n```\r\n$ nix-info -m\r\n - system: `\"x86_64-linux\"`\r\n - host os: `Linux 4.14.65, NixOS, 18.03.133126.4df3426f5a5 (Impala)`\r\n - multi-user?: `yes`\r\n - sandbox: `no`\r\n - version: `nix-env (Nix) 2.0.4`\r\n - channels(root): `\"nixos-18.03.133126.4df3426f5a5\"`\r\n - channels(aj): `\"unstable-19.03pre154023.89b618771ad\"`\r\n - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos/nixpkgs`\r\n```\r\n"}}
{"actor":{"display_login":"aherrmann"}}