From 5cf0bf91c008f1e8f63a76ca8d2138a2e8dfe7f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charlotte=20=F0=9F=A6=9D=20Delenk?= Date: Sun, 1 Dec 2024 15:31:05 +0100 Subject: [PATCH] read the stdout output line by line --- config/services/hydra/remote-eval-jobs.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/config/services/hydra/remote-eval-jobs.py b/config/services/hydra/remote-eval-jobs.py index ccae839f..c3dc34b9 100644 --- a/config/services/hydra/remote-eval-jobs.py +++ b/config/services/hydra/remote-eval-jobs.py @@ -40,14 +40,14 @@ for arg in sys.argv[1:]: remote_args += ["--workers", "4", "--gc-roots-dir", "/tmp"] -# copy over what files we need to ensure are present on the target - -subprocess.run(["@nix@", "copy"] + list(inputs_to_copy) + ["--to", "ssh://build-rainbow-resort", "--no-check-sigs"], check=True, stdout=subprocess.DEVNULL) +if len(inputs_to_copy) != 0: + # copy over what files we need to ensure are present on the target + subprocess.run(["@nix@", "copy"] + list(inputs_to_copy) + ["--to", "ssh://build-rainbow-resort", "--no-check-sigs"], check=True, stdout=subprocess.DEVNULL) # Evaluate on target result = subprocess.run(["@ssh@", "build-rainbow-resort", "nix-eval-jobs"] + list(map(shlex.quote, remote_args)), check=True, stdout=subprocess.PIPE, text=True) -for line in result.stdout: +for line in iter(result.stdout.readline, ""): try: data = json.loads(line) # copy .drv file home