diff options
author | Max Zeyen <max.zeyen@itwm.fraunhofer.de> | 2022-07-01 04:27:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-30 19:27:38 -0700 |
commit | 43654078fc1700114e7c0c2596204fb950552fdf (patch) | |
tree | 77ac18c79f54b08c85e9ccb8a62476364181ddd3 | |
parent | 8cd542529ad67870e996cdd8e9f91a03f9bdbedd (diff) | |
download | spack-43654078fc1700114e7c0c2596204fb950552fdf.tar.gz spack-43654078fc1700114e7c0c2596204fb950552fdf.tar.bz2 spack-43654078fc1700114e7c0c2596204fb950552fdf.tar.xz spack-43654078fc1700114e7c0c2596204fb950552fdf.zip |
boost: do not add the context-impl option for version below 1.65.0 (#30719)
* boost: do not access the context-impl variant for versions below 1.65.0
* boost: check if spec.variants contains context-impl
* boost: improve error message when the context-impl variant causes a conflict
Executing spack solve boost@1.63.0 +context context-impl=fcontext
triggers the following error message:
==> Error: No version for 'boost' satisfies '@1.63.0' and '@1.79.0'
With this change, the error message becomes the following:
==> Error: Cannot set variant 'context-impl' for package 'boost' because the variant condition cannot be satisfied for the given spec
-rw-r--r-- | var/spack/repos/builtin/packages/boost/package.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/var/spack/repos/builtin/packages/boost/package.py b/var/spack/repos/builtin/packages/boost/package.py index ae42e4f26b..2badcfd26c 100644 --- a/var/spack/repos/builtin/packages/boost/package.py +++ b/var/spack/repos/builtin/packages/boost/package.py @@ -215,6 +215,11 @@ class Boost(Package): depends_on('zlib', when='+iostreams') depends_on('py-numpy', when='+numpy', type=('build', 'run')) + # Improve the error message when the context-impl variant is conflicting + conflicts('context-impl=fcontext', when='@:1.65.0') + conflicts('context-impl=ucontext', when='@:1.65.0') + conflicts('context-impl=winfib', when='@:1.65.0') + # Coroutine, Context, Fiber, etc., are not straightforward. conflicts('+context', when='@:1.50') # Context since 1.51.0. conflicts('cxxstd=98', when='+context') # Context requires >=C++11. @@ -489,7 +494,7 @@ class Boost(Package): "multithreaded} must be enabled") # If we are building context, tell b2 which backend to use - if '+context' in spec: + if '+context' in spec and 'context-impl' in spec.variants: options.extend(['context-impl=%s' % spec.variants['context-impl'].value]) if '+taggedlayout' in spec: @@ -680,7 +685,7 @@ class Boost(Package): type(dependent_spec.package).cmake_args = _cmake_args def setup_dependent_build_environment(self, env, dependent_spec): - if '+context' in self.spec: + if '+context' in self.spec and 'context-impl' in self.spec.variants: context_impl = self.spec.variants['context-impl'].value # fcontext, as the default, has no corresponding macro if context_impl == 'ucontext': |