From b7c064142e6e4beb960aa979815471c3889ec925 Mon Sep 17 00:00:00 2001 From: Benedikt Hegner Date: Wed, 27 Apr 2016 01:23:53 +0200 Subject: preserve lookup order in PATH when invoking 'spack compiler add' --- lib/spack/spack/compiler.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/spack/spack/compiler.py b/lib/spack/spack/compiler.py index d38c0b00b1..2f89ec6144 100644 --- a/lib/spack/spack/compiler.py +++ b/lib/spack/spack/compiler.py @@ -202,6 +202,10 @@ class Compiler(object): return None successful = [key for key in parmap(check, checks) if key is not None] + # The 'successful' list is ordered like the input paths. + # Reverse it here so that the dict creation (last insert wins) + # does not spoil the intented precedence. + successful.reverse() return dict(((v, p, s), path) for v, p, s, path in successful) @classmethod -- cgit v1.2.3-60-g2f50