Skip to content

Commit

Permalink
Make jvm use PERL6_SPEC for revision-specific builds
Browse files Browse the repository at this point in the history
Implemented templating of filelists allowing for use of common
core_sources file instead of individual moar_core_sources and
jvm_core_sources.

Minor: `Configure.pl --submodule-update` now force-updates nqp-configure
submodule.
  • Loading branch information
vrurg committed May 24, 2019
1 parent 9e8da74 commit 09b9e06
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 249 deletions.
2 changes: 1 addition & 1 deletion 3rdparty/nqp-configure
37 changes: 22 additions & 15 deletions Configure.pl
Expand Up @@ -11,7 +11,8 @@
use FindBin;

BEGIN {
unless ( -e '3rdparty/nqp-configure/LICENSE' ) {
my $force_update = !!grep { $_ eq '--submodule-update' } @ARGV;
if ( $force_update || !-e '3rdparty/nqp-configure/LICENSE' ) {
print "Updating nqp-configure submodule...\n";
my $msg =
qx{git submodule sync --quiet 3rdparty/nqp-configure && git submodule --quiet update --init 3rdparty/nqp-configure 2>&1};
Expand Down Expand Up @@ -52,20 +53,21 @@ BEGIN
$config->{$config_status} = join ' ', map { qq("$_") } @ARGV;

GetOptions(
$cfg->options, 'help!',
'prefix=s', 'libdir=s',
'sysroot=s', 'sdkroot=s',
'no-relocatable', 'backends=s',
'no-clean', 'with-nqp=s',
'gen-nqp:s', 'gen-moar:s',
'moar-option=s@', 'git-protocol=s',
'ignore-errors', 'make-install!',
'makefile-timing!', 'git-depth=s',
'git-reference=s', 'github-user=s',
'rakudo-repo=s', 'nqp-repo=s',
'moar-repo=s', 'roast-repo=s',
'expand=s', 'out=s',
'set-var=s@',
$cfg->options, 'help!',
'prefix=s', 'libdir=s',
'sysroot=s', 'sdkroot=s',
'no-relocatable', 'backends=s',
'no-clean', 'with-nqp=s',
'with-moar=s', 'gen-nqp:s',
'gen-moar:s', 'moar-option=s@',
'git-protocol=s', 'ignore-errors',
'make-install!', 'makefile-timing!',
'git-depth=s', 'git-reference=s',
'github-user=s', 'rakudo-repo=s',
'nqp-repo=s', 'moar-repo=s',
'roast-repo=s', 'expand=s',
'out=s', 'set-var=s@',
'submodule-update',
)
or do {
print_help();
Expand Down Expand Up @@ -96,6 +98,11 @@ BEGIN

$cfg->options->{'gen-nqp'} ||= '' if $cfg->has_option('gen-moar');
$cfg->gen_nqp;

if ( defined $cfg->opt('submodule-update') ) {
exit(0);
}

$cfg->configure_active_backends;

$cfg->expand_template;
Expand Down
2 changes: 1 addition & 1 deletion tools/lib/NQP/Config/Rakudo.pm
Expand Up @@ -424,7 +424,7 @@ 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
no-relocatable ignore-errors>
no-relocatable ignore-errors with-moar>
)
{
my $opt_str = $self->make_option( $opt, no_quote => 1 );
Expand Down
3 changes: 0 additions & 3 deletions tools/templates/6.d/moar_core_sources

This file was deleted.

File renamed without changes.
File renamed without changes.
Expand Up @@ -42,6 +42,9 @@ src/core/Bool.pm6
src/core/Order.pm6
src/core/Num.pm6
src/core/Buf.pm6
@if(backend==moar
src/core/Uni.pm6
src/core/Collation.pm6)@
src/core/Encoding/Decoder.pm6
src/core/Encoding/Decoder/Builtin.pm6
src/core/Encoding/Encoder.pm6
Expand Down Expand Up @@ -152,6 +155,7 @@ src/core/Hyper.pm6
src/core/metaops.pm6
src/core/precedence.pm6
src/core/Deprecations.pm6
src/core/atomicops.pm6
src/core/Thread.pm6
src/core/Lock.pm6
src/core/Lock/Async.pm6
Expand All @@ -167,7 +171,6 @@ src/core/Promise.pm6
src/core/Channel.pm6
src/core/Supply.pm6
src/core/asyncops.pm6
src/core/atomicops.pm6
src/core/IO/Socket.pm6
src/core/IO/Socket/INET.pm6
src/core/IO/Socket/Async.pm6
Expand Down Expand Up @@ -203,8 +206,9 @@ src/core/CompUnit/Repository/AbsolutePath.pm6
src/core/CompUnit/Repository/NQP.pm6
src/core/CompUnit/Repository/Perl5.pm6
src/core/CompUnit/Repository/Unknown.pm6
@if(backend==jvm
src/vm/jvm/CompUnit/Repository/Java.pm6
src/vm/jvm/CompUnit/Repository/JavaRuntime.pm6
src/vm/jvm/CompUnit/Repository/JavaRuntime.pm6)@
src/core/Argfiles.pm6
src/core/Process.pm6
src/core/Slang.pm6
Expand Down
20 changes: 11 additions & 9 deletions tools/templates/jvm/Makefile.in
Expand Up @@ -54,10 +54,11 @@ J_METAMODEL_SOURCES = $(COMMON_BOOTSTRAP_SOURCES) \
# the compiler will instantiate/call methods on while compiling the
# setting - basically anything that feels MOP-ish.
J_CORE_SOURCES = \
@jvm_core_sources@

J_CORE_D_SOURCES = \
@jvm_core_d_sources@
@insert_filelist(jvm_core_sources)@
@for_specs(
J_CORE_@ucspec@_SOURCES = \
@insert_filelist(rev_core_sources)@
)@

PERL6_DEBUG_JAR = perl6-debug.jar
J_DEBUG_RUNNER = perl6-debug-j@runner_suffix@
Expand Down Expand Up @@ -147,15 +148,16 @@ $(PERL6_B_JAR): $(BOOTSTRAP_SOURCES) $(PERL6_M_JAR)
$(J_RUN_NQP_RR) --module-path=blib --target=jar --output=$(PERL6_B_JAR) @nfpq($(J_BUILD_DIR)/BOOTSTRAP.nqp)@

$(SETTING_JAR): $(PERL6_JAR) $(PERL6_B_JAR) $(J_CORE_SOURCES)
$(J_NQP) $(J_GEN_CAT) -f @shquot(@template(jvm_core_sources)@)@ > @nfpq($(J_BUILD_DIR)/CORE.setting)@
$(J_NQP) $(J_GEN_CAT) $(J_CORE_SOURCES) > @nfpq($(J_BUILD_DIR)/CORE.setting)@
@echo "The following step can take a long time, please be patient."
@set_nqp_lib@$(J_RUN_PERL6) --setting=NULL --ll-exception --optimize=3 --target=jar --stagestats --output=$(SETTING_JAR) --nqp-lib=blib @nfpq($(J_BUILD_DIR)/CORE.setting)@

$(SETTING_D_JAR): $(PERL6_JAR) $(PERL6_B_JAR) $(SETTING_JAR) $(J_CORE_SOURCES)
$(J_NQP) $(J_GEN_CAT) $(J_CORE_D_SOURCES) > @nfpq($(J_BUILD_DIR)/CORE.d.setting)@
@for_specs($(SETTING_@ucspec@_JAR): $(PERL6_JAR) $(PERL6_@ucspec@_JAR) $(SETTING_JAR) $(J_CORE_SOURCES)
$(J_NQP) $(J_GEN_CAT) $(J_CORE_@ucspec@_SOURCES) > @nfpq($(J_BUILD_DIR)/CORE.@lcspec@.setting)@
@echo "The following step can take a long time, please be patient."
@set_nqp_lib@$(J_RUN_PERL6) --setting=NULL.d --ll-exception --optimize=3 --target=jar --stagestats --output=$(SETTING_D_JAR) --nqp-lib=blib @nfpq($(J_BUILD_DIR)/CORE.d.setting)@

@set_nqp_lib@$(J_RUN_PERL6) --setting=NULL.@lcspec@ --ll-exception --optimize=3 --target=jar --stagestats --output=$(SETTING_@ucspec@_JAR) --nqp-lib=blib @nfpq($(J_BUILD_DIR)/CORE.@lcspec@.setting)@

)@
$(J_RUNNER): @@script(create-jvm-runner.pl)@@
$(PERL5) @shquot(@script(create-jvm-runner.pl)@)@ dev . . @q($(NQP_PREFIX))@ --nqp-lib=blib @q($(NQP_JARS))@

Expand Down
8 changes: 4 additions & 4 deletions tools/templates/moar/Makefile.in
Expand Up @@ -80,10 +80,10 @@ M_BOOTSTRAP_SOURCES = $(BOOTSTRAP_SOURCES) @nfp(src/vm/moar/spesh-plugins.nqp)@
# the compiler will instantiate/call methods on while compiling the
# setting - basically anything that feels MOP-ish.
M_CORE_SOURCES = \
@insert_filelist(moar_core_sources)@
@insert_filelist(core_sources)@
@for_specs(
M_CORE_@ucspec@_SOURCES = \
@insert_filelist(moar_core_sources)@
@insert_filelist(rev_core_sources)@
)@

PERL6_DEBUG_MOAR = perl6-debug.moarvm
Expand Down Expand Up @@ -187,12 +187,12 @@ $(PERL6_B_MOAR): $(M_BOOTSTRAP_SOURCES) $(PERL6_M_MOAR)
--vmlibs=$(M_PERL6_OPS_DLL)=Rakudo_ops_init @nfpq($(M_BUILD_DIR)/BOOTSTRAP.nqp)@

$(SETTING_MOAR): $(PERL6_MOAR) $(PERL6_B_MOAR) $(M_CORE_SOURCES)
$(M_NQP) $(M_GEN_CAT) -f @shquot(@template(moar_core_sources)@)@ > @nfpq($(M_BUILD_DIR)/CORE.setting)@
$(M_NQP) $(M_GEN_CAT) $(M_CORE_SOURCES) > @nfpq($(M_BUILD_DIR)/CORE.setting)@
@echo "The following step can take a long time, please be patient."
$(M_RUN_PERL6) --setting=NULL --ll-exception --optimize=3 --target=mbc --stagestats --output=$(SETTING_MOAR) @nfpq($(M_BUILD_DIR)/CORE.setting)@

@for_specs($(SETTING_@ucspec@_MOAR): $(PERL6_MOAR) $(PERL6_B_MOAR) $(SETTING_MOAR) $(M_CORE_@ucspec@_SOURCES)
$(M_NQP) $(M_GEN_CAT) -f @shquot(@template(moar_core_sources)@)@ > @nfpq($(M_BUILD_DIR)/CORE.@lcspec@.setting)@
$(M_NQP) $(M_GEN_CAT) $(M_CORE_@ucspec@_SOURCES) > @nfpq($(M_BUILD_DIR)/CORE.@lcspec@.setting)@
@echo "The following step can take a long time, please be patient."
$(M_RUN_PERL6) --setting=NULL.@lcspec@ --ll-exception --optimize=3 --target=mbc --stagestats --output=$(SETTING_@ucspec@_MOAR) @nfpq($(M_BUILD_DIR)/CORE.@lcspec@.setting)@

Expand Down
214 changes: 0 additions & 214 deletions tools/templates/moar/moar_core_sources

This file was deleted.

0 comments on commit 09b9e06

Please sign in to comment.