summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2021-10-14 12:33:10 +0200
committerGitHub <noreply@github.com>2021-10-14 12:33:10 +0200
commit949094544e479439e76581125a70c9c3c23cf997 (patch)
tree2518535fed5a8b45ab2d0269d420b0e0be781937 /var
parent2c3ea68dd1450c7dd9ab68e7c2e69b11a72c115d (diff)
downloadspack-949094544e479439e76581125a70c9c3c23cf997.tar.gz
spack-949094544e479439e76581125a70c9c3c23cf997.tar.bz2
spack-949094544e479439e76581125a70c9c3c23cf997.tar.xz
spack-949094544e479439e76581125a70c9c3c23cf997.zip
Constrain abstract specs rather than concatenating strings in the "when" context manager (#26700)
Using the Spec.constrain method doesn't work since it might trigger a repository lookup which could break our directives and triggers a circular import error. To fix that we introduce a function to merge abstract anonymous specs, based only on package names, which does not perform any lookup in the repository.
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin.mock/packages/with-constraint-met/package.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/var/spack/repos/builtin.mock/packages/with-constraint-met/package.py b/var/spack/repos/builtin.mock/packages/with-constraint-met/package.py
index 00c786f0b9..137e0be862 100644
--- a/var/spack/repos/builtin.mock/packages/with-constraint-met/package.py
+++ b/var/spack/repos/builtin.mock/packages/with-constraint-met/package.py
@@ -17,4 +17,7 @@ class WithConstraintMet(Package):
with when('@1.0'):
depends_on('b')
- conflicts('%gcc')
+ conflicts('%gcc', when='+foo')
+
+ with when('@0.14: ^b@:4.0'):
+ depends_on('c', when='@:15 ^b@3.8:')