Bug 1452985 - Review Request: rakudo-zef - Perl6 Module Management
Summary: Review Request: rakudo-zef - Perl6 Module Management
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: Package Review
Version: rawhide
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Robert-André Mauchin 🐧
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-05-21 13:35 UTC by Gerd Pokorra
Modified: 2017-10-05 00:20 UTC (History)
6 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2017-10-05 00:20:31 UTC
Type: ---
Embargoed:
eclipseo: fedora-review+


Attachments (Terms of Use)

Description Gerd Pokorra 2017-05-21 13:35:29 UTC
Spec URL: ftp://ftp.uni-siegen.de/pub/review/zef/spec/zef.spec
SRPM URL: ftp://ftp.uni-siegen.de/pub/review/zef/srpm/zef-0.20170520git.1490608-1.fc25.src.rpm
Description: Zef is a Perl6 module manager.
Fedora Account System Username: gerd

Comment 2 Gerd Pokorra 2017-05-22 08:25:15 UTC
I added a version dependent Requires to rakudo.

   Requires:       rakudo >= %(rpm -q --queryformat="%{Version}" rakudo)

I am not sure if this is necessary.

The requires '/usr/bin/perl6' and '/usr/bin/perl6-m' are added automatically.

May be it is nice to be sure to have the same binary version.

   $ rpm -q --requires zef
   /usr/bin/perl6
   /usr/bin/perl6-m
   rakudo >= 0.2017.04.2
   ...


A new F25 scratch build with that is at:

- https://koji.fedoraproject.org/koji/taskinfo?taskID=19684275

Comment 3 Gerd Pokorra 2017-05-22 12:46:24 UTC
enhanced Description is:

%description
Zef is a Perl6 module manager that query, download, update and install modules
from of a file path (starting with . or /), URNs, URLs, paths, or identities
from the Perl6 modules directory: https://modules.perl6.org/
It automates and simplifies the installation. Depending on your privileges zef
installs the modules at the system directories or at the home directory in
'.perl6' or if you specify a destination then to that destination directory.


May be the package better should be renamed to 'rakudo-zef' or 'perl6-zef'. I would prefer the 'rakudo' prefix if a prefix should be added.


At the URL 
ftp://ftp.uni-siegen.de/pub/review/rakudo-xml-writer/spec/rakudo-xml-writer.spec is a spec-file of a Perl6 module that would build with having this zef package installed.

I hope the review of the zef package will not be difficult.

Comment 4 Paul Howarth 2017-05-31 15:39:41 UTC
A few quick comments:

I think running rpm database queries in the package build is a bad idea. This may fail when building in a chroot environment populated using a version of rpm using a different version of libdb to the target for instance. Can't you get the rakudo version from rakudo itself?

Do you know of any other perl6 packages in Fedora already? At this stage there don't appear to be any Perl6 packaging guidelines so it would be good to at least be consistent with what's there already, if anything.

I don't think you need to gzip the manpage; rpm should do that itself, and may choose to use a different compression format in the future.

You should BR: perl-podlators for pod2man. Consider also optionally adding BR: for coreutils and sed, which the spec calls for in %install.

