Commit 00173c09 authored by Johan Ouwerkerk's avatar Johan Ouwerkerk
Browse files

Add a work-around for well known cycles in kde-build-metadata.

Relates to: #22
parent 55c82a59
Pipeline #1132 passed with stage
in 1 minute and 2 seconds
......@@ -506,6 +506,42 @@ sub _visitModuleAndDependencies
return;
}
#
# Work around broken kde-build-metadata: list well-known circular dependencies.
#
our @WELL_KNOWN_CIRCULAR_DEPENDENCIES = ('Qt5', 'extra-cmake-modules');
# Function: _isWellKnownCycle
#
# Internal:
#
# Unfortunately kde-build-metadata dependency data contains cycles. This
# function tests if a given circular dependency is part of a well-known cycle.
# Use it to short-circuit cycle detection in the dependency sorting logic.
#
# Parameters:
# item - the circular dependency to check
#
# Returns:
#
# A truthy value if the given dependency name is known to be a circular
# dependency in some well-known kde-build-metadata dependency cycle.
#
sub _isWellKnownCycle
{
my $item = shift;
for my $cycle (@WELL_KNOWN_CIRCULAR_DEPENDENCIES)
{
if ($cycle eq $item)
{
return 1;
}
}
return 0;
}
# Function: visitDependencyItemAndDependencies
#
# Internal:
......@@ -567,6 +603,11 @@ sub _visitDependencyItemAndDependencies
# But if the value is 2 that means we've detected a cycle.
if ($visitedItemsRef->{$item} == 1) {
if (_isWellKnownCycle($item)) {
debug("dep-resolv: Ignoring well known cycle: ", (' ' x $level), "$item");
return;
}
croak_internal("Somehow there is a dependency cycle involving $item! :(");
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment