diff --git a/lib/spack/spack/build_environment.py b/lib/spack/spack/build_environment.py index 67b00c67494..7046c81c2fb 100644 --- a/lib/spack/spack/build_environment.py +++ b/lib/spack/spack/build_environment.py @@ -553,6 +553,11 @@ def child_execution(child_connection, input_stream): setup_package(pkg, dirty=dirty) function(input_stream) child_connection.send(None) + except StopIteration as e: + # StopIteration is used to stop installations + # before the final stage, mainly for debug purposes + tty.msg(e.message) + child_connection.send(None) except: # catch ANYTHING that goes wrong in the child process exc_type, exc, tb = sys.exc_info()