Support the --continue option, ignoring build failures

Change-Id: I409f6b157cbe9de7c173ac1b8458b06548051db9
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
This commit is contained in:
Marius Storm-Olsen
2012-04-09 14:10:20 -05:00
committed by Qt by Nokia
parent dbf53d1ffb
commit 9894009117

31
build
View File

@@ -136,7 +136,7 @@ sub parse_arguments
GetOptionsFromArray(\@args, GetOptionsFromArray(\@args,
'verbose|v:1' => \$self->{'verbose'}, 'verbose|v:1' => \$self->{'verbose'},
'continue' => \$self->{'continue'}, 'continue|c:1' => \$self->{'continue'},
'jobs|j:0' => \$self->{'jobs'}, 'jobs|j:0' => \$self->{'jobs'},
'force-qmake' => \$self->{'force_qmake'}, 'force-qmake' => \$self->{'force_qmake'},
'dry-run|n:1' => \$self->{'dry-run'}, 'dry-run|n:1' => \$self->{'dry-run'},
@@ -269,16 +269,19 @@ sub detect_configuration
$self->{'MAKEOPTS'} = ""; $self->{'MAKEOPTS'} = "";
} }
if ($exe =~ 'nmake|jom' && $self->{'dry-run'} > 1) { if ($exe =~ 'nmake|jom') {
$self->{'MAKEOPTS'} = "/N $self->{'MAKEOPTS'}"; $self->{'MAKEOPTS'} = "/N $self->{'MAKEOPTS'}" if ($self->{'dry-run'} > 1);
$self->{'MAKEOPTS'} = "/K $self->{'MAKEOPTS'}" if ($self->{'continue'} > 1);
} }
} }
# Tools needed for building QtWebKit/Windows (Bison, Flex, gperf, iconv) # Tools needed for building QtWebKit/Windows (Bison, Flex, gperf, iconv)
my $abs_path = abs_path('gnuwin32/bin'); my $abs_path = abs_path('gnuwin32/bin');
unshift @PATH, "$abs_path"; unshift @PATH, "$abs_path";
} else { }
if ($self->{'MAKE'} !~ "nmake|jom") {
$self->{'MAKEOPTS'} = "--dry-run $self->{'MAKEOPTS'}" if ($self->{'dry-run'} > 1); $self->{'MAKEOPTS'} = "--dry-run $self->{'MAKEOPTS'}" if ($self->{'dry-run'} > 1);
$self->{'MAKEOPTS'} = "--keep-going $self->{'MAKEOPTS'}" if ($self->{'continue'} > 1);
} }
} }
@@ -431,11 +434,27 @@ sub build_project
} }
$build_command = "$self->{MAKE} $self->{MAKEOPTS}"; $build_command = "$self->{MAKE} $self->{MAKEOPTS}";
} }
$self->exeLowPriv("cd $module && $build_command"); eval { $self->exeLowPriv("cd $module && $build_command"); };
if ($@) {
print STDERR "'cd $module && $build_command' failed: $?\n";
if ($self->{'continue'}) {
print STDERR "Ignoring failure building $module (--continue)\n";
} else {
confess "Fatal failure building $module";
}
}
$install_command = "$self->{MAKE} install" if (!defined $install_command); $install_command = "$self->{MAKE} install" if (!defined $install_command);
### TODO: Should be fixed after the alpha ### TODO: Should be fixed after the alpha
unless ("$Config{osname}" =~ /(dar|ms)win/i) { unless ("$Config{osname}" =~ /(dar|ms)win/i) {
$self->exeHighPriv("cd $module && $install_command"); eval { $self->exeHighPriv("cd $module && $install_command"); };
if ($@) {
print STDERR "'cd $module && $install_command failed: $?\n";
if ($self->{'continue'}) {
print STDERR "Ignoring failure installing $module (--continue)\n";
} else {
confess "Fatal failure installing $module";
}
}
} }
$self->mark_as_finished($module); $self->mark_as_finished($module);
return 0; return 0;