diff --git a/nixos/doc/manual/release-notes/rl-2311.section.md b/nixos/doc/manual/release-notes/rl-2311.section.md index 8c46a66bc98f..03fd035101db 100644 --- a/nixos/doc/manual/release-notes/rl-2311.section.md +++ b/nixos/doc/manual/release-notes/rl-2311.section.md @@ -26,6 +26,8 @@ - `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. +- `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). + - `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 - `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. diff --git a/pkgs/development/libraries/glibc/common.nix b/pkgs/development/libraries/glibc/common.nix index 00b78f57db61..de9867f41d0d 100644 --- a/pkgs/development/libraries/glibc/common.nix +++ b/pkgs/development/libraries/glibc/common.nix @@ -165,10 +165,18 @@ stdenv.mkDerivation ({ "OBJCOPY=${stdenv.cc.targetPrefix}objcopy" ]; + postInstall = (args.postInstall or "") + '' + moveToOutput bin/getent $getent + ''; + installFlags = [ "sysconfdir=$(out)/etc" ]; # out as the first output is an exception exclusive to glibc - outputs = [ "out" "bin" "dev" "static" ]; + + # getent is its own output, not kept in bin, since many things + # depend on getent but not on the locale generation tools in the bin + # output. This saves a couple of megabytes of closure size in many cases. + outputs = [ "out" "bin" "dev" "static" "getent" ]; strictDeps = true; depsBuildBuild = [ buildPackages.stdenv.cc ]; @@ -188,7 +196,7 @@ stdenv.mkDerivation ({ passthru = { inherit version; minorRelease = version; }; } -// (removeAttrs args [ "withLinuxHeaders" "withGd" ]) // +// (removeAttrs args [ "withLinuxHeaders" "withGd" "postInstall" ]) // { src = fetchurl { diff --git a/pkgs/development/libraries/glibc/default.nix b/pkgs/development/libraries/glibc/default.nix index 1c0c1b09e154..0f6cad157bb7 100644 --- a/pkgs/development/libraries/glibc/default.nix +++ b/pkgs/development/libraries/glibc/default.nix @@ -94,7 +94,7 @@ in "user-defined-trusted-dirs=${stdenv.cc.cc.libgcc}/lib" ]; - postInstall = (if stdenv.hostPlatform == stdenv.buildPlatform then '' + postInstall = previousAttrs.postInstall + (if stdenv.hostPlatform == stdenv.buildPlatform then '' echo SUPPORTED-LOCALES=C.UTF-8/UTF-8 > ../glibc-2*/localedata/SUPPORTED make -j''${NIX_BUILD_CORES:-1} localedata/install-locales '' else lib.optionalString stdenv.buildPlatform.isLinux '' diff --git a/pkgs/top-level/unixtools.nix b/pkgs/top-level/unixtools.nix index aa282adf6a3a..40faa7642129 100644 --- a/pkgs/top-level/unixtools.nix +++ b/pkgs/top-level/unixtools.nix @@ -72,7 +72,7 @@ let darwin = pkgs.darwin.system_cmds; }; getent = { - linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc + linux = if stdenv.hostPlatform.libc == "glibc" then pkgs.stdenv.cc.libc.getent else pkgs.netbsd.getent; darwin = pkgs.netbsd.getent; };