Commit bb35cbc4 authored by Robert Hensing's avatar Robert Hensing
Browse files

runc: Remove procps from wrapper

This reduces `runc` output closure size, particularly when not part of a
NixOS configuration.

`procps` was added in 50e24b8e, with the commit message indicating
the purpose of adding `systemctl` and `busctl`, both of which are
provided by `systemd` and not `procps`.

Presumably `procps` was added to make `runc ps` work regardless of the
environment, but this incurs a significant cost in terms of closure size,
especially when `runc` is packaged into something other than a NixOS
system, such as a dev shell or a package that does not use `runc ps`.

The alternative for improving the closure size would be to trim `procps`
itself. Currently it has a `systemd` dependency that's a significant cost.
However, removing that would also change `ps` and therefore `runc ps`
behavior. Furthermore, it would put two `procps` variants into the closure
of NixOS systems, when installed there.

Considering the above and the fact that the best `ps` is already present on
NixOS and most systems, I consider it the best solution not to bundle it
with `runc`, and take it from the environment instead.
parent 4c96e133
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -9,7 +9,6 @@
, libseccomp
, libselinux
, makeWrapper
, procps
, nixosTests
}:

@@ -45,7 +44,6 @@ buildGoModule rec {
    install -Dm755 runc $out/bin/runc
    installManPage man/*/*.[1-9]
    wrapProgram $out/bin/runc \
      --prefix PATH : ${lib.makeBinPath [ procps ]} \
      --prefix PATH : /run/current-system/systemd/bin
    runHook postInstall
  '';