From 66813460c0777a4a2bbeb071db3cd7318f382811 Mon Sep 17 00:00:00 2001 From: Massimiliano Culpo Date: Mon, 22 Jan 2024 22:18:00 +0100 Subject: Add syntactic sugar for "strong preferences" and "conflicts" (#41832) Currently requirements allow to express "strong preferences" and "conflicts" from configuration using a convoluted syntax: ```yaml packages: zlib-ng: require: # conflict on %clang - one_of: ["%clang", "@:"] # Strong preference for +shared - any_of: ["+shared", "@:"] ``` This PR adds syntactic sugar so that the same can be written as: ```yaml packages: zlib-ng: conflict: - "%clang" prefer: - "+shared" ``` Preferences written in this way are "stronger" that the ones documented at: - https://spack.readthedocs.io/en/latest/packages_yaml.html#package-preferences --- share/spack/gitlab/cloud_pipelines/stacks/e4s-cray-rhel/spack.yaml | 4 ++-- share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'share') diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-cray-rhel/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-cray-rhel/spack.yaml index 5cd3178d66..6316f16839 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-cray-rhel/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-cray-rhel/spack.yaml @@ -10,8 +10,8 @@ spack: packages: all: - require: - - any_of: ["%cce", "@:"] # cce as a strong preference; not all packages support it + prefer: + - "%cce" compiler: [cce] providers: blas: [cray-libsci] diff --git a/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml b/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml index d4cd5e7b8a..3bcd31f808 100644 --- a/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml +++ b/share/spack/gitlab/cloud_pipelines/stacks/e4s-oneapi/spack.yaml @@ -8,8 +8,9 @@ spack: packages: all: require: - - any_of: ["%oneapi", "@:"] # oneapi as a strong preference; not all packages support it - "target=x86_64_v3" + prefer: + - "%oneapi" providers: blas: [openblas] mpi: [mpich] -- cgit v1.2.3-70-g09d2