Build Rakudo with Distutils

Andy Dougherty doughera at lafayette.edu
Mon Mar 29 13:35:39 UTC 2010


On Sun, 28 Mar 2010, Fran?ois Perrad wrote:

> 2010/3/28 Andy Dougherty <doughera at lafayette.edu>:

> > I'm pretty sure this is a recurrence of [perl #66560].  See that ticket
> > for the diagnosis and fix currently in use in rakudo.
> >
> > However, it's not at all obvious to me how someone trying to
> > install rakudo could fix it.  At least with a Makefile, it's
> > often obvious how you can hand-edit the Makefile and try to fix it.
> > Here, it's not.  Looking at the trace at the end, it refers to a file
> > "runtime/parrot/library/distutils.pir" which doesn't exist.  (It may have
> > existed in the build directory, but that's not around anymore.)  There is
> > a file distutils.pir in $prefix/lib/2.2.0-dev/library, but editing it
> > (assuming you have permission) doesn't appear to change anything.  I
> > expect that's because the precompiled distutils.pbc file is loaded
> > instead.
> 
> yes, but you could modify the setup.nqp (line 7)
>     pir::load_bytecode('distutils.pir');
> by this way, you load a distutils.pir file with your alteration.
> 
> the attached patch adds the option --no-lines

Thanks.  I can verify that if I make a copy of parrot's distutils.pir in 
the rakudo directory, apply this patch, and add a leading space, changing
    +    pmc2c .= "--no-lines "
to 
    +    pmc2c .= " --no-lines "

then the rakudo build gets past this step.  (It runs out of memory 
building src/gen/perl6-actions.pir, but that happens with the plain 
Makefile too, and is not relevant to the point at hand.)

Another way to attack the problem is to avoid the chdir().  Specifically, 
the problem arises because pmc2c is called from one directory (and #line 
directives are generated accordingly) and then chdir() is called, and the 
compiler is called from a different directory (at which point the #line 
directives are now wrong).  In the original RT, I suggested avoiding the 
chdir(), but rakudo was doing essentially

	cd src/pmc && cc -c *.c

and Patrick wanted to avoid having to manually maintain the list that *.c 
expanded to.  Since setup.nqp appears to manually maintain that list 
anyway, it could avoid the cd, which would have avoided the whole problem 
to start with.

More broadly, I also thought it worth highlighting how when distutils 
doesn't work, it can be difficult for an ordinary user to do anything 
about it.  This is a portability and support question that the rakudo 
folks should consider carefully before deciding what to do.

-- 
    Andy Dougherty		doughera at lafayette.edu


More information about the parrot-dev mailing list