summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd Gamblin <tgamblin@llnl.gov>2016-03-10 21:50:40 -0800
committerTodd Gamblin <tgamblin@llnl.gov>2016-03-10 21:50:40 -0800
commitf40c78a06448bc0c7998b24b3e2161f63a7680bc (patch)
treee73229812566e618643dbafb2f36537a23ab6dca /lib
parent30df1c838dcdcae341d743473b69f642358ceb14 (diff)
parentac88cab68ffa16d4ff448de5f186d746cb36b40a (diff)
downloadspack-f40c78a06448bc0c7998b24b3e2161f63a7680bc.tar.gz
spack-f40c78a06448bc0c7998b24b3e2161f63a7680bc.tar.bz2
spack-f40c78a06448bc0c7998b24b3e2161f63a7680bc.tar.xz
spack-f40c78a06448bc0c7998b24b3e2161f63a7680bc.zip
Merge pull request #532 from mplegendre/bugfix/ordering_satisfies
Fix issue with preferred satisfies not being respected
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/concretize.py17
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/spack/spack/concretize.py b/lib/spack/spack/concretize.py
index bad67c34e3..2268084e56 100644
--- a/lib/spack/spack/concretize.py
+++ b/lib/spack/spack/concretize.py
@@ -70,20 +70,23 @@ class DefaultConcretizer(object):
# For each candidate package, if it has externals add those to the candidates
# if it's a nobuild, then only add the externals.
- result = []
+ candidates = []
all_compilers = spack.compilers.all_compilers()
for pkg in packages:
externals = spec_externals(pkg)
buildable = not is_spec_nobuild(pkg)
if buildable:
- result.append((pkg, None))
+ candidates.append((pkg, None))
for ext in externals:
if ext[0].satisfies(spec):
- result.append(ext)
- if not result:
+ candidates.append(ext)
+ if not candidates:
raise NoBuildError(spec)
def cmp_externals(a, b):
+ if a[0].name != b[0].name:
+ #We're choosing between different providers. Maintain order from above sort
+ return candidates.index(a) - candidates.index(b)
result = cmp_specs(a[0], b[0])
if result != 0:
return result
@@ -91,10 +94,10 @@ class DefaultConcretizer(object):
return 1
if not b[1] and a[1]:
return -1
- return cmp_specs(a[1], b[1])
+ return cmp(a[1], b[1])
- result = sorted(result, cmp=cmp_externals)
- return result
+ candidates = sorted(candidates, cmp=cmp_externals)
+ return candidates
def concretize_virtual_and_external(self, spec):