[Mageia-sysadm] possibility to add a package in basesystem-minimal? (long)

Jerome Quelin jquelin at gmail.com
Wed Nov 9 12:41:38 CET 2011


hi,

---------------------------------------------------------------------
following is quite long, you can skip till the question at the end of
this mail if you don't want the full background
---------------------------------------------------------------------


back in time, rpm was extracting automatically perl module requirements
with a (horrible) script trying [0] to parse the shipped perl files to
find dependencies.

this was not good: when i took ownership of lots of perl modules, my
scripts or the build on build-system were often failing because of the
wrong runtime requirements. 

perl community was also fighting this problem, and used some meta files
shipped with the distributions, stating different things such as the
requirements for the dist. this file is generated by the distribution
author.

since most perl dists were turning to this scheme [1], i wanted to take
advantage of this scheme in perl module rpms. therefore i wrote
perl.req-from-meta which extracts the runtime perl requirements from
META.yml or META.json if they are present.

of course, i had to update cpanplus::dist::mageia to automatically ship
META.* files in %doc, and "magpie fix" is now forcing the shipping of
META files in spec files updated (that is, all packages that are updated).

however, perl community found that it's not the ultimate answer. some
perl distributions are indeed having some optional requirements, or some
required dependencies depending on their environment.

eg, a dist may require Win32::API if running on windows, but not on
other platforms. or some dist may be built by its author on OSX, and
thus generated META file lists some OSX specific requirements which do
not apply on other platforms [2]. other examples abund, even if most of
the dists aren't impacted.

therefore, a solution was found: when configuring the perl distribution,
before building, testing and installing it, a new file is generated:
MYMETA.yml / MYMETA.json, which gives the perl dist prerequisites for
the *current* platform. this file is now used in priority to META.yml /
META.json by tools such as cpan / cpanp / cpanm.

and i'd like to do the same for mageia, once again. since the MYMETA
files are using the same schema than META files, the perl.req-from-meta
script is working fine with them. i also updated rpm-mageia-setup to use
MYMETA files in priority if they are shipped. [3]

but [4] the problem is that MYMETA are not always generated. "how come?"
will you say, "you said earlier that they are generated at configure
time!". well, in fact, they are generated only when the dist is
configured with ExtUtils::MakeMaker >= 6.57_07 [5] and currently
perl-base is providing the following [6]:

    perl(ExtUtils::MakeMaker) = 6.570_500

(that's 6.57_05 before conversion by %perl_convert_version)

some modules buildrequires a more recent ExtUtils::MakeMaker, and
therefore perl-ExtUtils-MakeMaker (shipping version 6.62) is installed.
but for all the modules which do not do fancy tricks in configure, no
MYMETA.yml is generated. :-(

therefore, i cannot blindly ship MYMETA.yml in %doc [7], even if they
are generated on my system: the build system will simply not generate
them and the build will fail, stating that MYMETA files are not found.


---------------------------------------------------------------------
end of background / now to the question
---------------------------------------------------------------------


to fix this problem, i can see the following solutions:

** 1. patch our perl to provide a more recent EUMM

this is a no-go from my side. even the perl5 porters aren't updating the
bundled modules anymore [8], and i don't want to go down that road. so i
veto this solution with my perl-the-package maintainer hat.


** 2. update the buildrequires of all perl modules to require a more
      recent EUMM

this is a solution that's quite easy to do on my side: i just need to
update magpie to buildrequire a more recent EUMM if it's using a
makefile.PL and that no specific EUMM version is wanted. future perls
(5.16 and onward) will likely ship an updated EUMM, and therefore i'll
be able to remove this specific requirement in the spec files.  but i'm
wondering if that's not too much, given that it'll need ~1500 [9]
modules to be updated. and yes, the goal is to have a standard solution
for all modules, not only the problematic ones.


** 3. do nothing, and just deal with the problems manually

this is the solution i adopted till now. but i bump in more and more of
those exceptions, and this is a burden for me. mageia ships more than
2500 perl modules, and usually i don't have to really dwelve in the
details of their updates. but each exception is taking some time from my
side to deal with, and i fear that the number of problems will just
continue to rise. so i'm wanting to quit using this "solution", and find
a real one. almost as important, it means that finding a real solution
means we are following cpan evolution step by step, and i think it's a
Good Thing (tm).


** 4. update basesystem-minimal to ship perl-ExtUtils-MakeMaker

this way, no need to add a buildrequires for the modules. they all get
the new build tool, and therefore will generate the MYMETA files. 


** 5. other solutions?


===> what do you say? 


thanks for reading this far,
jérôme

[0] and failing miserably quite often
[1] which is now mainstream - i don't know of a recent perl dist not
    a shipping META.yml or META.json file
[2] this is the case of perl-Sys-Info
[3] i've updated magpie to use MYMETA for generating buildrequires: but
    that's another story
[4] there is always a but
[5] or Module::Build since a long time, but lots of perl dists still use
    a Makefile.PL (and this won't slow down given the mere existance of
    Module::Install - sigh)
[6] this comes from the ExtUtils::MakeMaker bundled with perl. 
[7] both in cpanplus::dist::mageia and "magpie fix"
[8] except in the case of a security bug
[9] around half the perl modules existing in mageia


More information about the Mageia-sysadm mailing list