{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/45775","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/45775/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/45775/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/45775/events","html_url":"https://github.com/NixOS/nixpkgs/issues/45775","id":355510562,"node_id":"MDU6SXNzdWUzNTU1MTA1NjI=","number":45775,"title":"haskell developPackage  error: creating directory '/nix/var","user":{"login":"teto","id":886074,"node_id":"MDQ6VXNlcjg4NjA3NA==","avatar_url":"https://avatars0.githubusercontent.com/u/886074?v=4","gravatar_id":"","url":"https://api.github.com/users/teto","html_url":"https://github.com/teto","followers_url":"https://api.github.com/users/teto/followers","following_url":"https://api.github.com/users/teto/following{/other_user}","gists_url":"https://api.github.com/users/teto/gists{/gist_id}","starred_url":"https://api.github.com/users/teto/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/teto/subscriptions","organizations_url":"https://api.github.com/users/teto/orgs","repos_url":"https://api.github.com/users/teto/repos","events_url":"https://api.github.com/users/teto/events{/privacy}","received_events_url":"https://api.github.com/users/teto/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-08-30T09:53:35Z","updated_at":"2019-08-07T14:39:13Z","closed_at":"2018-08-31T09:06:39Z","author_association":"CONTRIBUTOR","body":"## Issue description\r\nI try using haskell's developPackage but the \r\n```\r\n{ pkgs ? import <nixpkgs> {} }: \r\n\r\n  devPkg = pkgs.haskellPackages.developPackage {\r\n  root = ./hs;\r\n};\r\nin \r\n  devPkg\r\n```\r\nthat I run from a folder that contains `hs/hs.cabal` and the haskell source code. Then I run nix-shell\r\n```\r\n$ nix-shell shell-develop.nix                                                                                                                                                                                                                          \r\nbuilding '/nix/store/h5vyjlmllyvcqsbq89gs06i09j1l9gm1-cabal2nix-hs.drv'...\r\ninstalling\r\nerror: creating directory '/nix/var': Permission denied\r\nerror: creating directory '/nix/var': Permission denied\r\n** need a revision for VCS when the hash is given. skipping.\r\n** need a revision for VCS when the hash is given. skipping.\r\n** need a revision for VCS when the hash is given. skipping.\r\n** need a revision for VCS when the hash is given. skipping.\r\ncabal2nix: user error (Failed to fetch source. Does this source exist? Source {sourceUrl = \"/nix/store/fgiafw1caz7bnqwy7lrp6rg076z5n19s-hs\", sourceRevision = \"\", sourceHash = Guess \"\", sourceCabalDir = \"\"})\r\nnote: keeping build directory '/tmp/nix-build-cabal2nix-hs.drv-7'\r\nbuilder for '/nix/store/h5vyjlmllyvcqsbq89gs06i09j1l9gm1-cabal2nix-hs.drv' failed with exit code 1\r\nerror: while evaluating anonymous function at /home/teto/mptcpnetlink/shell-develop.nix:5:1, called from undefined position:\r\nwhile evaluating 'developPackage' at /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:207:7, called from /home/teto/mptcpnetlink/shell-develop.nix:10:12:\r\nwhile evaluating anonymous function at /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:210:20, called from /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:218:34:\r\nwhile evaluating 'callCabal2nix' at /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:180:32, called from /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:213:9:\r\nwhile evaluating 'overrideCabal' at /home/teto/nixpkgs/pkgs/development/haskell-modules/lib.nix:37:24, called from /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:190:8:\r\nwhile evaluating 'callPackageKeepDeriver' at /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:156:33, called from /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:190:23:\r\nwhile evaluating 'overrideCabal' at /home/teto/nixpkgs/pkgs/development/haskell-modules/lib.nix:37:24, called from /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:157:5:\r\nwhile evaluating 'callPackage' at /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:115:22, called from /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:157:20:\r\nwhile evaluating 'callPackageWithScope' at /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:75:37, called from /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:115:28:\r\nwhile evaluating 'makeOverridable' at /home/teto/nixpkgs/lib/customisation.nix:67:24, called from /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:98:8:\r\nwhile evaluating 'drvScope' at /home/teto/nixpkgs/pkgs/development/haskell-modules/make-package-set.nix:88:18, called from /home/teto/nixpkgs/lib/customisation.nix:69:12:\r\nbuild of '/nix/store/h5vyjlmllyvcqsbq89gs06i09j1l9gm1-cabal2nix-hs.drv' failed\r\n```\r\nand the error is not that clear, why would it try to create /nix/var ?\r\nthe hs.cabal file contains:\r\n```\r\nname: netlink-pm\r\nversion: 1.0.0\r\nlicense: GPL-3\r\nlicense-file: LICENSE\r\ncabal-version: >= 1.18\r\nbuild-type: Simple\r\n\r\nexecutable project1\r\n    build-depends: base < 5, netlink\r\n    main-is: daemon.hs\r\n    default-language: Haskell2010\r\n```\r\n\r\n\r\n\r\n### Steps to reproduce\r\n\r\n\r\n\r\n## Technical details\r\n\r\n - system: `\"x86_64-linux\"`\r\n - host os: `Linux 4.14.24, NixOS, 18.09.git.31145cb (Jellyfish)`\r\n - multi-user?: `yes`\r\n - sandbox: `yes`\r\n - version: `nix-env (Nix) 2.0.4`\r\n - nixpkgs: `/home/teto/nixpkgs`\r\n"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/519126891","html_url":"https://github.com/NixOS/nixpkgs/issues/45775#issuecomment-519126891","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/45775","id":519126891,"node_id":"MDEyOklzc3VlQ29tbWVudDUxOTEyNjg5MQ==","user":{"login":"domenkozar","id":126339,"node_id":"MDQ6VXNlcjEyNjMzOQ==","avatar_url":"https://avatars2.githubusercontent.com/u/126339?v=4","gravatar_id":"","url":"https://api.github.com/users/domenkozar","html_url":"https://github.com/domenkozar","followers_url":"https://api.github.com/users/domenkozar/followers","following_url":"https://api.github.com/users/domenkozar/following{/other_user}","gists_url":"https://api.github.com/users/domenkozar/gists{/gist_id}","starred_url":"https://api.github.com/users/domenkozar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domenkozar/subscriptions","organizations_url":"https://api.github.com/users/domenkozar/orgs","repos_url":"https://api.github.com/users/domenkozar/repos","events_url":"https://api.github.com/users/domenkozar/events{/privacy}","received_events_url":"https://api.github.com/users/domenkozar/received_events","type":"User","site_admin":false},"created_at":"2019-08-07T14:39:13Z","updated_at":"2019-08-07T14:39:13Z","author_association":"MEMBER","body":"```\r\nname ? builtins.baseNameOf root\r\n```\r\n\r\nUgh, such code shouldn't exist :)\r\n\r\nSo what happens is:\r\n\r\n1) `developPackage` gets passed `root = ./.`\r\n2) `name` is determined by it's parent directory name (which will be different as it's user chosen)\r\n3) `cabal2nix` can't find the cabal file so it falls back to git and other fetchers"}}
{"actor":{"display_login":"domenkozar"}}