summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMassimiliano Culpo <massimiliano.culpo@gmail.com>2020-10-31 22:33:46 +0100
committerTodd Gamblin <tgamblin@llnl.gov>2020-11-17 10:04:13 -0800
commit6baa8157c70c42fc66104c4e3c57c717a989a601 (patch)
tree3c28502d70adc4321ca525f9f4ea09401cd1b357 /lib
parentccb537479a72640885b69ffaca263a5f3409f9d1 (diff)
downloadspack-6baa8157c70c42fc66104c4e3c57c717a989a601.tar.gz
spack-6baa8157c70c42fc66104c4e3c57c717a989a601.tar.bz2
spack-6baa8157c70c42fc66104c4e3c57c717a989a601.tar.xz
spack-6baa8157c70c42fc66104c4e3c57c717a989a601.zip
concretizer: set target preference for inheritance from root
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/solver/concretize.lp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp
index d6e63f3606..b97dfd7fd7 100644
--- a/lib/spack/spack/solver/concretize.lp
+++ b/lib/spack/spack/solver/concretize.lp
@@ -309,6 +309,13 @@ node_target_match_pref(Package, Target) :- node_target_set(Package, Target).
node_target_match_pref(Dependency, Target)
:- depends_on(Package, Dependency), node_target_match_pref(Package, Target),
not node_target_set(Dependency, _).
+
+node_target_match_pref(Dependency, Target)
+ :- depends_on(Package, Dependency),
+ root(Package), node_target(Package, Target),
+ not node_target_match_pref(Package, _),
+ not node_target_set(Dependency, _).
+
node_target_match(Package, 1)
:- node_target(Package, Target), node_target_match_pref(Package, Target).