Commit 55c82a59 authored by Johan Ouwerkerk's avatar Johan Ouwerkerk
Browse files

Fix kdesrc-buid to consider 'special' dependencies configured in kdesrc-build.rc

 - Adjust the dependency resolver to no longer suppress 'special' dependencies if they can be built
 - Adjust the main application to determine which special dependencies have been configured through kdesrc-build.rc

Fixes: #19
BUG: 404484
parent 73d2b494
Pipeline #1129 passed with stage
in 1 minute and 1 second
......@@ -453,13 +453,16 @@ sub generateModuleList
$self->_defineNewModuleFactory($moduleResolver);
my @rcFileModules = $moduleResolver->expandModuleSets(@optionModulesAndSets);
my @specialDependencies = ksb::DependencyResolver::filterSpecialDependencies(@rcFileModules);
my @modules;
if ($commandLineModules) {
@modules = $moduleResolver->resolveSelectorsIntoModules(@selectors);
}
else {
# Build everything in the rc-file, in the order specified.
@modules = $moduleResolver->expandModuleSets(@optionModulesAndSets);
@modules = @rcFileModules;
if ($ctx->getOption('kde-languages')) {
@modules = _expandl10nModules($ctx, @modules);
......@@ -490,7 +493,7 @@ sub generateModuleList
(!defined $branch or $branch); # This is the actual test
} (@modules);
@modules = $self->_resolveModuleDependencies(@modules);
@modules = $self->_resolveModuleDependencies(\@modules, \@specialDependencies);
# Filter --resume-foo options. This might be a second pass, but that should
# be OK since there's nothing different going on from the first pass (in
......@@ -572,10 +575,11 @@ sub _downloadKDEProjectMetadata
# arguments.
sub _resolveModuleDependencies
{
my $self = shift;
my ($self, $modulesRef, $specialModulesRef) = @_;
my $ctx = $self->context();
my $metadataModule = $ctx->getKDEDependenciesMetadataModule();
my @modules = @_;
my @modules = @{ $modulesRef };
my @specialModules = @{ $specialModulesRef };
@modules = eval {
my $dependencyResolver = ksb::DependencyResolver->new($self->{module_factory});
......@@ -588,7 +592,7 @@ sub _resolveModuleDependencies
or die "Unable to open $dependencyFile: $!";
debug (" -- Reading dependencies from $dependencyFile");
$dependencyResolver->readDependencyData($dependencies);
$dependencyResolver->readDependencyData($dependencies, @specialModules);
close $dependencies;
}
......
......@@ -227,6 +227,7 @@ sub readDependencyData
{
my $self = assert_isa(shift, 'ksb::DependencyResolver');
my $fh = shift;
my @specialModules = @_;
my $dependenciesOfRef = $self->{dependenciesOf};
my $dependencyAtom =
......@@ -266,15 +267,21 @@ sub readDependencyData
next;
}
# Ignore deps on Qt, since we allow system Qt.
next if $sourceItem =~ /^\s*Qt/ || $dependentItem =~ /^\s*Qt/;
#
# assume there are system-wide versions for certain 'special'
# dependencies by default. In those cases, ignore dependency data
# by defaul unless we think we can actually build them,
# i.e. the modules are whitelisted in @specialModules
#
next if _suppressSpecialDependency($sourceItem, @specialModules) ||
_suppressSpecialDependency($dependentItem, @specialModules);
$dependentBranch ||= '*'; # If no branch, apply catch-all flag
$sourceBranch ||= '*';
# Source can never be a catch-all so we can shorten early. Also,
# we *must* shorten early to avoid a dependency on a long path.
$sourceItem = _shortenModuleName($sourceItem);
$sourceItem = _shortenModuleName($sourceItem);
# Handle catch-all dependent groupings
if ($dependentItem =~ /\*$/) {
......
......@@ -17,7 +17,8 @@ package ksb::Application {
no warnings 'redefine';
sub _resolveModuleDependencies {
my ($self, @modules) = @_;
my ($self, $modulesRef, $specialModulesRef) = @_;
my @modules = @{ $modulesRef };
# simulate effect of --include-dependencies, using ksb::Application's
# built-in module-name to ksb::Module resolver.
my $newModule = $self->{module_factory}->('setmod2');
......
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