This commit is contained in:
kshea21 2025-01-06 18:03:47 -08:00 committed by Gregory Becker
parent 0808fd1a44
commit 03a3546f14
No known key found for this signature in database
GPG Key ID: 2362541F6D14ED84

View File

@ -868,7 +868,7 @@ class Task:
"""Base class for representing a task for a package.""" """Base class for representing a task for a package."""
success_result: Optional[ExecuteResult] = None success_result: Optional[ExecuteResult] = None
error_result: Optional[spack.error.InstallError] = None error_result: Optional[BaseException] = None
def __init__( def __init__(
self, self,
@ -1155,7 +1155,7 @@ def start(self):
dependency represented by the BuildTask.""" dependency represented by the BuildTask."""
assert not self.started, "Cannot start a task that has already been started." assert not self.started, "Cannot start a task that has already been started."
self.started = True self.started = True
install_args = self.request.install_args install_args = self.request.install_args
unsigned = install_args.get("unsigned") unsigned = install_args.get("unsigned")
pkg, pkg_id = self.pkg, self.pkg_id pkg, pkg_id = self.pkg, self.pkg_id
@ -2255,7 +2255,7 @@ def complete_task(task) -> None:
# this overrides a full method, which is ugly. # this overrides a full method, which is ugly.
task.use_cache = False # type: ignore[misc] task.use_cache = False # type: ignore[misc]
self._requeue_task(task, install_status) self._requeue_task(task, install_status)
return True return None
except (Exception, SystemExit) as exc: except (Exception, SystemExit) as exc:
self._update_failed(task, True, exc) self._update_failed(task, True, exc)
@ -2302,15 +2302,15 @@ def complete_task(task) -> None:
if not task: if not task:
# no ready tasks # no ready tasks
break break
try: try:
# Attempt to start the task's package installation # Attempt to start the task's package installation
start_task(task) start_task(task)
except BaseException as e: except BaseException as e:
# Delegating any exception that happens in start_task() to be # Delegating any exception that happens in start_task() to be
# handled in complete_task() # handled in complete_task()
task.error_result = e task.error_result = e
time.sleep(0.1) time.sleep(0.1)
# Check if any tasks have completed and add to list # Check if any tasks have completed and add to list
done = [task for task in active_tasks if task.poll()] done = [task for task in active_tasks if task.poll()]