Skip to content

Commit

Permalink
Add --ignore-errors option to Configure.pl
Browse files Browse the repository at this point in the history
Allows you to ignore errors such as having an incorrect version of NQP.
  • Loading branch information
samcv committed Sep 2, 2017
1 parent 5ebbc5b commit 0bc1c87
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
9 changes: 6 additions & 3 deletions Configure.pl
Expand Up @@ -37,7 +37,7 @@
'backends=s', 'no-clean!',
'with-nqp=s', 'gen-nqp:s',
'gen-moar:s', 'moar-option=s@',
'git-protocol=s',
'git-protocol=s', 'ignore-errors',
'make-install!', 'makefile-timing!',
'git-depth=s', 'git-reference=s',
) or do {
Expand All @@ -50,7 +50,9 @@
print_help();
exit(0);
}

if ($options{'ignore-errors'}) {
print "===WARNING!===\nErrors are being ignored.\nIn the case of any errors the script may behave unexpectedly.\n";
}
unless (defined $options{prefix}) {
my $default = defined($options{sysroot}) ? '/usr' : File::Spec->catdir(getcwd, 'install');
print "ATTENTION: no --prefix supplied, building and installing to $default\n";
Expand Down Expand Up @@ -324,7 +326,7 @@
"Or, use '--prefix=' to explicitly specify the path where the NQP$want_executables",
"executable$s2 can be found that are use to build $lang.";
}
sorry(@errors) if @errors;
sorry($options{'ignore-errors'}, @errors) if @errors;

my $l = uc substr($default_backend, 0, 1);
print $MAKEFILE qq[\nt/*/*.t t/*.t t/*/*/*.t: all\n\t\$(${l}_HARNESS5_WITH_FUDGE) --verbosity=1 \$\@\n];
Expand Down Expand Up @@ -405,6 +407,7 @@ sub print_help {
Folders 'nqp' and 'MoarVM' with corresponding git repos should be in for_perl6 folder
--makefile-timing Enable timing of individual makefile commands
--no-clean Skip cleanup before installation
--ignore-errors Ignore errors (such as the version of NQP)
Please note that the --gen-moar and --gen-nqp options are there for convenience
only and will actually immediately - at Configure time - compile and install
Expand Down
7 changes: 5 additions & 2 deletions tools/lib/NQP/Configure.pm
Expand Up @@ -23,8 +23,11 @@ our @required_nqp_files = qw(
);

sub sorry {
my @msg = @_;
die join("\n", '', '===SORRY!===', @msg, "\n");
my ($ignore_errors, @msg) = @_;
my $message = join("\n", '', '===SORRY!===', @msg, "\n");
die $message
unless $ignore_errors;
print $message;
}

sub slurp {
Expand Down

0 comments on commit 0bc1c87

Please sign in to comment.