{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10874","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10874/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10874/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10874/events","html_url":"https://github.com/NixOS/nixpkgs/issues/10874","id":115692464,"number":10874,"title":"Standardize all-packages.nix arguments and stdenv attributes","user":{"login":"Mathnerd314","id":322214,"avatar_url":"https://avatars.githubusercontent.com/u/322214?v=3","gravatar_id":"","url":"https://api.github.com/users/Mathnerd314","html_url":"https://github.com/Mathnerd314","followers_url":"https://api.github.com/users/Mathnerd314/followers","following_url":"https://api.github.com/users/Mathnerd314/following{/other_user}","gists_url":"https://api.github.com/users/Mathnerd314/gists{/gist_id}","starred_url":"https://api.github.com/users/Mathnerd314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Mathnerd314/subscriptions","organizations_url":"https://api.github.com/users/Mathnerd314/orgs","repos_url":"https://api.github.com/users/Mathnerd314/repos","events_url":"https://api.github.com/users/Mathnerd314/events{/privacy}","received_events_url":"https://api.github.com/users/Mathnerd314/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/9.needs:%20changelog","name":"9.needs: changelog","color":"eb6420"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":29,"created_at":"2015-11-07T21:05:31Z","updated_at":"2016-04-26T20:51:58Z","closed_at":null,"body":"There's a lot of duplication between the [cross-building stuff for gcc](https://github.com/NixOS/nixpkgs/blob/788800e437c4a0a25d95e217540bded68804b25e/pkgs/top-level/all-packages.nix#L3773) and the [Linux stdenv bootstrap](https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/linux/default.nix).\r\nSimilarly, in [libiconv](https://github.com/NixOS/nixpkgs/blob/788800e437c4a0a25d95e217540bded68804b25e/pkgs/top-level/all-packages.nix#L7095)'s setup, the same logic is repeated twice, once for cross-building and once for stdenv.\r\nAlso, consider the [dropbox](https://github.com/NixOS/nixpkgs/blob/6e44f0710a1b715f8855805251c123f39d8e549e/pkgs/applications/networking/dropbox/default.nix#L26) package, which checks ``stdenv.system`` to see which binary to download. Supposing that one was cross-compiling a NixOS system from OS X, this is incorrect; ``stdenv.system`` would be ``x86_64-darwin``, while the desired value ``x86_64-linux`` would not even be available in the current ``crossSystem`` attributes. (The closest is ``config``, which would be \"x86_64-unknown-linux-gnu\"). On the other hand, the url contains the arch, which *is* present in ``crossSystem``, but not in ``stdenv``.\r\n\r\nIn other words, it's unclear what attributes are supposed to be checked for platform-dependent behavior, and the set of attributes available is inconsistent between cross-builds and normal builds. This should be decided upon and the results documented somewhere (e.g. nixpkgs manual).\r\n\r\nAlso see #4855 for a related discussion on cross-building dependencies, #1928 for requested stdenv attributes and cross-building TODO's that never happened, #6221 and #7334 for more stdenv attributes, #8081 for bootstrap tools scope creep, #3574 and #7384 mentioning dedicated Hydra job for bootstrap tools, #6952 for a possible alternative to our current bootstrapping approach, #5944 for why cross-compiling only works with gcc, #4963 for ideas on NixOS (as opposed to nixpkgs) cross-compiling, #2817 for odd stdenv overrides behavior, and #4998 for the likely end state of this issue.\r\n\r\nI propose setting ``system`` to be the crossSystem-style attribute set for the targeted system, and combining ``bootStdenv`` and ``crossSystem`` into ``bootSystem``, representing the host system on which the builders are run."},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/214882256","html_url":"https://github.com/NixOS/nixpkgs/issues/10874#issuecomment-214882256","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/10874","id":214882256,"user":{"login":"Ericson2314","id":1055245,"avatar_url":"https://avatars.githubusercontent.com/u/1055245?v=3","gravatar_id":"","url":"https://api.github.com/users/Ericson2314","html_url":"https://github.com/Ericson2314","followers_url":"https://api.github.com/users/Ericson2314/followers","following_url":"https://api.github.com/users/Ericson2314/following{/other_user}","gists_url":"https://api.github.com/users/Ericson2314/gists{/gist_id}","starred_url":"https://api.github.com/users/Ericson2314/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Ericson2314/subscriptions","organizations_url":"https://api.github.com/users/Ericson2314/orgs","repos_url":"https://api.github.com/users/Ericson2314/repos","events_url":"https://api.github.com/users/Ericson2314/events{/privacy}","received_events_url":"https://api.github.com/users/Ericson2314/received_events","type":"User","site_admin":false},"created_at":"2016-04-26T20:51:58Z","updated_at":"2016-04-26T20:51:58Z","body":"@vcunat do you have branch / want to collaborate on this?"}}