aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-03 23:30:24 +0100
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2011-09-03 23:30:24 +0100
commit989e826f9820e73fa2a7c3e6254eb38bbcbe9dac (patch)
tree962d3b003f8f68e8340942b7c2dae07e9ff82262
parentb57878f111aa8000e9a3400494025d5e47b44f9d (diff)
downloadpaludis-989e826f9820e73fa2a7c3e6254eb38bbcbe9dac.tar.gz
paludis-989e826f9820e73fa2a7c3e6254eb38bbcbe9dac.tar.xz
Self run cycles shouldn't prevent binary creation
-rw-r--r--paludis/resolver/orderer.cc12
-rw-r--r--paludis/resolver/resolver_TEST_binaries.cc27
-rwxr-xr-xpaludis/resolver/resolver_TEST_binaries_setup.sh19
3 files changed, 55 insertions, 3 deletions
diff --git a/paludis/resolver/orderer.cc b/paludis/resolver/orderer.cc
index b4dd4ca..58e4cc1 100644
--- a/paludis/resolver/orderer.cc
+++ b/paludis/resolver/orderer.cc
@@ -309,13 +309,23 @@ namespace
from = from_bin;
}
+ /* ticket:1174: making binaries with self run dependencies */
+ bool override_run_all_met(false);
+ if (to.resolvent().destination_type() != dt_create_binary &&
+ from.resolvent().destination_type() == dt_create_binary &&
+ from.resolvent().package() == to.resolvent().package() &&
+ from.resolvent().slot() == to.resolvent().slot())
+ {
+ override_run_all_met = true;
+ }
+
nag->add_edge(from, to,
make_named_values<NAGEdgeProperties>(
n::always() = false,
n::build() = classifier->includes_buildish,
n::build_all_met() = r.already_met().is_true() || ! classifier->includes_buildish,
n::run() = classifier->includes_non_post_runish,
- n::run_all_met() = r.already_met().is_true() || ! classifier->includes_non_post_runish
+ n::run_all_met() = override_run_all_met || r.already_met().is_true() || ! classifier->includes_non_post_runish
));
}
else
diff --git a/paludis/resolver/resolver_TEST_binaries.cc b/paludis/resolver/resolver_TEST_binaries.cc
index c402692..4b8fe1b 100644
--- a/paludis/resolver/resolver_TEST_binaries.cc
+++ b/paludis/resolver/resolver_TEST_binaries.cc
@@ -71,12 +71,37 @@ namespace
};
}
+TEST_F(ResolverBinariesTestCase, SelfBuildBinary)
+{
+ std::shared_ptr<const Resolved> resolved(data->get_resolved("self-build-binary/target"));
+
+ check_resolved(resolved,
+ n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .change(QualifiedPackageName("self-build-binary/target"))
+ .finished()),
+ n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::taken_unconfirmed_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::taken_unorderable_decisions() = make_shared_copy(DecisionChecks()
+ .change(QualifiedPackageName("self-build-binary/dep"))
+ .change(QualifiedPackageName("self-build-binary/dep"))
+ .finished()),
+ n::untaken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .finished()),
+ n::untaken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
+ .finished())
+ );
+}
+
TEST_F(ResolverBinariesTestCase, SelfRunBinary)
{
std::shared_ptr<const Resolved> resolved(data->get_resolved("self-run-binary/target"));
check_resolved(resolved,
n::taken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
+ .change(QualifiedPackageName("self-run-binary/dep"))
+ .change(QualifiedPackageName("self-run-binary/dep"))
.change(QualifiedPackageName("self-run-binary/target"))
.finished()),
n::taken_unable_to_make_decisions() = make_shared_copy(DecisionChecks()
@@ -84,8 +109,6 @@ TEST_F(ResolverBinariesTestCase, SelfRunBinary)
n::taken_unconfirmed_decisions() = make_shared_copy(DecisionChecks()
.finished()),
n::taken_unorderable_decisions() = make_shared_copy(DecisionChecks()
- .change(QualifiedPackageName("self-run-binary/dep"))
- .change(QualifiedPackageName("self-run-binary/dep"))
.finished()),
n::untaken_change_or_remove_decisions() = make_shared_copy(DecisionChecks()
.finished()),
diff --git a/paludis/resolver/resolver_TEST_binaries_setup.sh b/paludis/resolver/resolver_TEST_binaries_setup.sh
index 017ca1e..0f6a8cb 100755
--- a/paludis/resolver/resolver_TEST_binaries_setup.sh
+++ b/paludis/resolver/resolver_TEST_binaries_setup.sh
@@ -22,6 +22,25 @@ cd repo
echo "repo" > profiles/repo_name
: > metadata/categories.conf
+# self-build-binary
+echo 'self-build-binary' >> metadata/categories.conf
+
+mkdir -p 'packages/self-build-binary/target'
+cat <<END > packages/self-build-binary/target/target-1.exheres-0
+SUMMARY="target"
+PLATFORMS="test"
+SLOT="0"
+DEPENDENCIES="build+run: self-build-binary/dep"
+END
+
+mkdir -p 'packages/self-build-binary/dep'
+cat <<END > packages/self-build-binary/dep/dep-1.exheres-0
+SUMMARY="dep"
+PLATFORMS="test"
+SLOT="0"
+DEPENDENCIES="build: self-build-binary/dep"
+END
+
# self-run-binary
echo 'self-run-binary' >> metadata/categories.conf