summary refs log tree commit diff
path: root/pkgs/os-specific/linux/systemd/default.nix
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2020-08-12 18:34:09 +0200
committerFlorian Klink <flokli@flokli.de>2020-08-13 20:51:39 +0200
commitb68bddfbda2092c5fde2c4cece2f4bcf0eb214a1 (patch)
tree38d28d97f5e17c2d50a5a91c3881a71ad0f73562 /pkgs/os-specific/linux/systemd/default.nix
parent7e189c56a16382e1987a847b24bc34d8b957fd98 (diff)
downloadnixpkgs-b68bddfbda2092c5fde2c4cece2f4bcf0eb214a1.tar
nixpkgs-b68bddfbda2092c5fde2c4cece2f4bcf0eb214a1.tar.gz
nixpkgs-b68bddfbda2092c5fde2c4cece2f4bcf0eb214a1.tar.bz2
nixpkgs-b68bddfbda2092c5fde2c4cece2f4bcf0eb214a1.tar.lz
nixpkgs-b68bddfbda2092c5fde2c4cece2f4bcf0eb214a1.tar.xz
nixpkgs-b68bddfbda2092c5fde2c4cece2f4bcf0eb214a1.tar.zst
nixpkgs-b68bddfbda2092c5fde2c4cece2f4bcf0eb214a1.zip
systemd: remove lib output
systemd 246 started baking in some strings into $lib/lib/libsystemd.so
which points back to $out.

It might be desirable to not have these strings in there, but instead
have systemd ask the running manager for the really active paths via
IPC, or patch in some more mutable paths (like /run/current-system/…) -
but as long as it is as it is, we should probably should just stop
producing the `lib` output for now.

This does increase the runtime closure for installations not pulling in
systemd.out, or linking against multiple libsystemd's, but doesn't
increase the runtime closure for NixOS itself, as it needs systemd
anyways, and doesn't link against multiple variants of it.

We can also remove the aarch64-specific $out/lib/systemd/catalog hack,
and revive it at a later time if the `lib` output is reintroduced.
Diffstat (limited to 'pkgs/os-specific/linux/systemd/default.nix')
-rw-r--r--pkgs/os-specific/linux/systemd/default.nix31
1 files changed, 1 insertions, 30 deletions
diff --git a/pkgs/os-specific/linux/systemd/default.nix b/pkgs/os-specific/linux/systemd/default.nix
index c0163dcafe6..07467d5fc03 100644
--- a/pkgs/os-specific/linux/systemd/default.nix
+++ b/pkgs/os-specific/linux/systemd/default.nix
@@ -77,7 +77,7 @@ in stdenv.mkDerivation {
       "find_program('${stdenv.cc.bintools.targetPrefix}objcopy'"
   '';
 
-  outputs = [ "out" "lib" "man" "dev" ];
+  outputs = [ "out" "man" "dev" ];
 
   nativeBuildInputs =
     [ pkgconfig intltool gperf libxslt gettext docbook_xsl docbook_xml_dtd_42 docbook_xml_dtd_45
@@ -107,7 +107,6 @@ in stdenv.mkDerivation {
     "-Ddbussystemservicedir=${placeholder "out"}/share/dbus-1/system-services"
     "-Dpamconfdir=${placeholder "out"}/etc/pam.d"
     "-Drootprefix=${placeholder "out"}"
-    "-Drootlibdir=${placeholder "lib"}/lib"
     "-Dpkgconfiglibdir=${placeholder "dev"}/lib/pkgconfig"
     "-Dpkgconfigdatadir=${placeholder "dev"}/share/pkgconfig"
     "-Dloadkeys-path=${kbd}/bin/loadkeys"
@@ -276,38 +275,10 @@ in stdenv.mkDerivation {
 
     # "kernel-install" shouldn't be used on NixOS.
     find $out -name "*kernel-install*" -exec rm {} \;
-
-    # Keep only libudev and libsystemd in the lib output.
-    mkdir -p $out/lib
-    mv $lib/lib/security $lib/lib/libnss* $out/lib/
   ''; # */
 
   enableParallelBuilding = true;
 
-  # On aarch64 we "leak" a reference to $out/lib/systemd/catalog in the lib
-  # output. The result of that is a dependency cycle between $out and $lib.
-  # Thus nix (rightfully) marks the build as failed. That reference originates
-  # from an array of strings (catalog_file_dirs) in systemd
-  # (src/src/journal/catalog.{c,h}).  The only consumer (as of v242) of the
-  # symbol is the main function of journalctl.  Still libsystemd.so contains
-  # the VALUE but not the symbol.  Systemd seems to be properly using function
-  # & data sections together with the linker flags to garbage collect unused
-  # sections (-Wl,--gc-sections).  For unknown reasons those flags do not
-  # eliminate the unused string constants, in this case on aarch64-linux. The
-  # hacky way is to just remove the reference after we finished compiling.
-  # Since it can not be used (there is no symbol to actually refer to it) there
-  # should not be any harm.  It is a bit odd and I really do not like starting
-  # these kind of hacks but there doesn't seem to be a straight forward way at
-  # this point in time.
-  # The reference will be replaced by the same reference the usual nukeRefs
-  # tooling uses.  The standard tooling can not / should not be uesd since it
-  # is a bit too excessive and could potentially do us some (more) harm.
-  postFixup = ''
-    nukedRef=$(echo $out | sed -e "s,$NIX_STORE/[^-]*-\(.*\),$NIX_STORE/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-\1,")
-    cat $lib/lib/libsystemd.so | perl -pe "s|$out/lib/systemd/catalog|$nukedRef/lib/systemd/catalog|" > $lib/lib/libsystemd.so.tmp
-    mv $lib/lib/libsystemd.so.tmp $(readlink -f $lib/lib/libsystemd.so)
-  '';
-
   # The interface version prevents NixOS from switching to an
   # incompatible systemd at runtime.  (Switching across reboots is
   # fine, of course.)  It should be increased whenever systemd changes