# New Ticket Created by  Bartłomiej Palmowski 
# Please include the string:  [perl #120630]
# in the subject line of all future correspondence about this issue. 
# <URL: https://rt.perl.org/Ticket/Display.html?id=120630 >


Hi,

rakudo star version: 2013.11
perl5: v5.16.3

I've encountered a following problem while doing make -j3 install in rakudo
2013.11:

+ make DESTDIR=/foo/rakudo/work/pkg install -j3
cd rakudo && make install
make[1]: Entering directory
`/foo/rakudo/work/src/rakudo-star-2013.11/rakudo'
/usr/bin/perl5.16.3 -MExtUtils::Command -e mkpath
/foo/rakudo/work/pkg/usr/lib/parrot/5.9.0/languages/nqp/lib/Perl6
*/usr/bin/perl5.16.3 -MExtUtils::Command -e cp     perl6-p
/foo/rakudo/work/pkg/usr/bin/perl6* <-- fails silently no .../usr/bin is
available at that time
/usr/bin/perl5.16.3 -MExtUtils::Command -e chmod  755
/foo/rakudo/work/pkg/usr/bin/perl6 <-- this one actually fails
/usr/bin/perl5.16.3 -MExtUtils::Command -e cp
blib/Perl6/ModuleLoader.pbc
/foo/rakudo/work/pkg/usr/lib/parrot/5.9.0/languages/nqp/lib/Perl6/ModuleLoader.pbc
*Cannot chmod 755 /foo/rakudo/work/pkg/usr/bin/perl6:No such file or
directory at /usr/lib/perl5/5.16/ExtUtils/Command.pm line 274.*
make[1]: *** [p-runner-default-install] Error 2
make[1]: *** Waiting for unfinished jobs....

Generated makefile's (rakudo/Makefile) install targets look this way:

install: p-install p-runner-default-install

'p-runner-default-install' is actually relying on the 'p-install' to create
usr/bin directory first, but according to GNU Make docs one should not rely
on the behavior that prerequisites are executed in order from left to right.

So it may happen (and it happens) that usr/bin is not created before
perl6-p is copied to said directory.

two issues are visible:

1) perl5.16.3 has broken ExtUtils::Command module (it doesn't work as a
drop in replacement to cp(1), so it is not suitable to be used from
makefile - https://rt.cpan.org/Public/Bug/Display.html?id=49815):
$ /usr/bin/perl5.16.3 -MExtUtils::Command -e cp does_not_exist
does/not/exist/as/well
$ echo $?
0

exit status is 0 so Makefile doesn't exit on copy error but later on (while
another command (ExtUtils::Command chmod) is trying to access nonexistent
file and fails (as it should)), and according to
http://search.cpan.org/~flora/ExtUtils-Command-1.18/lib/ExtUtils/Command.pmit
should return non-zero exit status

2) Generated rakudo/Makefile is not working with concurrent builds and even
with -j1 it is not guaranteed to succeed:

So basically creating dependency

p-runner-default-install: p-install

should fix the issue, however I'd suggest a fix attached to this e-mail.
diff -pruN rakudo-star-2013.11_orig/rakudo/tools/build/Makefile-Parrot.in 
rakudo-star-2013.11/rakudo/tools/build/Makefile-Parrot.in
--- rakudo-star-2013.11_orig/rakudo/tools/build/Makefile-Parrot.in      
2013-10-27 16:53:00.000000000 +0100
+++ rakudo-star-2013.11/rakudo/tools/build/Makefile-Parrot.in   2013-11-25 
22:22:01.000000000 +0100
@@ -315,10 +315,13 @@ p-install: p-all
        -$(POD2MAN) docs/running.pod --name=perl6 > 
$(DESTDIR)$(MANDIR)/man1/perl6.1
        -$(POD2MAN) docs/running.pod --name=rakudo > 
$(DESTDIR)$(MANDIR)/man1/rakudo.1
 
-p-runner-default-install: p-all
+p-runner-default-install: p-all | $(DESTDIR)$(PARROT_BIN_DIR)
        $(CP)     $(PERL6_EXE)        $(DESTDIR)$(PARROT_BIN_DIR)/perl6$(EXE)
        $(CHMOD)  755                 $(DESTDIR)$(PARROT_BIN_DIR)/perl6$(EXE)
 
+$(DESTDIR)$(PARROT_BIN_DIR):
+       $(MKPATH) $@
+
 xmas: $(PERL6_EXE) $(SETTING_PBC) $(R_SETTING_PBC)
 
 ##  targets for building a standalone perl6 executable.

Reply via email to