diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2023-07-04 11:57:14 +0200 |
---|---|---|
committer | Todd Gamblin <tgamblin@llnl.gov> | 2023-08-15 15:54:37 -0700 |
commit | 1de5117ef10ecb391e7d93316c21f8792bcc6b41 (patch) | |
tree | 0808a0a9b1099f75adf5f9498869c21feac508c1 /var | |
parent | cf8f44ae5aef5b6e751ddf9f99e44712f7781de1 (diff) | |
download | spack-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')
-rw-r--r-- | var/spack/repos/duplicates.test/packages/cycle-a/package.py | 17 | ||||
-rw-r--r-- | var/spack/repos/duplicates.test/packages/cycle-b/package.py | 17 |
2 files changed, 34 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") diff --git a/var/spack/repos/duplicates.test/packages/cycle-b/package.py b/var/spack/repos/duplicates.test/packages/cycle-b/package.py new file mode 100644 index 0000000000..ef190a5649 --- /dev/null +++ b/var/spack/repos/duplicates.test/packages/cycle-b/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 CycleB(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-a", when="+cycle") |