Comment 5 Gerd Pokorra 2017-05-31 19:54:52 UTC
(In reply to Paul Howarth from comment #4)
> A few quick comments:
> 
> I think running rpm database queries in the package build is a bad idea.
> This may fail when building in a chroot environment populated using a
> version of rpm using a different version of libdb to the target for
> instance. Can't you get the rakudo version from rakudo itself?

The command 
 perl6 -e 'say $*PERL.version'
 v6.c
do not what we need. As far as I know there is no special variable for it.

The only think I know is to filter the output of 'perl6 -v'

For example:
perl6 -v | head -n1 | sed -e 's/This is Rakudo version //' | sed -e 's/ built on.*//


> Do you know of any other perl6 packages in Fedora already? At this stage
> there don't appear to be any Perl6 packaging guidelines so it would be good
> to at least be consistent with what's there already, if anything.

There are currently only the packages MoarVM > NQP > rakudo in Fedora.

My be could have a group package (rakudo-star) on top, for installing all the stuff together like it is for livetex. Perhaps the experience of packaging Perl 5 will help.

> 
> I don't think you need to gzip the manpage; rpm should do that itself, and
> may choose to use a different compression format in the future.
> 
> You should BR: perl-podlators for pod2man. Consider also optionally adding
> BR: for coreutils and sed, which the spec calls for in %install.

The new srpm-URL is:
ftp://ftp.uni-siegen.de/pub/review/zef/srpm/zef-0.20170520git.1490608-2.fc25.src.rpm

ftp://ftp.uni-siegen.de/pub/review/zef/spec/zef.spec links to version 2 of the spec file.

- the manpage is not explicitly gzipped any more
- add BR: coreutils sed and perl-podlators

Comment 6 Gerd Pokorra 2017-06-01 05:59:54 UTC
I could add a file with the rakudo rpm version at the rakudo package.

Comment 7 Paul Howarth 2017-06-01 15:11:13 UTC
I see some interesting discussion on Perl6 packaging (for debian, but similar considerations apply in Fedora):
https://github.com/ugexe/zef/issues/117

It would be nice to be able to use --install-to=vendor but zef doesn't currently appear to support a --destdir=%{buildroot} sort of thing.

I think it could be useful for rakudo to drop a file into /usr/lib/rpm/macros.d (like perl-macros does) containing its version number, which would be a convenient way for module packagers to add the necessary dependency. Such a file might also include definitions like %perl6_vendorlib, %perl6_sitearch etc.

Comment 8 Gerd Pokorra 2017-06-01 17:00:11 UTC
From the current git checkout of zef it is only possible to use:
 -install-to=%{buildroot}..
But the zef command from the package works.


> https://github.com/ugexe/zef/issues/117
It is interesting to read this imported information.
>
> It would be nice to be able to use --install-to=vendor but zef doesn't
> currently appear to support a --destdir=%{buildroot} sort of thing.
>
> I think it could be useful for rakudo to drop a file into /usr/lib/rpm/macros.d
> (like perl-macros does) containing its version number, which would be a
> convenient way for module packagers to add the necessary dependency. Such a
> file might also include definitions like %perl6_vendorlib, %perl6_sitearch etc.
>

I think 'vendordir' and 'sitedir' should be get from the installed rakudo:

> perl6 -e '.say for $*REPO.repo-chain;'
inst#/home/userhome/.perl6
inst#/usr/lib64/perl6/site
inst#/usr/lib64/perl6/vendor
inst#/usr/lib64/perl6
CompUnit::Repository::AbsolutePath.new(next-repo => CompUnit::Repository::NQP.new(next-repo => CompUnit::Repository::Perl5.new(next-repo => CompUnit::Repository)))
CompUnit::Repository::NQP.new(next-repo => CompUnit::Repository::Perl5.new(next-repo => CompUnit::Repository))
CompUnit::Repository::Perl5.new(next-repo => CompUnit::Repository)

>

(The command is at the URL: https://docs.perl6.org/language/5to6-perlvar)

I also find something nice for the release version:

> perl6 -e '.say for $*PERL.compiler.version;'
v2017.04.2
>

Comment 9 Gerd Pokorra 2017-06-01 17:39:24 UTC
In a first test I tried this:

> cat /usr/lib/rpm/macros.d/macros.perl6
%rakudo_version    %(perl6 -e 'say $*PERL.compiler.version;')
>

Comment 10 Gerd Pokorra 2017-06-02 02:20:40 UTC
The new srpm-URL is:
ftp://ftp.uni-siegen.de/pub/review/zef/srpm/zef-0.20170520git.1490608-3.fc25.src.rpm

ftp://ftp.uni-siegen.de/pub/review/zef/spec/zef.spec links to version 3 of the spec file.


This macros are added:

%define __perl6         /usr/bin/perl6
%define rakudo_rpm_version  %(%{__perl6} -e 'say $*PERL.compiler.version;' | %{__sed} s/v/0./)


I will drop the file /usr/lib/rpm/macros.d/macros.perl6 with equivalent macros at the next update of the rakudo package.


Suggestions for more perl6 macros are welcome. 


I am not sure if it would be perhaps better to hard-code the rakudo rpm version number at the build of rakudo in the macro file.

Comment 11 Gerd Pokorra 2017-06-02 08:23:37 UTC
I created a github repository 

 https://github.com/gerd/macro.perl6.git

with a draft for the file macros.perl6 (https://github.com/gerd/macro.perl6/blob/master/macros.perl6) to collect code and suggestions.

Comment 12 Paul Howarth 2017-06-02 11:10:00 UTC
I think perl6 code in rpms should be in the vendor directories rather than the site directories.

I think the precompiling of the code should happen in the rpm, as is done for python packages, but how tight a dependency on compiler version would that require? I imagine having to do a mass rebuild of all perl6 modules for minor updates of rakudo would be an onerous task if it was necessary.

(In reply to Gerd Pokorra from comment #11)
> I created a github repository 
> 
>  https://github.com/gerd/macro.perl6.git
> 
> with a draft for the file macros.perl6
> (https://github.com/gerd/macro.perl6/blob/master/macros.perl6) to collect
> code and suggestions.

I think hard-coding version numbers and directory locations is fine, particularly if the file comes with/is built from the rakudo package itself, which is where these things would be specified anyway. Everything should at least be consistent then.

I think now is probably a time to brainstorm how to do perl6 packaging rather moving forward with it just yet: I'll have limited computer access next week and Petr may be busy with the Perl 5.26 mass rebuild in rawhide, though i think Jitka is running with that.

Comment 13 Gerd Pokorra 2017-06-03 01:35:45 UTC
Thank you for your support so far Paul. I like the idea that the rakudo package should provide a macro file. Thank you for the information and organisation that someone is running on that. I will be on a trip this weekend. Next week I will not have much time. So I can not do a rakudo package update before the next 7 or 14 days.

Comment 14 Gerd Pokorra 2017-06-08 07:41:56 UTC
Builds for rakudo that adds a RPM build macro file for Perl6 modules are done.

rawhide (f27):
https://koji.fedoraproject.org/koji/taskinfo?taskID=19902606


f26:
https://koji.fedoraproject.org/koji/taskinfo?taskID=19908927
according Update URL:
 https://bodhi.fedoraproject.org/updates/FEDORA-2017-75884c20f5
 or https://bodhi.fedoraproject.org/updates/rakudo-0.2017.04.2-4.fc26


f25:
https://koji.fedoraproject.org/koji/taskinfo?taskID=19908941
according Update URL:
 https://bodhi.fedoraproject.org/updates/FEDORA-2017-8affb99954
 or https://bodhi.fedoraproject.org/updates/rakudo-0.2017.04.2-4.fc25


The content of the /usr/lib/rpm/macros.d/macros.perl6 file for a 64bit architecture is:

> cat /usr/lib/rpm/macros.d/macros.perl6
# Perl6-specific RPM build macros for Perl6 modules.
#

%__perl6		/usr/bin/perl6
%rakudo_rpm_version	0.2017.04.2


%perl6_vendor_dir       /usr/lib64/perl6/vendor

%perl6_site_dir         /usr/lib64/perl6/site

>

Comment 15 Gerd Pokorra 2017-06-10 10:19:33 UTC
Brainstorming how to do perl6 module packaging:

I will try the perl6 script 'tools/install-dist.pl' from the rakudo sources and report about it here.

Comment 16 Gerd Pokorra 2017-06-12 18:07:30 UTC
It is easier and better to use the perl6 script 'tools/install-dist.pl' to packaging perl6 modules, I think.

At the URL

 - ftp://ftp.uni-siegen.de/pub/review/rakudo-json-tiny/srpm/rakudo-json-tiny-0.20170612git-1.fc25.src.rpm

I uploaded an srpm as example that uses the perl6 program 'install-dist.pl'. The file is included as Source1 and taken from Radkudo 2017.05 and is the same in Raduod-Star 2017.05.


I intend to make a new rakudo package that provides the install-dist.pl tool and store it as %{_libdir}/perl6/bin/mod_inst.pl.

I intent also to add a macro for it:

%perl6_mod_inst    /usr/lib64/perl6/bin/mod_inst.pl


The SRPM rakudo-json-tiny uses the macros (rakudo_rpm_version and erl6_vendor_dir) from the rakudo package that is currently in the testing state:

$ bodhi rakudo | head -2
No handlers could be found for logger "fedora.client.bodhi"
14 updates found (14 shown)
 rakudo-0.2017.04.2-4.fc25                    enhancement  testing   2017-06-09 
 rakudo-0.2017.04.2-4.fc26                    enhancement  testing   2017-06-09 
$



Could the review of the zef package go on? It is at least a nice tool to list the installed Perl6 modules:

$ zef list --installed
===> Found via /usr/lib64/perl6/site
zef:ver('0.1.14'):auth('github:ugexe')
XML::Writer
===> Found via /usr/lib64/perl6
CORE:ver('6.c'):auth('perl')
===> Found via /usr/lib64/perl6/vendor
JSON::Tiny
$


Is the use of

export QA_SKIP_BUILD_ROOT=1

a reason that the package can not pass the review or does it not matter?



As next I will make builds that use the new macros. For the zef package I like the %{perl6_site_dir} as destination.

Comment 17 Gerd Pokorra 2017-06-12 19:07:33 UTC
The new srpm-URL is:
- ftp://ftp.uni-siegen.de/pub/review/zef/srpm/zef-0.20170520git.1490608-4.fc25.src.rpm

ftp://ftp.uni-siegen.de/pub/review/zef/spec/zef.spec links to version 4 of the spec file.

rawhide scratch build URL:

- https://koji.fedoraproject.org/koji/taskinfo?taskID=20001297


The rpmlint output looks normal:

$ rpmlint zef.spec 
zef.spec: W: no-%build-section
0 packages and 1 specfiles checked; 0 errors, 1 warnings.
$ 

$ rpmlint /home/gz016/rpmbuild/RPMS/x86_64/zef-0.20170520git.1490608-4.fc25.x86_64.rpm
zef.x86_64: E: no-binary
zef.x86_64: W: only-non-binary-in-usr-lib
1 packages and 0 specfiles checked; 1 errors, 1 warnings.
$

Comment 18 Gerd Pokorra 2017-06-19 14:42:50 UTC
- remove QA_SKIP_BUILD_ROOT variable
- split installation in two steps
- add information of the creating of the tar archive
- rename the package to rakudo-zef
- update to 0.20170619git.48efafc


Successful scratch builds:

F25:
https://koji.fedoraproject.org/koji/taskinfo?taskID=20065540

F26:
https://koji.fedoraproject.org/koji/taskinfo?taskID=20065487


The new srpm-URL is: ftp://ftp.uni-siegen.de/pub/review/zef/srpm/rakudo-zef-0.20170619git.48efafc-1.fc25.src.rpm


ftp://ftp.uni-siegen.de/pub/review/zef/spec/rakudo-zef.spec links to version 1 of the new rakudo-zef spec file of the new zef version.


I renamed the package to rakudo-zef, because with installing 'dnf install rakudo-*' the package manager should be installed.



rakudo builds of 2017.06 are done and provides the script tools/install-dist.pl with macro as:
%perl6_mod_inst    /usr/lib64/perl6/bin/mod_inst.pl

This rakudo updates are at:

F25:
https://bodhi.fedoraproject.org/updates/FEDORA-2017-0e46c90218

F26:
https://bodhi.fedoraproject.org/updates/FEDORA-2017-38e81c3b2c



The rakudo-zef spec file do not use the tools/install-dist.pl script, I like to use the own 'bin/zef install' command for the zef build.


The rakudo-zef package need the macros provided from the rakudo-version >= 0.2017.04.2-4 to build which is in the update repository of F25 and F26.

Comment 19 Gerd Pokorra 2017-06-20 12:40:24 UTC
After removing the BUILD directory I noticed that the package do not work any more.


So I uploaded again a new version without that problem:

 The new srpm-URL is: 
  - ftp://ftp.uni-siegen.de/pub/review/zef/srpm/rakudo-zef-0.20170619git.48efafc-1.fc25.src.rpm


 ftp://ftp.uni-siegen.de/pub/review/zef/spec/rakudo-zef.spec links to version 2 of the rakudo-zef spec file.


- added check-section
- switched to install with the 'tools/install-dist.pl' script from the rakudo sources
- install to vendor_dir


URL of a rawhide scratch build:
 https://koji.fedoraproject.org/koji/taskinfo?taskID=20070176


rakudo-zef builds with the rakudo version 0.2017.06 in rawhide and the currently updates in the testing repository of F25 and F26.

Comment 20 Gerd Pokorra 2017-06-30 15:21:03 UTC
- get the sources from the Perl6 directory of CPAN

The spec file corresponds to the 'Fedora Packaging Guidelines for Perl 6 Modules'

- https://fedoraproject.org/wiki/Packaging/Perl6?rd=Packaging/Perl6

The new srpm-URL is:

- ftp://ftp.uni-siegen.de/pub/review/zef/srpm/rakudo-zef-0.1.15-1.fc25.src.rpm


- ftp://ftp.uni-siegen.de/pub/review/zef/spec/rakudo-zef.spec links to version 3 of the rakudo-zef spec file.


Successful scratch builds are at:

F25
https://koji.fedoraproject.org/koji/taskinfo?taskID=20262875

F26
https://koji.fedoraproject.org/koji/taskinfo?taskID=20264274

F27
https://koji.fedoraproject.org/koji/taskinfo?taskID=20262886



The rakudo-zef package could be installed from the scratch build

> wget https://kojipkgs.fedoraproject.org//work/tasks/2877/20262877/rakudo-zef-0.1.15-1.fc25.x86_64.rpm
> dnf install rakudo-zef-0.1.15-1.fc25.x86_64.rpm

and works fine:

> zef list --installed
===> Found via /usr/lib64/perl6
CORE:ver('6.c'):auth('perl')
===> Found via /usr/lib64/perl6/vendor
zef:ver('0.1.15'):auth('github:ugexe')
>

Comment 21 Robert-André Mauchin 🐧 2017-09-13 10:45:13 UTC
Hello,


 - https://travis-ci.org/ugexe/zef doesn't seem to be a suitable URL for a homepage. Check https://github.com/ugexe/zef instead

 - The latest published version on https://github.com/ugexe/zef is 0.1.27, I guess you should bump the package like this:

URL:		https://github.com/ugexe/zef
Source0:	%url/archive/v%{version}/%{name}-%{version}.tar.gz


Although the package builds fine on Fedora 27, it fails to build on Rawhide:

>+ /usr/lib64/perl6/bin/mod_inst.pl --to=/builddir/build/BUILDROOT/rakudo-zef-0.1.27-1.fc28.x86_64/usr/lib64/perl6/vendor --for=vendor
>Unhandled exception: While looking for 'ModuleLoader.moarvm': no such file or directory
>   at <unknown>:1  (/usr/lib64/perl6/runtime/perl6.moarvm:<dependencies+deserialize>)
>

I'm not a Perl specialist, maybe you have some insight as to why it fails with such error.

Comment 22 Gerd Pokorra 2017-09-15 09:04:28 UTC
I have done a test build in rawhide. A complete rebuild of the rakudo stack (moarvm, nqp and rakudo rpms) fixed the problem in rawhide.

The specfile is changed to take the source tar file from Github.

Rakudo 2017.08 do not build on the architectures s390x ppc64, so the zef package do need also to exclude them.

The appropriate changelog entry is:
- get the sources from Github
- need to exclude the architectures: s390x ppc64
- update to 0.1.29



The new srpm-URL is:

- ftp://ftp.uni-siegen.de/pub/review/zef/srpm/rakudo-zef-0.1.29-1.fc26.src.rpm

- ftp://ftp.uni-siegen.de/pub/review/zef/spec/rakudo-zef.spec links to version 5 of the rakudo-zef spec file.



Successful scratch builds are at:

F28 (rawhide):
https://koji.fedoraproject.org/koji/taskinfo?taskID=21877183

F27:
https://koji.fedoraproject.org/koji/taskinfo?taskID=21877346

F26:
https://koji.fedoraproject.org/koji/taskinfo?taskID=21877459

Comment 23 Robert-André Mauchin 🐧 2017-09-15 09:51:11 UTC
Perfect, package accepted. Thanks for your work!

Comment 24 Gwyn Ciesla 2017-09-15 12:29:12 UTC
(fedrepo-req-admin):  The Pagure repository was created at https://src.fedoraproject.org/rpms/rakudo-zef

Comment 25 Gerd Pokorra 2017-09-15 12:38:54 UTC
Thank you very much for the review!!

Comment 26 Fedora Update System 2017-09-15 14:09:42 UTC
rakudo-zef-0.1.29-1.fc26 has been submitted as an update to Fedora 26. https://bodhi.fedoraproject.org/updates/FEDORA-2017-fe72d7dbfc

Comment 27 Fedora Update System 2017-09-16 04:25:54 UTC
rakudo-zef-0.1.29-1.fc26 has been pushed to the Fedora 26 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2017-fe72d7dbfc

Comment 28 Fedora Update System 2017-09-23 20:22:02 UTC
rakudo-zef-0.1.29-1.fc26 has been pushed to the Fedora 26 stable repository. If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.