summaryrefslogtreecommitdiff
path: root/var/spack/repos/duplicates.test/packages/cycle-a/package.py
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2023-07-04 11:57:14 +0200
committerTodd Gamblin <tgamblin@llnl.gov>2023-08-15 15:54:37 -0700
commit1de5117ef10ecb391e7d93316c21f8792bcc6b41 (patch)
tree0808a0a9b1099f75adf5f9498869c21feac508c1 /var/spack/repos/duplicates.test/packages/cycle-a/package.py
parentcf8f44ae5aef5b6e751ddf9f99e44712f7781de1 (diff)
downloadspack-1de5117ef10ecb391e7d93316c21f8792bcc6b41.tar.gz
spack-1de5117ef10ecb391e7d93316c21f8792bcc6b41.tar.bz2
spack-1de5117ef10ecb391e7d93316c21f8792bcc6b41.tar.xz
spack-1de5117ef10ecb391e7d93316c21f8792bcc6b41.zip
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.
Diffstat (limited to 'var/spack/repos/duplicates.test/packages/cycle-a/package.py')
-rw-r--r--var/spack/repos/duplicates.test/packages/cycle-a/package.py17
1 files changed, 17 insertions, 0 deletions
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")