How about packaging Perl6 modules ?

Alessandro Ghedini al3xbio at gmail.com
Sat Oct 1 11:58:35 UTC 2011


On Fri, Sep 30, 2011 at 07:15:48PM +0200, Dominique Dumont wrote:
> Hello Allessandro
> 
> Le Tuesday 27 September 2011 15:00:02, Alessandro Ghedini a écrit :
> > I've been working on packaging nqp (2011.09) for Debian. It is needed by 
> > the new version of rakudo which should be released very soon.
> 
> Looks like nqp packaging is stalled until next parrot release.
> 
> In the meantime, if you have spare time, do you think you could have a look at 
> packaging Perl6 modules ?
> 
> We'd need to decide
> 
> - package naming policy (i.e. libfoo-perl6 or perl6-foo ?)
> - what can be reused from panda [2] to package Perl6 modules
> - what about dh-make-perl 
> - ...

I had a look at Perl6 modules packaging some months ago, and I found some
"issues" that need to be resolved first (note that some of them may not
apply anymore). Here's what I found:

1) We need a standard way to build those packages (there's no such thing
   as ExtUtils::MakeMaker for Perl6). The panda module manager uses a 
   script called ufo [0] which basically generates a Makefile out of every
   file it finds under lib/, bin/, etc. There are a couple of issues with it
   though: 

   a) by default it compiles *.pm files to PIR to improve performance. This
      may make those files dependant on a specific parrot version.
   b) IIRC it installs those *.pir files to a versioned directory, something
      like "/usr/local/lib/parrot/X.Y.Z/..." or so.
      may not work anymore.

   Both of them may cause all the Perl6 packages to need a rebuild after 
   each new parrot upload.

   The obvious solution is to make our own script that does not compile
   to PIR and installs the modules to a directory we want (something called
   e.g. dh_perl6). I didn't try yet to write anything useful though. Also 
   note that this may decrease the performance of modules loading 
   significantly (I only tried with the old rakudo in Debian, rakudo 
   2011.09 should improve overall performance).

2) According to "Perl 6 Policy" [1], the Perl6 modules should be installed
   under "/usr/share/perl6" but rakudo does not "support" it. We should 
   patch rakudo to support that path (as the Ruby maintainers are doing for
   ruby).

3) Most of the Perl6 modules [2] do not state copyright and licensing
   information, some of them do not even try to properly version the code,
   and other are flagged as "experimental". We should then file bugs 
   upstream for every module we would want to package. This is IMHO the 
   most serious issue.

4) IIRC some of the modules may not work with the new rakudo 2011.09 due to
   all the changes it introduces. The risk is that we package some modules
   for v2011.07 and then have to remove them, because they don't work with
   v2011.09.

Regarding package names, [1] states that they should be named lib*-perl6. I
think this may be changed if we wanted, but I'd rather keep it, to maintain
some sort of "integration" with Perl5 modules (more over if they are going 
to be maintained by the Perl Group).

Regarding dh-make-perl, I didn't try it, but I'm quite sure it won't work
with Perl6 modules due to the new META.info thing (that should replace
META.{yaml,json}). I am not a dh-make-perl expert but this shouldn't be
difficult to fix (META.info is just a json document), and add, I don't know,
a --perl6 flag? But we should find some sort of workflow for Perl6
packages first.

Also, there's no such thing as CPAN for Perl6 so that we would have to 
generate the tarballs directly from the git repositories (this wouldn't 
have been an issue if modules' maintainers properly versioned their modules 
with e.g. git tags, given that all of them are on GitHub).

There shouldn't be any issue with lintian. It used to warn about the unknown
perl6 interpreter (#636354) but this is now fixed and I can't think of any
other issue that may arise.

That's all, I think. Most of the above issues are easily fixed, some other
(e.g. the third) may require some more time, but are "doable" with some
patience.

Cheers

[0] https://github.com/masak/ufo
[1] http://www.debian.org/doc/packaging-manuals/perl-policy/ap-perl6.html
[2] http://modules.perl6.org/

-- 
perl -E'$_=q;$/= @{[@_]};and s;\S+;<inidehG ordnasselA>;eg;say~~reverse'



More information about the Pkg-rakudo-devel mailing list