{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14398","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14398/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14398/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14398/events","html_url":"https://github.com/NixOS/nixpkgs/pull/14398","id":145393010,"number":14398,"title":"Remove pkgs aliases","user":{"login":"nbp","id":1179566,"avatar_url":"https://avatars.githubusercontent.com/u/1179566?v=3","gravatar_id":"","url":"https://api.github.com/users/nbp","html_url":"https://github.com/nbp","followers_url":"https://api.github.com/users/nbp/followers","following_url":"https://api.github.com/users/nbp/following{/other_user}","gists_url":"https://api.github.com/users/nbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbp/subscriptions","organizations_url":"https://api.github.com/users/nbp/orgs","repos_url":"https://api.github.com/users/nbp/repos","events_url":"https://api.github.com/users/nbp/events{/privacy}","received_events_url":"https://api.github.com/users/nbp/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/0.kind:%20enhancement","name":"0.kind: enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/1.severity:%20security","name":"1.severity: security","color":"e11d21"},{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/2.status:%20work-in-progress","name":"2.status: work-in-progress","color":"e6e6e6"}],"state":"open","locked":false,"assignee":{"login":"nbp","id":1179566,"avatar_url":"https://avatars.githubusercontent.com/u/1179566?v=3","gravatar_id":"","url":"https://api.github.com/users/nbp","html_url":"https://github.com/nbp","followers_url":"https://api.github.com/users/nbp/followers","following_url":"https://api.github.com/users/nbp/following{/other_user}","gists_url":"https://api.github.com/users/nbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbp/subscriptions","organizations_url":"https://api.github.com/users/nbp/orgs","repos_url":"https://api.github.com/users/nbp/repos","events_url":"https://api.github.com/users/nbp/events{/privacy}","received_events_url":"https://api.github.com/users/nbp/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/NixOS/nixpkgs/milestones/9","html_url":"https://github.com/NixOS/nixpkgs/milestones/16.09","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/milestones/9/labels","id":1599653,"number":9,"title":"16.09","description":"The next release after 16.03. Perhaps it will be 16.09","creator":{"login":"vcunat","id":1785925,"avatar_url":"https://avatars.githubusercontent.com/u/1785925?v=3","gravatar_id":"","url":"https://api.github.com/users/vcunat","html_url":"https://github.com/vcunat","followers_url":"https://api.github.com/users/vcunat/followers","following_url":"https://api.github.com/users/vcunat/following{/other_user}","gists_url":"https://api.github.com/users/vcunat/gists{/gist_id}","starred_url":"https://api.github.com/users/vcunat/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vcunat/subscriptions","organizations_url":"https://api.github.com/users/vcunat/orgs","repos_url":"https://api.github.com/users/vcunat/repos","events_url":"https://api.github.com/users/vcunat/events{/privacy}","received_events_url":"https://api.github.com/users/vcunat/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":8,"state":"open","created_at":"2016-02-23T13:45:20Z","updated_at":"2016-04-04T09:56:51Z","due_on":null,"closed_at":null},"comments":11,"created_at":"2016-04-02T16:43:47Z","updated_at":"2016-04-04T19:20:03Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/14398","html_url":"https://github.com/NixOS/nixpkgs/pull/14398","diff_url":"https://github.com/NixOS/nixpkgs/pull/14398.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/14398.patch"},"body":"This branch aims at keeping the same hashes, but only removing aliases reported by the static analysis added in #10851 .\r\n\r\nThis branch aims at solving one of the problem which should be fixed to make the #10851 hypothesis hold, which is that all packages are defined in the first \"generation\" of Nixpkgs evaluation.\r\n\r\nThus transforming the following attribute accesses:\r\n\r\n```\r\n   +-----------+\r\n   |           |\r\n   |  nixpkgs  |\r\n   |           |        +-----------+\r\n   |   gen 3   |        |           |\r\n   |           |        |  nixpkgs  |\r\n   +----^------+        |           |        +-----------+\r\n        |               |   gen 2   |        |           |   nix-build -A foo\r\n        +---------------+           |        |  nixpkgs  |                 +\r\n  foo_4 = callPackage…  +----^------+        |           |                 |\r\n                             |               |   gen 1   <-----------------+\r\n                             +---------------+           |\r\n                         foo = foo_4;        +-----------+\r\n```\r\n\r\nInto something like:\r\n\r\n```\r\n                        +-----------+\r\n                        |           |\r\n                        |  nixpkgs  |\r\n                        |           |\r\n                        |   gen 2   |\r\n                        |           |\r\n                        +----^------+\r\n                             |\r\n                             +------------------+\r\n                       foo_4 = callPackage…     |\r\n                                             +-----------+\r\n                                             |           |   nix-build -A foo\r\n                                             |  nixpkgs  |                 +\r\n                             +--------------->           |                 |\r\n                             |               |   gen 1   <-----------------+\r\n                             +---------------+           |\r\n                         foo = self.foo_4;   +-----------+\r\n```\r\n\r\nThese changes are likely to bit-rot over time, thus this pull request is a meta issue / staging area for patches which are pending for review.\r\n\r\ncc @edolstra\r\n\r\nupdate: rephrase, to make statements clearer"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/205454537","html_url":"https://github.com/NixOS/nixpkgs/pull/14398#issuecomment-205454537","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/14398","id":205454537,"user":{"login":"nbp","id":1179566,"avatar_url":"https://avatars.githubusercontent.com/u/1179566?v=3","gravatar_id":"","url":"https://api.github.com/users/nbp","html_url":"https://github.com/nbp","followers_url":"https://api.github.com/users/nbp/followers","following_url":"https://api.github.com/users/nbp/following{/other_user}","gists_url":"https://api.github.com/users/nbp/gists{/gist_id}","starred_url":"https://api.github.com/users/nbp/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nbp/subscriptions","organizations_url":"https://api.github.com/users/nbp/orgs","repos_url":"https://api.github.com/users/nbp/repos","events_url":"https://api.github.com/users/nbp/events{/privacy}","received_events_url":"https://api.github.com/users/nbp/received_events","type":"User","site_admin":false},"created_at":"2016-04-04T19:20:03Z","updated_at":"2016-04-04T19:20:03Z","body":"@edolstra \r\n> Isn't all that's required to prevent self-references in the future to remove the `with pkgs` from `all-packages.nix`?\r\n\r\nTechnically yes, but `with pkgs` might also be convenient for non automated arguments.\r\n\r\nFor example, the following code:\r\n\r\n```nix\r\n  foo_4 = callPackage ../path/to/foo { swig = swig2; };\r\n  foo = foo_4;\r\n```\r\n\r\nshould be changed into:\r\n\r\n```nix\r\n  foo_4 = callPackage ../path/to/foo { swig = pkgs.swig2; };\r\n  foo = self.foo_4;\r\n```\r\n\r\nbut not into:\r\n\r\n```nix\r\n  foo_4 = callPackage ../path/to/foo { swig = self.swig2; };\r\n  foo = self.foo_4;\r\n```\r\n\r\nAt least, if we are building dynamically against `swig2`, and not statically.\r\n\r\nSo removing `with pkgs` would imply that we have to explicit all the non-default arguments, to be taken from `pkgs`.\r\n"}}