summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-11-14 14:44:58 +0100
committerGitHub <noreply@github.com>2023-11-14 14:44:58 +0100
commit1255620a14afa3ad4aad681a847a3a1704141976 (patch)
treea449caf5727b0aff4d8094a7013d8dffc2816e64
parent18ebef60aab93728e26d9aa5d18450f1d6c7bbd1 (diff)
downloadspack-1255620a14afa3ad4aad681a847a3a1704141976.tar.gz
spack-1255620a14afa3ad4aad681a847a3a1704141976.tar.bz2
spack-1255620a14afa3ad4aad681a847a3a1704141976.tar.xz
spack-1255620a14afa3ad4aad681a847a3a1704141976.zip
Fix infinite recursion when computing concretization errors (#41061)
-rw-r--r--lib/spack/spack/solver/asp.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 4514bd0e96..806bbac28f 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -713,7 +713,7 @@ class ErrorHandler:
(condition_id, set_id) in which the latter idea means that the condition represented by
the former held in the condition set represented by the latter.
"""
- seen = set(seen) | set(cause)
+ seen.add(cause)
parents = [c for e, c in condition_causes if e == cause and c not in seen]
local = "required because %s " % conditions[cause[0]]
@@ -812,7 +812,14 @@ class ErrorHandler:
errors = sorted(
[(int(priority), msg, args) for priority, msg, *args in error_args], reverse=True
)
- msg = self.message(errors)
+ try:
+ msg = self.message(errors)
+ except Exception as e:
+ msg = (
+ f"unexpected error during concretization [{str(e)}]. "
+ f"Please report a bug at https://github.com/spack/spack/issues"
+ )
+ raise spack.error.SpackError(msg)
raise UnsatisfiableSpecError(msg)