[kdesrc-build/make_it_mojo] /: Merge remote-tracking branch 'origin/master' into make_it_mojo
Michael Pyne
null at kde.org
Sun Jan 12 21:24:17 GMT 2020
Git commit 9253a70da06fa0f60e3b03428a8c4139f82d1fdd by Michael Pyne.
Committed on 12/01/2020 at 21:21.
Pushed by mpyne into branch 'make_it_mojo'.
Merge remote-tracking branch 'origin/master' into make_it_mojo
t/smoke/bug-394497-ignore-dep-module.t is known to fail since it doesn't
work in this branch but I want to address that as a separate commit.
Conflicts:
modules/ksb/Application.pm
modules/ksb/BuildSystem.pm
modules/ksb/BuildSystem/KDE4.pm
modules/ksb/DependencyResolver.pm
t/smoke/bug-394497-ignore-dep-module.t
M +2 -1 CMakeLists.txt
M +22 -1 doc/index.docbook
M +2 -2 modules/ksb/BuildContext.pm
M +12 -5 modules/ksb/BuildSystem.pm
M +164 -7 modules/ksb/BuildSystem/KDE4.pm
M +4 -1 modules/ksb/ModuleResolver.pm
M +1 -1 modules/ksb/ModuleSet/KDEProjects.pm
M +42 -23 t/smoke/bug-394497-ignore-dep-module.t
M +10 -3 t/smoke/read-module-options.t
https://invent.kde.org/kde/kdesrc-build/commit/9253a70da06fa0f60e3b03428a8c4139f82d1fdd
diff --cc doc/index.docbook
index ba26841,3b95bfe..098d305
--- a/doc/index.docbook
+++ b/doc/index.docbook
@@@ -1936,10 -1934,32 +1937,24 @@@ change at all.</para></important
<row id="conf-checkout-only">
<entry>checkout-only</entry>
<entry>Module setting overrides global</entry>
-<entry><para>Set this option to checkout &subversion; sources piece by piece. The
-value for this option should be a space-separated list of directories to
-checkout. Although this option overrides the global option, be aware that
-setting this as a global option makes no sense.
-</para>
-
-<para>Note that this setting has no effect on &git; modules due to the
-operation of the &git; source control system.</para>
-
-<para>See <xref linkend="checking-out-parts"/> for an example.</para></entry>
+<entry><para>This option has been removed in &kdesrc-build; 18.10, as the use
+cases it supported are no longer significant issues for &kde; contributors.</para></entry>
</row>
+ <row id="conf-cmake-generator">
+ <entry>cmake-generator</entry>
+ <entry>Module setting overrides global</entry>
+ <entry><para>Use this option to specify which generator to use with &cmake;.
+ Currently both <literal>Ninja</literal> and <literal>Unix Makefiles</literal>
+ are supported. Invalid (unsupported) values are ignored and treated as if
+ unset. If not set <literal>Unix Makefiles</literal> will be used by default.
+ </para>
+
+ <para>Note that if a valid generator is also specified through
+ <link linkend="conf-cmake-options">cmake-options</link> it will override the
+ value for <literal>cmake-generator</literal>.</para></entry>
+ </row>
+
<row id="conf-cmake-options">
<entry>cmake-options</entry>
<entry>Appends to global options for the default buildsystem, overrides global
diff --cc modules/ksb/BuildSystem.pm
index 005558c,6dba496..0562edb
--- a/modules/ksb/BuildSystem.pm
+++ b/modules/ksb/BuildSystem.pm
@@@ -120,7 -127,17 +120,17 @@@ sub buildCommand
return 'gmake', 'make';
}
+ sub defaultBuildCommand
+ {
+ my $self = shift;
+ # Convert the path to an absolute path since I've encountered a sudo
+ # that is apparently unable to guess. Maybe it's better that it
+ # doesn't guess anyways from a security point-of-view.
+ my $buildCommand = first { absPathToExecutable($_) } $self->buildCommands();
+ return $buildCommand;
+ }
+
-# Return value style: boolean
+# Return value style: hashref {was_successful => bool, warnings => int, ...}
sub buildInternal
{
my $self = shift;
diff --cc modules/ksb/BuildSystem/KDE4.pm
index e2609d4,6ddc5f3..0aee432
--- a/modules/ksb/BuildSystem/KDE4.pm
+++ b/modules/ksb/BuildSystem/KDE4.pm
@@@ -126,11 -266,38 +260,31 @@@ sub installInterna
sub configureInternal
{
my $self = assert_isa(shift, 'ksb::BuildSystem::KDE4');
-- my $module = $self->module();
# Use cmake to create the build directory (sh script return value
# semantics).
- return (_safe_run_cmake ($module) == 0);
- if ($self->_safe_run_cmake())
- {
- error ("\tUnable to configure r[$module] with CMake!");
- return 0;
- }
-
- return 1;
++ return ($self->_safe_run_cmake() == 0);
+ }
+
+ # Return value style: boolean
+ sub buildInternal
+ {
+ my $self = shift;
+ my $generator = $self->cmakeGenerator();
+ my $defaultOptionsName = $GENERATOR_MAP->{$generator}->{optionsName};
+ my $optionsName = shift // "$defaultOptionsName";
+
+ return $self->safe_make({
+ target => undef,
+ message => 'Compiling...',
+ 'make-options' => [
+ split(' ', $self->module()->getOption($optionsName)),
+ ],
+ logbase => 'build',
+ subdirs => [
+ split(' ', $self->module()->getOption("checkout-only"))
+ ],
- })->{was_successful};
++ });
}
### Internal package functions.
diff --cc modules/ksb/ModuleResolver.pm
index f9b1ad0,b6b36b2..d164b16
--- a/modules/ksb/ModuleResolver.pm
+++ b/modules/ksb/ModuleResolver.pm
@@@ -365,9 -365,6 +365,12 @@@ sub resolveSelectorsIntoModule
# instead of our shell Modules, if possible.
@modules = $self->_resolveGuessedModules(@modules);
+ my %ignoredSelectors = map { ($_, 1) } @{$self->{ignoredSelectors}};
- @modules = grep { ! exists $ignoredSelectors{$_->name()} } @modules;
++ @modules = grep {
++ ! exists $ignoredSelectors{$_->name()} &&
++ ! exists $ignoredSelectors{$_->moduleSet()->name() // ''}
++ } @modules;
+
return @modules;
}
diff --cc t/smoke/bug-394497-ignore-dep-module.t
index 9267d13,bf8da62..f2db97f
--- a/t/smoke/bug-394497-ignore-dep-module.t
+++ b/t/smoke/bug-394497-ignore-dep-module.t
@@@ -21,36 -20,41 +21,41 @@@ package ksb::Application
my $self = shift;
my @modules = @_;
- my $newModule = $self->{module_factory}->('setmod2');
+ my $newModule = ksb::Module->new($self->{context}, 'setmod2');
- my $graph = {
- 'setmod1' => {
- votes => {
- 'setmod2' => 1,
- 'setmod3' => 1
- },
- build => 1,
- module => $modules[0]
- },
- 'setmod2' => {
- votes => {
- 'setmod3' => 1
- },
- build => !$ksb::Application::IGNORE_MOD2,
- module => $newModule
- },
- 'setmod3' => {
- votes => {},
+ my $graph = { };
+
+ # Construct graph manually based on real module list
+ foreach my $module (@modules) {
+ my $name = $module->name();
+ $graph->{$name} = {
+ votes => { },
build => 1,
- module => $modules[1]
+ module => $module,
+ };
+ }
+
+ if (exists $graph->{setmod1}) {
+ $graph->{setmod1}->{votes} = {
+ 'setmod2' => 1,
+ 'setmod3' => 1
+ };
+
+ # setmod1 is only user of setmod2
+ if (!exists $graph->{setmod2}) {
+ $graph->{setmod2} = {
+ votes => {
+ 'setmod3' => 1
+ },
- build => 1,
++ build => !$IGNORE_MOD2,
+ module => $newModule,
+ };
}
- };
+ }
- my $result = {
+ return {
graph => $graph
};
-
- return $result;
}
};
@@@ -84,4 -80,15 +89,18 @@@ my @args = qw(--pretend --rc-file t/dat
is ($moduleList[1]->name(), 'setmod3', 'mod list[1] == setmod3');
}
-# Verify that --include-dependencies on a moduleset name filters out the whole set
++# Verify that --ignore-modules on a moduleset name filters out the whole set
+ {
+ @args = (@args[0..2], qw(--ignore-modules set1));
+
- my $app = ksb::Application->new(@args);
- my @moduleList = @{$app->{modules}};
++ my $app = ksb::Application->new;
++ my @selectors = $app->establishContext(@args);
++ my $workload = $app->modulesFromSelectors(@selectors);
++ $app->setModulesToProcess($workload);
++ my @moduleList = $app->modules();
+
+ is (scalar @moduleList, 1, 'Right number of modules (ignore module-set)');
+ is ($moduleList[0]->name(), 'module2', 'mod list[0] == module2');
+ }
+
done_testing();
More information about the kde-doc-english
mailing list