Skip to content

Commit

Permalink
Merge pull request #3248 from rakudo/configure-rebuild-all
Browse files Browse the repository at this point in the history
Add `--force-rebuild` command line option
  • Loading branch information
vrurg committed Nov 26, 2019
2 parents f608a7a + 82bd9c2 commit 5c2395b
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 19 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/nqp-configure
7 changes: 6 additions & 1 deletion Configure.pl
Expand Up @@ -77,7 +77,8 @@ BEGIN
'nqp-repo=s', 'moar-repo=s',
'roast-repo=s', 'expand=s',
'out=s', 'set-var=s@',
'silent-build!', 'raku-alias!'
'silent-build!', 'raku-alias!',
'force-rebuild!'
)
or do {
print_help();
Expand Down Expand Up @@ -173,6 +174,10 @@ sub print_help {
--gen-moar[=branch]
Download, build, and install a copy of MoarVM to use
before writing the Makefile
--force-rebuild
Together with --gen-* options causes corresponding
components to recompile irrelevant to their existence and
version conformance.
--with-nqp=<path>
Provide path to already installed nqp
--make-install Install Rakudo after configuration is done
Expand Down
52 changes: 36 additions & 16 deletions tools/lib/NQP/Config/Rakudo.pm
Expand Up @@ -222,6 +222,8 @@ sub configure_misc {
my $self = shift;
my $config = $self->{config};

$self->SUPER::configure_misc(@_);

# determine the version of NQP we want
( $config->{nqp_want} ) =
split( ' ',
Expand Down Expand Up @@ -585,18 +587,25 @@ sub gen_nqp {
my $config = $self->{config};

#my $nqp_bin = $options->{'with-nqp'};
my $nqp_git_spec = $options->{'gen-nqp'};
my $gen_nqp = $options->{'gen-nqp'};
my $gen_moar = $options->{'gen-moar'};
my $prefix = $config->{prefix};
my $sdkroot = $config->{'sdkroot'};
my $startdir = $config->{'base_dir'};
my $exe = $config->{exe};
my $nqp_want = $config->{nqp_want};
my $git_protocol = $options->{'git-protocol'} // 'https';
my @moar_options = @{ $options->{'moar-option'} // [] };
my $impls = $self->{impls};
my $pwd = cwd;
my $nqp_git_spec = $options->{'gen-nqp'};
my $gen_nqp = $options->{'gen-nqp'};
my $gen_moar = $options->{'gen-moar'};
my $force_rebuild = $options->{'force-rebuild'};
my $prefix = $config->{prefix};
my $sdkroot = $config->{'sdkroot'};
my $startdir = $config->{'base_dir'};
my $exe = $config->{exe};
my $nqp_want = $config->{nqp_want};
my $git_protocol = $options->{'git-protocol'} // 'https';
my @moar_options = @{ $options->{'moar-option'} // [] };
my $impls = $self->{impls};
my $pwd = cwd;

if ( $force_rebuild && !defined $gen_nqp ) {
$self->note( "WARNING",
"Command line option --force-rebuild"
. " is ineffective without --gen-nqp" );
}

my %need;

Expand All @@ -619,12 +628,16 @@ sub gen_nqp {
$nqp_have ? ( 0 <= cmp_rev( $nqp_have, $nqp_want ) ) : 0;
my $nqp_ok = $nqp_have && $nqp_ver_ok;

unless ( !$nqp_have || $nqp_ver_ok || $options->{'ignore-errors'} ) {
unless ( $force_rebuild
|| !$nqp_have
|| $nqp_ver_ok
|| $options->{'ignore-errors'} )
{
$self->note( "WARNING",
"$bin version $nqp_have is outdated, $nqp_want expected.\n" );
}

if ( $nqp_ok or $options->{'ignore-errors'} ) {
if ( !$force_rebuild and ( $nqp_ok or $options->{'ignore-errors'} ) ) {
$impls->{$b}{ok} = 1;
}
elsif ( $self->opt('with-nqp') ) {
Expand All @@ -641,7 +654,13 @@ sub gen_nqp {

if ( defined $gen_nqp || defined $gen_moar ) {
my $user = $options->{'github-user'} // 'perl6';
$self->git_checkout( 'nqp', 'nqp', $nqp_git_spec || $nqp_want );
# Don't expect any specific default commit in nqp/ if the repo is
# already checked out.
my $expected_spec =
-d File::Spec->catdir( $self->cfg('base_dir'), 'nqp', '.git' )
? undef
: $nqp_want;
$self->git_checkout( 'nqp', 'nqp', $nqp_git_spec || $expected_spec );
}

my @cmd = (
Expand All @@ -652,7 +671,8 @@ sub gen_nqp {
# Append only the options we'd like to pass down to NQP's Configure.pl
for my $opt (
qw<git-depth git-reference github-user nqp-repo moar-repo
nqp-home relocatable ignore-errors with-moar silent-build>
nqp-home relocatable ignore-errors with-moar silent-build
force-rebuild>
)
{
my $opt_str = $self->make_option( $opt, no_quote => 1 );
Expand Down
2 changes: 1 addition & 1 deletion tools/templates/NQP_REVISION
@@ -1 +1 @@
2019.07.1-164-g58996e370
2019.07.1-167-gba6378efd

0 comments on commit 5c2395b

Please sign in to comment.