Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JVM] build is broken (error in stage parse during generation of CORE.d.setting.jar) #2628

Open
usev6 opened this Issue Jan 19, 2019 · 3 comments

Comments

Projects
None yet
4 participants
@usev6
Copy link
Contributor

usev6 commented Jan 19, 2019

The Problem

Trying to build rakudo-jvm on current head (304feae) leads to this error during generation of CORE.d.setting.jar:

NQP_LIB=blib java -Xss1m -Xms500m -Xmx3000m -cp .:/usr/home/christian/perl6/tmp/rakudo_jvm_constant_6d/install/share/nqp/runtime/asm-4.1.jar:/usr/home/christian/perl6/tmp/rakudo_jvm_constant_6d/install/share/nqp/runtime/asm-tree-4.1.jar:/usr/home/christian/perl6/tmp/rakudo_jvm_constant_6d/install/share/nqp/runtime/jline-1.0.jar:/usr/home/christian/perl6/tmp/rakudo_jvm_constant_6d/install/share/nqp/runtime/jna-4.0.0.jar:/usr/home/christian/perl6/tmp/rakudo_jvm_constant_6d/install/share/nqp/runtime/nqp-runtime.jar:/usr/home/christian/perl6/tmp/rakudo_jvm_constant_6d/install/share/nqp/lib/nqp.jar:rakudo-runtime.jar:perl6.jar:/usr/home/christian/perl6/tmp/rakudo_jvm_constant_6d/install/share/nqp/lib perl6 --setting=NULL.d --ll-exception --optimize=3 --target=jar --stagestats --output=CORE.d.setting.jar --nqp-lib=blib gen/jvm/CORE.d.setting
Stage start      :   0.001
Stage parse      : Method 'CORE' not found for invocant of class 'QAST::SVal'
  in set (gen/jvm/stage2/QASTNode.nqp:142)
  in new (gen/jvm/stage2/QASTNode.nqp:447)
  in perl6_module_loader_code (src/Perl6/World.nqp:1412)
  in load_setting (src/Perl6/World.nqp:853)
  in loading_and_symbol_setup (src/Perl6/World.nqp:608)
  in comp_unit (gen/jvm/Perl6-Grammar.nqp:827)
  in TOP (gen/jvm/Perl6-Grammar.nqp:559)
  in parse (gen/jvm/stage2/QRegex.nqp:2303)
  in parse (gen/jvm/stage2/NQPHLL.nqp:1546)
  in execute_stage (gen/jvm/stage2/NQPHLL.nqp:1462)
  in run (gen/jvm/stage2/NQPHLL.nqp:1495)
  in <anon> (gen/jvm/stage2/NQPHLL.nqp:1498)
  in compile (gen/jvm/stage2/NQPHLL.nqp:1484)
  in eval (gen/jvm/stage2/NQPHLL.nqp:1178)
  in evalfiles (gen/jvm/stage2/NQPHLL.nqp:1439)
  in command_eval (gen/jvm/stage2/NQPHLL.nqp:1329)
  in command_eval (src/Perl6/Compiler.nqp:48)
  in command_line (gen/jvm/stage2/NQPHLL.nqp:1288)
  in MAIN (gen/jvm/main.nqp:54)
  in <mainline> (gen/jvm/main.nqp:42)
  in <anon> (gen/jvm/main.nqp)
*** Error code 1

Stop.
make: stopped in /usr/home/christian/perl6/tmp/rakudo_jvm_constant_6d

The build succeeds after reverting two commits: 5540212 and 7d3b7e1

As far as I can see, the error happens if one declares a constant with a nqp::hash.

I tried different variations by adding a single line near the start of a random source code file (in my case src/core/Date.pm6).

my constant $foo = nqp::hash('bar', 42);   # dies with Method 'bar' not found for invocant of class 'QAST::SVal'

The same error occurs without the 'my':

constant $foo = nqp::hash('bar', 42);  # dies

None of the following lines lead to an error (I tested them one at a time):

BEGIN my $foo = nqp::hash('bar', 42);   ## works
my $foo = nqp::hash('bar', 42);   #works
my constant $foo = %('bar', 42);  #works
my constant $foo = 42;   #works

So to me it looks like constant $foo ... is evaluated somewhat earlier than BEGIN my $foo ... and at that earlier time nqp::hash() isn't parsed correctly.

Please not that CORE.setting.jar is build correctly in all cases -- the error only happens for CORE.setting.d.

Environment

  • Operating system: FreeBSD 11.2-RELEASE-p4
  • Java: openjdk version 1.8.0_181

@usev6 usev6 added the JVM label Jan 19, 2019

@pmurias

This comment has been minimized.

Copy link
Contributor

pmurias commented Jan 19, 2019

@AlexDaniel AlexDaniel added the BLOCKER label Jan 19, 2019

@lizmat

This comment has been minimized.

Copy link
Contributor

lizmat commented Jan 20, 2019

Hopefully debe6b6 will fix the build on JVM and JS

@usev6

This comment has been minimized.

Copy link
Contributor Author

usev6 commented Jan 20, 2019

Hopefully debe6b6 will fix the build on JVM and JS

It helps for the JVM backend. Thanks! And also thanks to @pmurias for explaining what goes wrong.

@usev6 usev6 removed the BLOCKER label Jan 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.