diff --git a/lib/spack/spack/bootstrap/environment.py b/lib/spack/spack/bootstrap/environment.py index f2240da8ea5..fa94489747a 100644 --- a/lib/spack/spack/bootstrap/environment.py +++ b/lib/spack/spack/bootstrap/environment.py @@ -92,7 +92,7 @@ def update_installations(self) -> None: tty.msg(f"[BOOTSTRAPPING] Installing dependencies ({', '.join(colorized_specs)})") self.write(regenerate=False) with tty.SuppressOutput(msg_enabled=log_enabled, warn_enabled=log_enabled): - self.install_all() + self.install_all(fail_fast=True) self.write(regenerate=True) def load(self) -> None: diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index efe5fe5e187..16ac3cb4ef5 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -1133,6 +1133,7 @@ def __init__( pkg: "spack.package_base.PackageBase", process: multiprocessing.Process, read_pipe: multiprocessing.connection.Connection, + timeout: int, ): """ Parameters: @@ -1143,6 +1144,7 @@ def __init__( self.pkg = pkg self.process = process self.read_pipe = read_pipe + self.timeout = timeout def poll(self) -> bool: """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) self.p.join() + @property + def pid(self): + return self.p.pid + @property def exitcode(self): return self.p.exitcode @@ -1403,7 +1409,7 @@ def child_fun(): # Create a ProcessHandle that the caller can use to track # 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 @@ -1420,6 +1426,8 @@ def exitcode_msg(process): typ = "exit" if handle.process.exitcode >= 0 else "signal" return f"{typ} {abs(handle.process.exitcode)}" + p = handle.process + timeout = handle.timeout p.join(timeout=timeout) if p.is_alive(): warnings.warn(f"Terminating process, since the timeout of {timeout}s was exceeded")