From 856c55d0f8c50d0f371a546e4231e0f415975690 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Thu, 16 Jun 2022 09:43:32 +0200 Subject: Initial support for negotiation with system dependencies --- bpkg/package-configuration.cxx | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'bpkg/package-configuration.cxx') diff --git a/bpkg/package-configuration.cxx b/bpkg/package-configuration.cxx index 3c4fd44..688d202 100644 --- a/bpkg/package-configuration.cxx +++ b/bpkg/package-configuration.cxx @@ -118,6 +118,8 @@ namespace bpkg pair pos, const small_vector, 1>& depcs) { + assert (!dept.system); + pos.first--; pos.second--; // Convert to 0-base. const dependency_alternative& da ( @@ -197,6 +199,11 @@ namespace bpkg // based on the values of other configuration variables (we have a note // in the manual instructing the user not to do this). // + // The dependency could also be system in which case there could be no + // skeleton information to load the types/defaults from. In this case we + // can handle require in the "lax mode" (based on the above assumptions) + // but not prefer. + // // While at it, also collect the configurations to pass to dependent's // evaluate_*() calls. // @@ -228,6 +235,31 @@ namespace bpkg } } + if (depc.available == nullptr) + { + assert (depc.system); + + if (da.prefer) + fail << "unable to negotiate configuration for system dependency " + << depc.key << " without configuration information" << + info << "consider specifying system dependency version that has " + << "corresponding available package" << + info << "dependent " << dept.key << " has prefer/accept clauses " + << "that cannot be evaluated without configuration information"; + + if (!cfg.system) + { + // Note that we still need the overrides. + // + depc.load_overrides (cfg); + cfg.system = true; + } + + continue; + } + else + assert (!cfg.system); + if (da.prefer || cfg.empty ()) depc.reload_defaults (cfg); } -- cgit v1.1