Better RPM Perl Auto-Requires

From FedoraProject

Jump to: navigation, search
Warning (medium size).png
This page is being actively worked on!
The contents of this page are still evolving, and likely to change. Please make any comments on the talk page, or on the fedora-perl-devel list.

Comments welcome and appreciated, on the talk page.

Contents

Current Status

rpmbuild has been able to automatically generate Perl requires and provides for some time now. In most cases, it works just fine, but in many cases it fails us, and we end up having to filter them. There have also been significant advances in Perl since the autoprov/req scripts were written, resulting in language constructs that are simply not recognized. (Moose and other metaclass-oriented frameworks are a great example of this). This has resulted in a disproportionately large percentage of Perl packages in Fedora having some sort of wrapper around the autoprov/req scripts.

It's time for new autoprov/req scripts.

Questions

  1. Should we try to normalize the versions?

Requirements

Apologies to those of us without widescreen monitors :)

Requirement Brief Example Current Auto-Reqs Target Auto-Reqs
use base constructs correctly evaluated
use base 'XXX';
perl(base)
perl(base)
perl(XXX)
No duplicate provides
Mo*se subclassing
extends 'Some::Class';
None.
perl(Some::Class)
Mo*se roles
with 'Some::Class';

# multiple roles at once
with 'Role::A', 'Role::B';
None.
perl(Some::Class)

perl(Role::A)
perl(Role::B)
Mo*se traits ...in an attribute specification:
...
traits => [ 'X', 'Y' ]
None.
perl(Moose::Meta::Custom::Trait::X)
perl(Moose::Meta::Custom::Trait::Y)
Mo*se metaclasses
Catalyst and other plugin syntax
use Catalyst qw/
  -Debug
  ConfigLoader
  Static::Simple/;
perl(Catalyst)
perl(Catalyst)
perl(Catalyst::Plugin::ConfigLoader)
perl(Catalyst::Plugin::Static::Simple)
Ability to exclude auto-generated requires w/o filtering

No duplicate requires

We often see duplicate requires. These are harmless, except in the case where one requires is versioned and another unversioned.

This might need to be addressed at a higher level than perl.prov... Maybe some sort of RPM-level Lua script? (see, e.g. RPM_scripting_with_Lua)

use base syntax

Both use base and use parent style constructs need to be recognized and handled. (They're basically the same thing, anyways.)

Example Current Target Comment
use base 'XXX';
perl(base)
perl(base)
perl(XXX)
use parent 'XXX';
perl(parent)
perl(parent)
perl(XXX)

Mo*se syntax

Both Moose and Mouse have similar subclassing and roles syntax; only Moose has metaclasses and traits (metaclass roles).

extends

  • Multiple classes can be specified
  • not possible to specify version with this syntax
Example Current Target Comment
extends 'Foo';
None.
perl(Foo)
extends 'Foo', 'Bar', 'Baz';
None
perl(Foo)
perl(Bar)
perl(Baz)

with

  • Multiple classes can be specified
  • not possible to specify version with this syntax
Example Current Target Comment
with 'Foo::Role';
None.
perl(Foo::Role)
with 'Foo::Role', 'Bar', 'Baz';
None
perl(Foo::Role)
perl(Bar)
perl(Baz)

metaclasses

Class, attribute, methods.

Example Current Target Comment

traits

Class, attribute, methods.

Example Current Target Comment

Catalyst and other plugin syntax

Note that it is quite common for a Catalyst app to have a multi-line "use Catalyst" statement; we need to be able to deal with multi-line use statements.

Example Current Target Comment
use Catalyst qw/
  -Debug 
  ConfigLoader 
  Static::Simple/;
perl(Catalyst)
perl(Catalyst)
perl(Catalyst::Plugin::ConfigLoader)
perl(Catalyst::Plugin::Static::Simple)