glibc: split getent into its own output

Many dependents only require getent and not all the locale generation
tools that are included in the `bin` output. This can save some
closure size!

+14 -4
+2
nixos/doc/manual/release-notes/rl-2311.section.md
··· 26 26 27 27 - `mariadb` now defaults to `mariadb_1011` instead of `mariadb_106`, meaning the default version was upgraded from 10.6.x to 10.11.x. See the [upgrade notes](https://mariadb.com/kb/en/upgrading-from-mariadb-10-6-to-mariadb-10-11/) for potential issues. 28 28 29 + - `getent` has been moved from `glibc`'s `bin` output to its own dedicated output, reducing closure size for many dependents. Dependents using the `getent` alias should not be affected; others should move from using `glibc.bin` or `getBin glibc` to `getent` (which also improves compatibility with non-glibc platforms). 30 + 29 31 - `etcd` has been updated to 3.5, you will want to read the [3.3 to 3.4](https://etcd.io/docs/v3.5/upgrades/upgrade_3_4/) and [3.4 to 3.5](https://etcd.io/docs/v3.5/upgrades/upgrade_3_5/) upgrade guides 30 32 31 33 - `himalaya` has been updated to `0.8.0`, which drops the native TLS support (in favor of Rustls) and add OAuth 2.0 support. See the [release note](https://github.com/soywod/himalaya/releases/tag/v0.8.0) for more details.
+10 -2
pkgs/development/libraries/glibc/common.nix
··· 165 165 "OBJCOPY=${stdenv.cc.targetPrefix}objcopy" 166 166 ]; 167 167 168 + postInstall = (args.postInstall or "") + '' 169 + moveToOutput bin/getent $getent 170 + ''; 171 + 168 172 installFlags = [ "sysconfdir=$(out)/etc" ]; 169 173 170 174 # out as the first output is an exception exclusive to glibc 171 - outputs = [ "out" "bin" "dev" "static" ]; 175 + 176 + # getent is its own output, not kept in bin, since many things 177 + # depend on getent but not on the locale generation tools in the bin 178 + # output. This saves a couple of megabytes of closure size in many cases. 179 + outputs = [ "out" "bin" "dev" "static" "getent" ]; 172 180 173 181 strictDeps = true; 174 182 depsBuildBuild = [ buildPackages.stdenv.cc ]; ··· 188 196 passthru = { inherit version; minorRelease = version; }; 189 197 } 190 198 191 - // (removeAttrs args [ "withLinuxHeaders" "withGd" ]) // 199 + // (removeAttrs args [ "withLinuxHeaders" "withGd" "postInstall" ]) // 192 200 193 201 { 194 202 src = fetchurl {
+1 -1
pkgs/development/libraries/glibc/default.nix
··· 94 94 "user-defined-trusted-dirs=${stdenv.cc.cc.libgcc}/lib" 95 95 ]; 96 96 97 - postInstall = (if stdenv.hostPlatform == stdenv.buildPlatform then '' 97 + postInstall = previousAttrs.postInstall + (if stdenv.hostPlatform == stdenv.buildPlatform then '' 98 98 echo SUPPORTED-LOCALES=C.UTF-8/UTF-8 > ../glibc-2*/localedata/SUPPORTED 99 99 make -j''${NIX_BUILD_CORES:-1} localedata/install-locales 100 100 '' else lib.optionalString stdenv.buildPlatform.isLinux ''
+1 -1
pkgs/top-level/unixtools.nix
··· 72 72 darwin = pkgs.darwin.system_cmds; 73 73 }; 74 74 getent = { 75 - linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc 75 + linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc.getent 76 76 else pkgs.netbsd.getent; 77 77 darwin = pkgs.netbsd.getent; 78 78 };