From 61b0a147af1770c21a47a6a97ac6c0e692213d59 Mon Sep 17 00:00:00 2001 From: Alex David Date: Fri, 3 Oct 2025 10:48:23 -0700 Subject: [PATCH] Use coreutils from nixpkgs rather than from PATH Before this change, combinators that call `add-runtime` were assuming coreutils were available, however `add-runtime` did not inject coreutils as a runtime input. This also removes forwarding $PATH in the tests which should catch any issues like this in the future. Thanks Epsylon for the report: https://lists.sr.ht/~alexdavid/general/%3C331f3203-d6bf-4c53-824c-4d05088ec47e@gmail.com%3E --- lib/jail.nix | 8 +++++++- tests/spec/TestPrelude.hs | 1 - 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/jail.nix b/lib/jail.nix index df8b120..48ca89b 100644 --- a/lib/jail.nix +++ b/lib/jail.nix @@ -103,7 +103,13 @@ let if builtins.length state.cleanup > 0 then "" else "exec " }${state.cmd} "''${RUNTIME_ARGS[@]}" -- ${state.entry} ${state.argv} '') - (text: pkgs.writeShellApplication { inherit name text; }) + ( + text: + pkgs.writeShellApplication { + inherit name text; + runtimeInputs = [ pkgs.coreutils ]; + } + ) # forward man pages (jailed: if exe ? man then jailed // { inherit (exe) man; } else jailed) diff --git a/tests/spec/TestPrelude.hs b/tests/spec/TestPrelude.hs index d490607..cef024b 100644 --- a/tests/spec/TestPrelude.hs +++ b/tests/spec/TestPrelude.hs @@ -73,7 +73,6 @@ inTestM = aroundWith $ \action () -> do (\(name, getVal) -> ((name,) <$>) <$> getVal) [ ("HOME", lookupEnv "HOME"), ("LANG", pure $ Just "en_US.UTF-8"), - ("PATH", lookupEnv "PATH"), ("DBUS_SESSION_BUS_ADDRESS", lookupEnv "DBUS_SESSION_BUS_ADDRESS"), ("XDG_RUNTIME_DIR", lookupEnv "XDG_RUNTIME_DIR") ]