aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKaren Arutyunov <karen@codesynthesis.com>2022-06-01 13:23:53 +0300
committerKaren Arutyunov <karen@codesynthesis.com>2022-06-01 18:50:43 +0300
commit75241c122c96163d81811f3f3189093f79b0dbe9 (patch)
treea71e2462573aa8928650e0542a54d71ee6b2c8a0
parent4a1c82abe5e414defb462285705faacf6df6e053 (diff)
Fail for maual configuring dependents with configuration clauses in pkg-configure
-rw-r--r--bpkg/pkg-configure.cxx20
1 files changed, 19 insertions, 1 deletions
diff --git a/bpkg/pkg-configure.cxx b/bpkg/pkg-configure.cxx
index 7c0f4bc..d797d65 100644
--- a/bpkg/pkg-configure.cxx
+++ b/bpkg/pkg-configure.cxx
@@ -76,6 +76,19 @@ namespace bpkg
size_t>,
2> edas;
+ // If the dependency alternatives are not pre-selected, then evaluate
+ // the enable clauses.
+ //
+ // Note that evaluating the require and prefer clauses in this case is
+ // meaningless since we don't reconfigure the dependencies nor negotiate
+ // configurations with other dependents. What we should probably do is
+ // to load configurations of the dependencies and use them while
+ // evaluating the dependent's enable and reflect clauses as we go
+ // along. Probably we should still evaluate the accept clauses to make
+ // sure that the dependency is configured acceptably for the
+ // dependent. However, let's keep it simple for now and support this
+ // later.
+ //
if (alts == nullptr)
{
if (toolchain_buildtime_dependency (o, das, &ps.name ()))
@@ -86,7 +99,13 @@ namespace bpkg
const dependency_alternative& da (das[i]);
if (!da.enable || ps.evaluate_enable (*da.enable, di))
+ {
+ if (da.prefer || da.require)
+ fail << "manual configuration of dependents with prefer or "
+ << "require clauses is not yet supported";
+
edas.push_back (make_pair (ref (da), i));
+ }
}
if (edas.empty ())
@@ -101,7 +120,6 @@ namespace bpkg
edas.push_back (make_pair (ref (das.front ()), (*alts)[di]));
}
-
// Pick the first alternative with dependencies that can all be resolved
// to the configured packages, satisfying the respective constraints.
//