fixup after rebase

Signed-off-by: Gregory Becker <becker33@llnl.gov>
This commit is contained in:
Gregory Becker 2025-04-09 10:19:29 -07:00
parent dcdbbd235d
commit a2441f4656
No known key found for this signature in database
GPG Key ID: 2362541F6D14ED84
2 changed files with 10 additions and 2 deletions

View File

@ -92,7 +92,7 @@ def update_installations(self) -> None:
tty.msg(f"[BOOTSTRAPPING] Installing dependencies ({', '.join(colorized_specs)})") tty.msg(f"[BOOTSTRAPPING] Installing dependencies ({', '.join(colorized_specs)})")
self.write(regenerate=False) self.write(regenerate=False)
with tty.SuppressOutput(msg_enabled=log_enabled, warn_enabled=log_enabled): with tty.SuppressOutput(msg_enabled=log_enabled, warn_enabled=log_enabled):
self.install_all() self.install_all(fail_fast=True)
self.write(regenerate=True) self.write(regenerate=True)
def load(self) -> None: def load(self) -> None:

View File

@ -1133,6 +1133,7 @@ def __init__(
pkg: "spack.package_base.PackageBase", pkg: "spack.package_base.PackageBase",
process: multiprocessing.Process, process: multiprocessing.Process,
read_pipe: multiprocessing.connection.Connection, read_pipe: multiprocessing.connection.Connection,
timeout: int,
): ):
""" """
Parameters: Parameters:
@ -1143,6 +1144,7 @@ def __init__(
self.pkg = pkg self.pkg = pkg
self.process = process self.process = process
self.read_pipe = read_pipe self.read_pipe = read_pipe
self.timeout = timeout
def poll(self) -> bool: def poll(self) -> bool:
"""Check if there is data available to receive from the read pipe.""" """Check if there is data available to receive from the read pipe."""
@ -1319,6 +1321,10 @@ def terminate(self):
os.kill(self.p.pid, signal.SIGKILL) os.kill(self.p.pid, signal.SIGKILL)
self.p.join() self.p.join()
@property
def pid(self):
return self.p.pid
@property @property
def exitcode(self): def exitcode(self):
return self.p.exitcode return self.p.exitcode
@ -1403,7 +1409,7 @@ def child_fun():
# Create a ProcessHandle that the caller can use to track # Create a ProcessHandle that the caller can use to track
# and complete the process started by this function. # and complete the process started by this function.
process_handle = ProcessHandle(pkg, p, read_pipe) process_handle = ProcessHandle(pkg, p, read_pipe, timeout=timeout)
return process_handle return process_handle
@ -1420,6 +1426,8 @@ def exitcode_msg(process):
typ = "exit" if handle.process.exitcode >= 0 else "signal" typ = "exit" if handle.process.exitcode >= 0 else "signal"
return f"{typ} {abs(handle.process.exitcode)}" return f"{typ} {abs(handle.process.exitcode)}"
p = handle.process
timeout = handle.timeout
p.join(timeout=timeout) p.join(timeout=timeout)
if p.is_alive(): if p.is_alive():
warnings.warn(f"Terminating process, since the timeout of {timeout}s was exceeded") warnings.warn(f"Terminating process, since the timeout of {timeout}s was exceeded")