diff options
author | Massimiliano Culpo <massimiliano.culpo@gmail.com> | 2022-02-02 19:05:24 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-02 10:05:24 -0800 |
commit | cd04109e175fdc8223a5d922c7d3995496a23936 (patch) | |
tree | aab081d7a405efd3a58e3b6a4f665f9bfb247c1e /var | |
parent | dd7acecf3d3385458713163a20e5491108f3e4e3 (diff) | |
download | spack-cd04109e175fdc8223a5d922c7d3995496a23936.tar.gz spack-cd04109e175fdc8223a5d922c7d3995496a23936.tar.bz2 spack-cd04109e175fdc8223a5d922c7d3995496a23936.tar.xz spack-cd04109e175fdc8223a5d922c7d3995496a23936.zip |
Add a "sticky" property to variants (#28630)
* Add sticky variants
* Add unit tests for sticky variants
* Add documentation for sticky variants
* Revert "Revert 19736 because conflicts are avoided by clingo by default (#26721)"
This reverts commit 33ef7d57c1a09d6ce454503e9ff5638747e4f4a2.
* Add stickiness to "allow-unsupported-compiler"
Diffstat (limited to 'var')
-rw-r--r-- | var/spack/repos/builtin.mock/packages/sticky-variant/package.py | 18 | ||||
-rw-r--r-- | var/spack/repos/builtin/packages/cuda/package.py | 2 |
2 files changed, 20 insertions, 0 deletions
diff --git a/var/spack/repos/builtin.mock/packages/sticky-variant/package.py b/var/spack/repos/builtin.mock/packages/sticky-variant/package.py new file mode 100644 index 0000000000..a1fea2d531 --- /dev/null +++ b/var/spack/repos/builtin.mock/packages/sticky-variant/package.py @@ -0,0 +1,18 @@ +# Copyright 2013-2022 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 import * + + +class StickyVariant(AutotoolsPackage): + """Package with a sticky variant and a conflict""" + + homepage = "http://www.example.com" + url = "http://www.example.com/a-1.0.tar.gz" + + version('1.0', '0123456789abcdef0123456789abcdef') + + variant('allow-gcc', description='', default=False, sticky=True) + + conflicts('%gcc', when='~allow-gcc') diff --git a/var/spack/repos/builtin/packages/cuda/package.py b/var/spack/repos/builtin/packages/cuda/package.py index 378a9b0295..aa76935965 100644 --- a/var/spack/repos/builtin/packages/cuda/package.py +++ b/var/spack/repos/builtin/packages/cuda/package.py @@ -144,6 +144,8 @@ class Cuda(Package): conflicts('arch=darwin-mojave-x86_64') variant('dev', default=False, description='Enable development dependencies, i.e to use cuda-gdb') + variant('allow-unsupported-compilers', default=False, sticky=True, + description='Allow unsupported host compiler and CUDA version combinations') depends_on('libxml2', when='@10.1.243:') # cuda-gdb needed libncurses.so.5 before 11.4.0 |