@@ -468,6 +468,11 @@ static an<ConfigItem> ResolveReference(ConfigCompiler* compiler,
468
468
if (!resource) {
469
469
DLOG (INFO) << " resource not loaded, compiling: " << reference.resource_id ;
470
470
resource = compiler->Compile (reference.resource_id );
471
+ // dependency doesn't require full resolution, this allows non conflicting
472
+ // mutual references between config files.
473
+ // this call is made even if resource is not loaded because plugins can
474
+ // edit the empty config data, adding new dependencies.
475
+ ResolveBlockingDependencies (compiler, reference.resource_id + " :" );
471
476
if (!resource->loaded ) {
472
477
if (reference.optional ) {
473
478
LOG (INFO) << " optional resource not loaded: " << reference.resource_id ;
@@ -557,10 +562,11 @@ bool ConfigCompiler::Link(an<ConfigResource> target) {
557
562
558
563
bool ConfigCompiler::ResolveDependencies (const string& path) {
559
564
DLOG (INFO) << " ResolveDependencies(" << path << " )" ;
560
- if (!graph_->deps .count (path)) {
565
+ auto found = graph_->deps .find (path);
566
+ if (found == graph_->deps .end ()) {
561
567
return true ;
562
568
}
563
- auto & deps = graph_-> deps [path] ;
569
+ auto & deps = found-> second ;
564
570
for (auto iter = deps.begin (); iter != deps.end (); ) {
565
571
if (!(*iter)->Resolve (this )) {
566
572
LOG (ERROR) << " unresolved dependency: " << **iter;
0 commit comments