From ae50c356c2f9e790f3d9d8e00bfa9f4b54f49bdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= Date: Wed, 13 Sep 2023 13:07:38 +0200 Subject: [PATCH] disable wait_stdin for now This does not work yet --- nix_ci_build/__init__.py | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/nix_ci_build/__init__.py b/nix_ci_build/__init__.py index b7d8de9..a50ab18 100644 --- a/nix_ci_build/__init__.py +++ b/nix_ci_build/__init__.py @@ -282,11 +282,7 @@ def stop_gracefully(proc: subprocess.Popen, timeout: int = 1) -> None: @contextmanager def nix_output_monitor(fd: int) -> Iterator[subprocess.Popen]: - # to avoid warnings in nom if no output is received - def wait_stdin() -> None: - select.select([fd], [], []) - - proc = subprocess.Popen(["nom"], stdin=fd, preexec_fn=wait_stdin) + proc = subprocess.Popen(["nom"], stdin=fd) try: yield proc finally: @@ -304,10 +300,10 @@ def run_builds(stack: ExitStack, opts: Options) -> int: stdout = pipe.write_file builds: list[Build] = [] for line in proc.stdout: - if nom_proc is None: - nom_proc = stack.enter_context(nix_output_monitor(pipe.read_file.fileno())) if opts.verbose: print(line, end="") + if nom_proc is None: + nom_proc = stack.enter_context(nix_output_monitor(pipe.read_file.fileno())) try: job = json.loads(line) except json.JSONDecodeError: