From 1de5117ef10ecb391e7d93316c21f8792bcc6b41 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Tue, 4 Jul 2023 11:57:14 +0200 Subject: Improve handling of cases with cycles To avoid paying the cost of setup and of a full grounding again, move cycle detection into a separate program and check first if the solution has cycles. If it has, ground only the integrity constraint preventing cycles and solve again. --- .../repos/duplicates.test/packages/cycle-a/package.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 var/spack/repos/duplicates.test/packages/cycle-a/package.py (limited to 'var/spack/repos/duplicates.test/packages/cycle-a/package.py') diff --git a/var/spack/repos/duplicates.test/packages/cycle-a/package.py b/var/spack/repos/duplicates.test/packages/cycle-a/package.py new file mode 100644 index 0000000000..207f5aac44 --- /dev/null +++ b/var/spack/repos/duplicates.test/packages/cycle-a/package.py @@ -0,0 +1,17 @@ +# Copyright 2013-2023 Lawrence Livermore National Security, LLC and other +# Spack Project Developers. See the top-level COPYRIGHT file for details. +# +# SPDX-License-Identifier: (Apache-2.0 OR MIT) +from spack.package import * + + +class CycleA(Package): + """Package that would lead to cycles if default variant values are used""" + + homepage = "http://www.example.com" + url = "http://www.example.com/tdep-1.0.tar.gz" + + version("2.0", md5="0123456789abcdef0123456789abcdef") + + variant("cycle", default=True, description="activate cycles") + depends_on("cycle-b", when="+cycle") -- cgit v1.2.3-60-g2f50