mirror of
https://github.com/Mic92/nix-fast-build.git
synced 2024-08-17 21:50:26 +03:00
disable wait_stdin for now
This does not work yet
This commit is contained in:
parent
9b384a06bc
commit
ae50c356c2
@ -282,11 +282,7 @@ def stop_gracefully(proc: subprocess.Popen, timeout: int = 1) -> None:
|
|||||||
|
|
||||||
@contextmanager
|
@contextmanager
|
||||||
def nix_output_monitor(fd: int) -> Iterator[subprocess.Popen]:
|
def nix_output_monitor(fd: int) -> Iterator[subprocess.Popen]:
|
||||||
# to avoid warnings in nom if no output is received
|
proc = subprocess.Popen(["nom"], stdin=fd)
|
||||||
def wait_stdin() -> None:
|
|
||||||
select.select([fd], [], [])
|
|
||||||
|
|
||||||
proc = subprocess.Popen(["nom"], stdin=fd, preexec_fn=wait_stdin)
|
|
||||||
try:
|
try:
|
||||||
yield proc
|
yield proc
|
||||||
finally:
|
finally:
|
||||||
@ -304,10 +300,10 @@ def run_builds(stack: ExitStack, opts: Options) -> int:
|
|||||||
stdout = pipe.write_file
|
stdout = pipe.write_file
|
||||||
builds: list[Build] = []
|
builds: list[Build] = []
|
||||||
for line in proc.stdout:
|
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:
|
if opts.verbose:
|
||||||
print(line, end="")
|
print(line, end="")
|
||||||
|
if nom_proc is None:
|
||||||
|
nom_proc = stack.enter_context(nix_output_monitor(pipe.read_file.fileno()))
|
||||||
try:
|
try:
|
||||||
job = json.loads(line)
|
job = json.loads(line)
|
||||||
except json.JSONDecodeError:
|
except json.JSONDecodeError:
|
||||||
|
Loading…
Reference in New Issue
Block a user