Make iteration order of versions deterministic to ensure default version

This commit is contained in:
Dominic Kempf 2020-05-19 14:54:15 +02:00
parent 282c955e21
commit bcecb661e0
1 changed files with 8 additions and 6 deletions

View File

@ -33,11 +33,13 @@ class Dune(CMakePackage):
git = "https://gitlab.dune-project.org/core/dune-common.git"
# This defines a mapping of available versions of the dune Spack package
# and the branch name in the Dune repositories this refers to.
dune_versions_to_branch = {
"master" : "master",
"2.7" : "releases/2.7",
}
# and the branch name in the Dune repositories this refers to. This is a
# list instead of a dictionary to ensure iteration order (first entry is
# the default version) in Python3.
dune_versions_to_branch = [
("2.7", "releases/2.7"),
("master" , "master"),
]
# Variants for the general build process
variant('shared', default=True, description='Enables the build of shared libraries.')
@ -89,7 +91,7 @@ class Dune(CMakePackage):
# Iterate over all available Dune versions and define resources for all Dune modules
# If a Dune module behaves differently for different versions (e.g. dune-python got
# merged into dune-common post-2.7), define the resource outside of this loop.
for vers, branch in dune_versions_to_branch.items():
for vers, branch in dune_versions_to_branch:
version(vers, branch=branch)
resource(