From 4a33ce1dc141c0e377dbebff8708afd494c24f04 Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Thu, 25 Mar 2021 22:50:28 +0100 Subject: fix(users/Profpatsch/writers): use s6-portable-utils MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We had a bunch of instances of https://github.com/NixOS/nix/issues/2176, where nix would exit with a “killed by signal 9” error. According to Eelco in that issue, this is perfectly normal behaviour of course, and appears if the last command in a loop closes `stdout` or `stdin`, then the builder will SIGKILL it immediately. This is of course also a perfectly fine error message for that case. It turns out that mainly GNU coreutils exhibit this behaviour … Let’s see if using a more sane tool suite fixes that. Change-Id: If34ab692120e5e299575bf8044aa5802145ab494 Reviewed-on: https://cl.tvl.fyi/c/depot/+/2658 Tested-by: BuildkiteCI Reviewed-by: Profpatsch --- users/Profpatsch/writers/default.nix | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'users/Profpatsch/writers') diff --git a/users/Profpatsch/writers/default.nix b/users/Profpatsch/writers/default.nix index 4f7478bc2fe5..ee3ac7bda782 100644 --- a/users/Profpatsch/writers/default.nix +++ b/users/Profpatsch/writers/default.nix @@ -1,6 +1,7 @@ { depot, pkgs, lib, ... }: let - bins = depot.nix.getBins pkgs.coreutils ["printf" "mkdir" "cat" "ln" "ls" "touch" ]; + bins = depot.nix.getBins pkgs.s6-portable-utils ["s6-mkdir" "s6-cat" "s6-ln" "s6-ls" "s6-touch" ] + // depot.nix.getBins pkgs.coreutils ["printf" ]; inherit (depot.nix.yants) defun struct restrict attrs list string drv any; @@ -41,7 +42,7 @@ let python3Lib = { name, libraries ? (_: []) }: moduleString: let srcTree = depot.nix.runExecline.local name { stdin = moduleString; } [ "importas" "out" "out" - "if" [ bins.mkdir "-p" "\${out}/${name}" ] + "if" [ bins.s6-mkdir "-p" "\${out}/${name}" ] "if" [ "redirfd" "-w" "1" "\${out}/setup.py" bins.printf '' @@ -56,7 +57,7 @@ let "if" [ # redirect stdin to the init py "redirfd" "-w" "1" "\${out}/${name}/__init__.py" - bins.cat + bins.s6-cat ] ]; in pkgs.python3Packages.buildPythonPackage { @@ -71,7 +72,7 @@ let linkTo = name: path: depot.nix.runExecline.local name {} [ "importas" "out" "out" - bins.ln "-sT" path "$out" + bins.s6-ln "-s" path "$out" ]; rustSimpleBin = { @@ -129,12 +130,12 @@ let tests = depot.nix.runExecline.local "${rustDrv.name}-tests-run" {} [ "importas" "out" "out" "if" [ - "pipeline" [ bins.ls "${crate true}/tests" ] + "pipeline" [ bins.s6-ls "${crate true}/tests" ] "forstdin" "-o0" "test" "importas" "test" "test" "${crate true}/tests/$test" ] - bins.touch "$out" + bins.s6-touch "$out" ]; in drvSeqL [ tests ] (crate false); -- cgit 1.4.1