aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-02 18:00:33 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2010-07-02 18:00:33 +0100
commit72e656ca1a79aaf34a56fb91b849ffd99c11b65f (patch)
treea2136f66f7cbb95af237fec2e7997569c3567c01
parent674ba2ec193f9eae7af8c45675dc382824f0432b (diff)
downloadpaludis-72e656ca1a79aaf34a56fb91b849ffd99c11b65f.tar.gz
paludis-72e656ca1a79aaf34a56fb91b849ffd99c11b65f.tar.xz
Build binaries first
-rw-r--r--paludis/resolver/orderer.cc42
-rw-r--r--paludis/resolver/orderer.hh4
2 files changed, 46 insertions, 0 deletions
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index 1269648..5a97f6c 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -26,6 +26,7 @@
#include <paludis/resolver/constraint.hh>
#include <paludis/resolver/strongly_connected_component.hh>
#include <paludis/resolver/resolutions_by_resolvent.hh>
+#include <paludis/resolver/resolver_functions.hh>
#include <paludis/resolver/job_lists.hh>
#include <paludis/resolver/job_list.hh>
#include <paludis/resolver/job.hh>
@@ -45,6 +46,7 @@
#include <paludis/util/make_shared_copy.hh>
#include <paludis/util/simple_visitor_cast.hh>
#include <paludis/util/tribool.hh>
+#include <paludis/util/enum_iterator.hh>
#include <paludis/environment.hh>
#include <paludis/notifier_callback.hh>
#include <tr1/unordered_set>
@@ -426,6 +428,8 @@ Orderer::resolve()
if (ignore_dependencies_from_resolvents.end() != ignore_edges_from_resolvents.find((*r)->resolvent()))
continue;
+ _add_binary_cleverness(*r);
+
EdgesFromReasonVisitor edges_from_reason_visitor(_imp->resolved->nag(), ignore_dependencies_from_resolvents, (*r)->resolvent(),
std::tr1::bind(&Orderer::_role_for_fetching, this, std::tr1::placeholders::_1));
for (Constraints::ConstIterator c((*r)->constraints()->begin()),
@@ -503,6 +507,44 @@ Orderer::resolve()
}
}
+void
+Orderer::_add_binary_cleverness(const std::tr1::shared_ptr<const Resolution> & resolution)
+{
+ if (resolution->resolvent().destination_type() != dt_create_binary)
+ return;
+
+ for (EnumIterator<DestinationType> t, t_end(last_dt) ; t != t_end ; ++t)
+ {
+ if (*t == dt_create_binary)
+ continue;
+
+ Resolvent non_binary_resolvent(resolution->resolvent());
+ non_binary_resolvent.destination_type() = *t;
+
+ if (_imp->resolved->resolutions_by_resolvent()->end() ==
+ _imp->resolved->resolutions_by_resolvent()->find(non_binary_resolvent))
+ continue;
+
+ NAGIndex from(make_named_values<NAGIndex>(
+ n::resolvent() = non_binary_resolvent,
+ n::role() = nir_done
+ ));
+
+ NAGIndex to(make_named_values<NAGIndex>(
+ n::resolvent() = resolution->resolvent(),
+ n::role() = nir_done
+ ));
+
+ _imp->resolved->nag()->add_edge(from, to,
+ make_named_values<NAGEdgeProperties>(
+ n::build() = true,
+ n::build_all_met() = false,
+ n::run() = false,
+ n::run_all_met() = true
+ ));
+ }
+}
+
namespace
{
std::string nice_index(const NAGIndex & x)
diff --git a/paludis/resolver/orderer.hh b/paludis/resolver/orderer.hh
index b944011..bbabbf8 100644
--- a/paludis/resolver/orderer.hh
+++ b/paludis/resolver/orderer.hh
@@ -28,6 +28,7 @@
#include <paludis/resolver/nag-fwd.hh>
#include <paludis/resolver/resolvent-fwd.hh>
#include <paludis/resolver/resolver_functions-fwd.hh>
+#include <paludis/resolver/resolution-fwd.hh>
#include <paludis/util/private_implementation_pattern.hh>
#include <paludis/util/tribool-fwd.hh>
#include <paludis/environment-fwd.hh>
@@ -64,6 +65,9 @@ namespace paludis
NAGIndexRole _role_for_fetching(
const Resolvent & resolvent) const PALUDIS_ATTRIBUTE((warn_unused_result));
+ void _add_binary_cleverness(
+ const std::tr1::shared_ptr<const Resolution> & resolvent);
+
public:
Orderer(
const Environment * const,