Skip to content

Commit

Permalink
Fix issue with dependency crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Dec 7, 2023
1 parent 56a0cfc commit 260cdaf
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 11 deletions.
30 changes: 19 additions & 11 deletions src/crawler.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,21 +430,27 @@ int16_t bake_crawler_recursive(

/* Collect packages in tree before search, as it may mutate
* the tree, and cannot mutate tree while walking over it. */
int32_t count = 0;
ut_ll projects = bake_crawler_collect_projects();
do {
count = ut_ll_count(projects);

it = ut_ll_iter(projects);
while (ut_iter_hasNext(&it)) {
bake_project *project = ut_iter_next(&it);
if (project->standalone) {
continue;
}
it = ut_ll_iter(projects);
while (ut_iter_hasNext(&it)) {
bake_project *project = ut_iter_next(&it);

ut_try(
bake_crawler_walk_dependencies(
config, project, bake_crawler_lookupDependency), NULL);
}
if (project->standalone) {
continue;
}

ut_ll_free(projects);
ut_try(
bake_crawler_walk_dependencies(
config, project, bake_crawler_lookupDependency), NULL);
}

ut_ll_free(projects);
projects = bake_crawler_collect_projects();
} while (count != ut_ll_count(projects));

return 0;
error:
Expand Down Expand Up @@ -529,6 +535,8 @@ void bake_crawler_decrease_dependents(

if (!dependent->unresolved_dependencies) {
if (readyForBuild) {
ut_trace("dependencies resolved for project '%s'",
dependent->id);
ut_ll_append(readyForBuild, dependent);
}
}
Expand Down
6 changes: 6 additions & 0 deletions util/src/load.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,11 +426,17 @@ int16_t ut_locate_src(

if (ut_file_test(path) == 1) {
loaded->dev = path;
ut_trace("dev path '%s' located", path);
} else {
ut_trace("dev path '%s' not found", path);
free(path);
}
} else {
ut_trace("file '%s' with dev path not found", src);
}

free(src);

loaded->tried_src = true;

return 0;
Expand Down

0 comments on commit 260cdaf

Please sign in to comment.