Skip to content
Permalink
Browse files

Temporary: Fix PERL6/NQP_HOME broken without --execpath

This broke comma debugging, because comma directly calls moar but did not
pass an --execpath parameter, thus breaking PERL6_HOME and NQP_HOME
detection.
  • Loading branch information...
patzim committed Apr 22, 2019
1 parent 90e18b6 commit 109ce1f43377b514738542cdfc134c4f1eda9839
Showing with 47 additions and 30 deletions.
  1. +26 −18 src/main.nqp
  2. +21 −12 src/perl6-debug.nqp
@@ -2,33 +2,48 @@ use Perl6::Grammar;
use Perl6::Actions;
use Perl6::Compiler;

my $config := nqp::backendconfig();

# Initialize Rakudo runtime support.
nqp::p6init();

# Create and configure compiler object.
my $comp := Perl6::Compiler.new();

$comp.language('perl6');
$comp.parsegrammar(Perl6::Grammar);
$comp.parseactions(Perl6::Actions);
$comp.addstage('syntaxcheck', :before<ast>);
$comp.addstage('optimize', :after<ast>);
hll-config($comp.config);
nqp::bindhllsym('perl6', '$COMPILER_CONFIG', $comp.config);


# Determine Perl6 and NQP dirs.
my $config := nqp::backendconfig();
my $sep := $config<osname> eq 'MSWin32' ?? '\\' !! '/';
#?if jvm
my $execname := nqp::atkey(nqp::jvmgetproperties,'perl6.execname');
my $install-dir := nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1));
my $install-dir := $execname ne ''
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1))
!! $comp.config<prefix>;
#?endif
#?if moar
my $execname := nqp::execname();
my $install-dir := $config<osname> eq 'openbsd'
?? $config<prefix> ~ '/bin/perl6-m'
!! nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1));
!! $execname ne ''
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1))
!! $comp.config<prefix>;
#?endif
#?if js
my $execname := nqp::execname();
my $install-dir := $config<osname> eq 'openbsd'
?? $config<prefix> ~ '/bin/perl6-js'
!! nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1));
!! $execname ne ''
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1))
!! $comp.config<prefix>;
#?endif


# Initialize Rakudo runtime support.
nqp::p6init();

# Create and configure compiler object.
my $comp := Perl6::Compiler.new();

my $perl6-home := $comp.config<static_perl6_home>
// nqp::getenvhash()<PERL6_HOME>
// $install-dir ~ '/share/perl6';
@@ -46,13 +61,6 @@ if nqp::substr($nqp-home, nqp::chars($nqp-home) - 1) eq $sep {
nqp::bindhllsym('perl6', '$PERL6_HOME', $perl6-home);
nqp::bindhllsym('perl6', '$NQP_HOME', $nqp-home);

$comp.language('perl6');
$comp.parsegrammar(Perl6::Grammar);
$comp.parseactions(Perl6::Actions);
$comp.addstage('syntaxcheck', :before<ast>);
$comp.addstage('optimize', :after<ast>);
hll-config($comp.config);
nqp::bindhllsym('perl6', '$COMPILER_CONFIG', $comp.config);

# Add extra command line options.
my @clo := $comp.commandline_options();
@@ -456,25 +456,42 @@ sub MAIN(*@ARGS) {
# Create and configure compiler object.
my $comp := Perl6::Debugger.new();

$comp.language('perl6');
$comp.parsegrammar(Perl6::HookGrammar);
$comp.parseactions(Perl6::HookActions);
$comp.addstage('syntaxcheck', :before<ast>);
$comp.addstage('optimize', :after<ast>);
hll-config($comp.config);
my $COMPILER_CONFIG := $comp.config;
nqp::bindhllsym('perl6', '$COMPILER_CONFIG', $comp.config);


# Determine Perl6 and NQP dirs.
my $config := nqp::backendconfig();
my $sep := $config<osname> eq 'MSWin32' ?? '\\' !! '/';
my $sep := $config<osname> eq 'MSWin32' ?? '\\' !! '/';
#?if jvm
my $execname := nqp::atkey(nqp::jvmgetproperties,'perl6.execname');
my $install-dir := nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1));
my $install-dir := $execname ne ''
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1))
!! $comp.config<prefix>;
#?endif
#?if moar
my $execname := nqp::execname();
my $install-dir := $config<osname> eq 'openbsd'
?? $config<prefix> ~ '/bin/perl6-m'
!! nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1));
!! $execname ne ''
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1))
!! $comp.config<prefix>;
#?endif
#?if js
my $execname := nqp::execname();
my $install-dir := $config<osname> eq 'openbsd'
?? $config<prefix> ~ '/bin/perl6-js'
!! nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1));
!! $execname ne ''
?? nqp::substr($execname, 0, nqp::rindex($execname, $sep, nqp::rindex($execname, $sep) - 1))
!! $comp.config<prefix>;
#?endif

my $perl6-home := $comp.config<static_perl6_home>
// nqp::getenvhash()<PERL6_HOME>
// $install-dir ~ '/share/perl6';
@@ -492,14 +509,6 @@ sub MAIN(*@ARGS) {
nqp::bindhllsym('perl6', '$PERL6_HOME', $perl6-home);
nqp::bindhllsym('perl6', '$NQP_HOME', $nqp-home);

$comp.language('perl6');
$comp.parsegrammar(Perl6::HookGrammar);
$comp.parseactions(Perl6::HookActions);
$comp.addstage('syntaxcheck', :before<ast>);
$comp.addstage('optimize', :after<ast>);
hll-config($comp.config);
my $COMPILER_CONFIG := $comp.config;
nqp::bindhllsym('perl6', '$COMPILER_CONFIG', $comp.config);

# Add extra command line options.
my @clo := $comp.commandline_options();

0 comments on commit 109ce1f

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