Skip to content
Permalink
Browse files

Get the shell runners working in the build dir

They used relative paths. Thus the scripts only worked with
cwd = build dir. Now they are relocatable and work with any cwd.
  • Loading branch information...
patzim committed Apr 15, 2019
1 parent b7562d3 commit 991762436dfa9fc31eb50572753abcaff8bdd9e0
Showing with 11 additions and 9 deletions.
  1. +5 −5 tools/build/Makefile-Moar.in
  2. +6 −4 tools/build/create-moar-runner.p6
@@ -197,7 +197,7 @@ $(R_SETTING_MOAR): $(PERL6_MOAR) $(SETTING_MOAR) $(R_SETTING_SRC) $(SETTING_MOAR

$(M_BAT_RUNNER): tools/build/create-moar-runner.p6 $(M_C_RUNNER) $(PERL6_MOAR) $(SETTING_MOAR)
$(RM_F) $(M_BAT_RUNNER)
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-m perl6.moarvm . "" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=blib $(M_LIBPATH) . blib
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-m perl6.moarvm \$$DIR "" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=\$$DIR/blib $(M_LIBPATH) \$$DIR \$$DIR/blib
-$(CHMOD) 755 $(M_BAT_RUNNER)

m-runner-default: $(M_BAT_RUNNER)
@@ -211,21 +211,21 @@ $(PERL6_DEBUG_MOAR): src/perl6-debug.nqp $(PERL6_MOAR)
--vmlibs=$(M_PERL6_OPS_DLL)=Rakudo_ops_init $(M_BUILD_DIR)/perl6-debug.nqp

$(M_BAT_DEBUG_RUNNER): tools/build/create-moar-runner.p6 $(M_C_DEBUG_RUNNER) $(PERL6_DEBUG_MOAR) $(SETTING_MOAR)
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-debug-m perl6-debug.moarvm . "" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=blib $(M_LIBPATH) . blib
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-debug-m perl6-debug.moarvm \$$DIR "" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=\$$DIR/blib $(M_LIBPATH) \$$DIR \$$DIR/blib

$(M_GDB_RUNNER): tools/build/create-moar-runner.p6 $(M_C_RUNNER) $(PERL6_MOAR) $(SETTING_MOAR)
$(RM_F) $(M_GDB_RUNNER)
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-gdb-m perl6.moarvm . "gdb" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=blib $(M_LIBPATH) . blib
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-gdb-m perl6.moarvm \$$DIR "gdb" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=\$$DIR/blib $(M_LIBPATH) \$$DIR \$$DIR/blib
-$(CHMOD) 755 $(M_GDB_RUNNER)

$(M_LLDB_RUNNER): tools/build/create-moar-runner.p6 $(M_C_RUNNER) $(PERL6_MOAR) $(SETTING_MOAR)
$(RM_F) $(M_LLDB_RUNNER)
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-lldb-m perl6.moarvm . "lldb" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=blib $(M_LIBPATH) . blib
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-lldb-m perl6.moarvm \$$DIR "lldb" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=\$$DIR/blib $(M_LIBPATH) \$$DIR \$$DIR/blib
-$(CHMOD) 755 $(M_LLDB_RUNNER)

$(M_VALGRIND_RUNNER): tools/build/create-moar-runner.p6 $(M_C_RUNNER) $(PERL6_MOAR) $(SETTING_MOAR)
$(RM_F) $(M_VALGRIND_RUNNER)
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-valgrind-m perl6.moarvm . "valgrind" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=blib $(M_LIBPATH) . blib
$(M_RUN_PERL6) tools/build/create-moar-runner.p6 moar "$(MOAR)" perl6-valgrind-m perl6.moarvm \$$DIR "valgrind" $(PERL6_HOME) $(NQP_HOME) --nqp-lib=\$$DIR/blib $(M_LIBPATH) \$$DIR \$$DIR/blib
-$(CHMOD) 755 $(M_VALGRIND_RUNNER)

$(M_C_RUNNER): src/vm/moar/runner/main.c
@@ -106,8 +106,9 @@ sub get-perl6-runner($perl6, $env-vars) {
}

sub get-moar-runner($moar, $libpath-line) {
return sprintf(q:to/EOS/, $moar, $libpath-line);
#!/bin/sh
return sprintf(q:to/EOS/, $sh-prelude, $moar, $libpath-line);
%s
exec %s --execname="$0" %s "$@"
EOS
}
@@ -145,8 +146,9 @@ sub get-perl6-debug-runner($toolchain, $perl6, $env-vars) {
sub get-moar-debug-runner($toolchain, $moar, $libpath-line) {
my $cmdline = $toolchain eq 'gdb' ?? 'gdb --quiet --ex=run --args %s --execname="$0" %s "$@"'.sprintf($moar, $libpath-line)
!! $toolchain eq 'lldb' ?? 'lldb %s -- --execname="$0" %s "$@"'.sprintf($moar, $libpath-line) !! die;
return sprintf(q:to/EOS/, $moar, $libpath-line, get-debugger-text($toolchain), $cmdline);
#!/bin/sh
return sprintf(q:to/EOS/, $sh-prelude, $moar, $libpath-line, get-debugger-text($toolchain), $cmdline);
%s
%s --execname="$0" %s -e '%s'
%s
EOS

0 comments on commit 9917624

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