{"action":"created","issue":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/16406","repository_url":"https://api.github.com/repos/NixOS/nixpkgs","labels_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/16406/labels{/name}","comments_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/16406/comments","events_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/16406/events","html_url":"https://github.com/NixOS/nixpkgs/pull/16406","id":161530634,"number":16406,"title":"coreutils: single binary build","user":{"login":"wmertens","id":54934,"avatar_url":"https://avatars.githubusercontent.com/u/54934?v=3","gravatar_id":"","url":"https://api.github.com/users/wmertens","html_url":"https://github.com/wmertens","followers_url":"https://api.github.com/users/wmertens/followers","following_url":"https://api.github.com/users/wmertens/following{/other_user}","gists_url":"https://api.github.com/users/wmertens/gists{/gist_id}","starred_url":"https://api.github.com/users/wmertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmertens/subscriptions","organizations_url":"https://api.github.com/users/wmertens/orgs","repos_url":"https://api.github.com/users/wmertens/repos","events_url":"https://api.github.com/users/wmertens/events{/privacy}","received_events_url":"https://api.github.com/users/wmertens/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/NixOS/nixpkgs/labels/1.severity:%20mass-rebuild","name":"1.severity: mass-rebuild","color":"e11d21"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":13,"created_at":"2016-06-21T20:23:23Z","updated_at":"2016-07-05T22:51:00Z","closed_at":"2016-06-29T06:06:16Z","pull_request":{"url":"https://api.github.com/repos/NixOS/nixpkgs/pulls/16406","html_url":"https://github.com/NixOS/nixpkgs/pull/16406","diff_url":"https://github.com/NixOS/nixpkgs/pull/16406.diff","patch_url":"https://github.com/NixOS/nixpkgs/pull/16406.patch"},"body":"###### Motivation for this change\r\n\r\nThis brings down the coreutils install size from 10-16MB to 2.6MB (on Darwin):\r\n```\r\n$ du -ks /nix/store/*8.25\r\n16368\t/nix/store/95wmyhk0y60r09b98l6v4vswv5m7xm4q-coreutils-8.25\r\n2644\t/nix/store/c50vsbnq4kw3gfp8yxyggy0yyr5i7gbl-coreutils-8.25\r\n10668\t/nix/store/clqq5iva8aylmr3k08lpp68ai7g6wz2r-coreutils-8.25\r\n9812\t/nix/store/kshydzblaqjxqdmx61hpm2xl811raknb-coreutils-8.25\r\n2644\t/nix/store/rwqm8czcxx31jgvxqqwy8wdfq35rkjp1-coreutils-8.25\r\n```\r\n\r\nIt does this by creating a single binary and a bunch of scripts that call it:\r\n```\r\n$ ll /nix/store/c50vsbnq4kw3gfp8yxyggy0yyr5i7gbl-coreutils-8.25/bin/\r\ntotal 2216\r\n-r-xr-xr-x 1 wmertens     102 Jan  1  1970 [*\r\n[...]\r\n-r-xr-xr-x 1 wmertens     106 Jan  1  1970 cksum*\r\n-r-xr-xr-x 1 wmertens     105 Jan  1  1970 comm*\r\n-r-xr-xr-x 1 wmertens 1840300 Jan  1  1970 coreutils*\r\n-r-xr-xr-x 1 wmertens     103 Jan  1  1970 cp*\r\n[...]\r\n$ cat /nix/store/c50vsbnq4kw3gfp8yxyggy0yyr5i7gbl-coreutils-8.25/bin/tty \r\n#!/nix/store/c50vsbnq4kw3gfp8yxyggy0yyr5i7gbl-coreutils-8.25/bin/coreutils --coreutils-prog-shebang=tty\r\n```\r\n\r\nSee also https://lists.gnu.org/archive/html/coreutils/2014-06/msg00036.html for the initial patch and https://lists.gnu.org/archive/html/coreutils/2014-06/msg00071.html for the reasoning about the shebang thing.\r\n\r\nThis gets used in ChromeOS, and I can't think of a reason not to have it in NixOS.\r\n\r\n###### Things done\r\n\r\n- [ ] Tested using sandboxing\r\n  ([nix.useSandbox](http://nixos.org/nixos/manual/options.html#opt-nix.useSandbox) on NixOS,\r\n    or option `build-use-sandbox` in [`nix.conf`](http://nixos.org/nix/manual/#sec-conf-file)\r\n    on non-NixOS)\r\n- Built on platform(s)\r\n   - [ ] NixOS\r\n   - [x] OS X\r\n   - [ ] Linux\r\n- [ ] Tested compilation of all pkgs that depend on this change using `nix-shell -p nox --run \"nox-review wip\"`\r\n- [ ] Tested execution of all binary files (usually in `./result/bin/`)\r\n- [x] Fits [CONTRIBUTING.md](https://github.com/NixOS/nixpkgs/blob/master/.github/CONTRIBUTING.md).\r\n\r\n---\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/NixOS/nixpkgs/issues/comments/230625714","html_url":"https://github.com/NixOS/nixpkgs/pull/16406#issuecomment-230625714","issue_url":"https://api.github.com/repos/NixOS/nixpkgs/issues/16406","id":230625714,"user":{"login":"wmertens","id":54934,"avatar_url":"https://avatars.githubusercontent.com/u/54934?v=3","gravatar_id":"","url":"https://api.github.com/users/wmertens","html_url":"https://github.com/wmertens","followers_url":"https://api.github.com/users/wmertens/followers","following_url":"https://api.github.com/users/wmertens/following{/other_user}","gists_url":"https://api.github.com/users/wmertens/gists{/gist_id}","starred_url":"https://api.github.com/users/wmertens/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wmertens/subscriptions","organizations_url":"https://api.github.com/users/wmertens/orgs","repos_url":"https://api.github.com/users/wmertens/repos","events_url":"https://api.github.com/users/wmertens/events{/privacy}","received_events_url":"https://api.github.com/users/wmertens/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T22:51:00Z","updated_at":"2016-07-05T22:51:00Z","body":"As explained in #16733, I think we should just use symlinks by default."}}
{"actor":{"display_login":"wmertens"}}