runc: Remove procps from wrapper

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

`procps` was added in 50e24b8e0a, 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.
This commit is contained in:
Robert Hensing
2023-10-06 11:55:07 +02:00
parent 4c96e13393
commit bb35cbc40e
@@ -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
'';