Skip to content
Permalink
Browse files

Converted config var source_digest to macro.

Fix for incorrect digest calculation
  • Loading branch information...
vrurg committed May 2, 2019
1 parent 141bd4e commit da6d90e46edfb69db82aef9df60a5f03e7927e5d
Showing with 38 additions and 27 deletions.
  1. +36 −25 tools/lib/NQP/Config/Rakudo.pm
  2. +1 −1 tools/templates/main-version.in
  3. +1 −1 tools/templates/moar/Makefile.in
@@ -118,11 +118,6 @@ sub configure_misc {

$config->{builddate} = strftime( '%Y-%m-%dT%H:%M:%SZ', gmtime );

my $sha = Digest::SHA->new;
find( sub { $sha->addfile($_) if /\.(nqp|pm6)\z/ }, "src" );
$sha->addfile('gen/nqp-version');
$config->{source_digest} = $sha->hexdigest;

# NQP_LIB
$config->{set_nqp_lib} = 'NQP_LIB=blib ';
if ( $self->is_win ) {
@@ -226,7 +221,8 @@ sub configure_moar_backend {
# . $nqp_config->{'moar::moar'}
# . ' $(PREFIX)'
# . $slash . 'bin';
$config->{m_install} = "\t" . q<$(CP) @nfpq(@moar::libdir@/@moar::moar@) @nfpq($(DESTDIR)$(PREFIX)/bin)@>;
$config->{m_install} = "\t"
. q<$(CP) @nfpq(@moar::libdir@/@moar::moar@) @nfpq($(DESTDIR)$(PREFIX)/bin)@>;
}
if ( $nqp_config->{'moar::os'} eq 'mingw32' ) {
$config->{'mingw_unicode'} = '-municode';
@@ -238,23 +234,24 @@ sub configure_moar_backend {
" \$(M_GDB_RUNNER) \\\n \$(M_LLDB_RUNNER) \\\n \$(M_VALGRIND_RUNNER)";
$config->{'m_all'} =
'$(M_GDB_RUNNER) $(M_LLDB_RUNNER) $(M_VALGRIND_RUNNER)';
#$config->{'m_install'} = "\t"
# . '$(M_RUN_PERL6) '
# . $self->nfp("tools/build/create-moar-runner.p6")
# . ' perl6 $(M_RUNNER) $(DESTDIR)$(PREFIX)'
# . $self->nfp("/bin/perl6-gdb-m")
# . ' "gdb" "" "" ""' . "\n\t"
# . '$(M_RUN_PERL6) '
# . $self->nfp("tools/build/create-moar-runner.p6")
# . ' perl6 $(M_RUNNER) $(DESTDIR)$(PREFIX)'
# . $self->nfp("/bin/perl6-lldb-m")
# . ' "lldb" "" "" ""' . "\n\t"
# . '$(M_RUN_PERL6) '
# . $self->nfp("tools/build/create-moar-runner.p6")
# . ' perl6 $(M_RUNNER) $(DESTDIR)$(PREFIX)'
# . $self->nfp("/bin/perl6-valgrind-m")
# . ' "valgrind" "" "" ""';
$config->{m_install} = '@insert(Makefile-install)@';

#$config->{'m_install'} = "\t"
# . '$(M_RUN_PERL6) '
# . $self->nfp("tools/build/create-moar-runner.p6")
# . ' perl6 $(M_RUNNER) $(DESTDIR)$(PREFIX)'
# . $self->nfp("/bin/perl6-gdb-m")
# . ' "gdb" "" "" ""' . "\n\t"
# . '$(M_RUN_PERL6) '
# . $self->nfp("tools/build/create-moar-runner.p6")
# . ' perl6 $(M_RUNNER) $(DESTDIR)$(PREFIX)'
# . $self->nfp("/bin/perl6-lldb-m")
# . ' "lldb" "" "" ""' . "\n\t"
# . '$(M_RUN_PERL6) '
# . $self->nfp("tools/build/create-moar-runner.p6")
# . ' perl6 $(M_RUNNER) $(DESTDIR)$(PREFIX)'
# . $self->nfp("/bin/perl6-valgrind-m")
# . ' "valgrind" "" "" ""';
$config->{m_install} = '@insert(Makefile-install)@';
}
$config->{c_runner_libs} = join( " ", @c_runner_libs );
$config->{moar_lib} = sprintf(
@@ -547,8 +544,22 @@ sub _m_for_specmods {
return _m_for_specs( $self, $text, with_mods => 1 );
}

NQP::Macros->register_macro( 'for_specs', \&_m_for_specs );
NQP::Macros->register_macro( 'for_specmods', \&_m_for_specmods );
sub _m_source_digest {
my $self = shift;
my $sha = Digest::SHA->new;
find(
sub {
$sha->addfile($_) if /\.(nqp|pm6)\z/;
},
File::Spec->catdir( $self->cfg->cfg('base_dir'), "src" )
);
$sha->addfile('gen/nqp-version');
return $sha->hexdigest;
}

NQP::Macros->register_macro( 'for_specs', \&_m_for_specs );
NQP::Macros->register_macro( 'for_specmods', \&_m_for_specmods );
NQP::Macros->register_macro( 'source_digest', \&_m_for_specmods );

1;

@@ -9,6 +9,6 @@ sub hll-config($config) {
:= nqp::list( '6.c'@for_specmods(, '6.@spec_with_mod@')@ );
$config<prefix> := '@prefix@';
$config<libdir> := '@libdir@';
$config<source-digest> := '@source_digest@';
$config<source-digest> := '@source_digest()@';
}

@@ -209,7 +209,7 @@ $(PERL6_DEBUG_MOAR): @nfp(src/perl6-debug.nqp)@ $(PERL6_MOAR)
@perl(
for my $toolchain (qw<gdb lldb valgrind>) {
my $scope = $cfg->push_config( toolchain => $toolchain );
$out .= $macros->expand(<<'@insert(Makefile-gen-runner)@');
$out .= $macros->expand('@insert(Makefile-gen-runner)@');
}
)@
$(M_BAT_RUNNER): @@configure_script@@ $(M_C_RUNNER) $(PERL6_MOAR) $(SETTING_MOAR)

0 comments on commit da6d90e

Please sign in to comment.
You can’t perform that action at this time.