summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/spack/spack/solver/asp.py2
-rw-r--r--lib/spack/spack/solver/concretize.lp3
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/spack/spack/solver/asp.py b/lib/spack/spack/solver/asp.py
index 88c2897e20..5fed553080 100644
--- a/lib/spack/spack/solver/asp.py
+++ b/lib/spack/spack/solver/asp.py
@@ -1570,6 +1570,8 @@ class SpackSolverSetup(object):
if reuse:
self.gen.h1("Installed packages")
+ self.gen.fact(fn.optimize_for_reuse())
+ self.gen.newline()
self.define_installed_packages(possible)
self.gen.h1('General Constraints')
diff --git a/lib/spack/spack/solver/concretize.lp b/lib/spack/spack/solver/concretize.lp
index efd364dd92..00c4100a58 100644
--- a/lib/spack/spack/solver/concretize.lp
+++ b/lib/spack/spack/solver/concretize.lp
@@ -794,7 +794,8 @@ build(Package) :- not hash(Package, _), node(Package).
% Try hard to reuse installed packages (i.e., minimize the number built)
opt_criterion(16, "number of packages to build (vs. reuse)").
#minimize { 0@16: #true }.
-#minimize { 1@16,Package : build(Package) }.
+#minimize { 1@16,Package : build(Package), optimize_for_reuse() }.
+#defined optimize_for_reuse/0.
% Minimize the number of deprecated versions being used
opt_criterion(15, "deprecated versions used").