From Fedora Project Wiki

(Refactor table; break out reqs into sections; "examples" tables in req sections; write blurb at the beginning)
Line 1: Line 1:
 
Brain dump.  Comments welcome and appreciated, on the talk page.
 
Brain dump.  Comments welcome and appreciated, on the talk page.
  
= Current Flaws=
+
= Current Status =
  
= Needed =
+
<code>rpmbuild</code> 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 percentage of Perl packages in Fedora having some sort of wrapper around the autoprov/req scripts.
  
# Understands "use base", "use parent", etc, constructs.
+
It's time for new autoprov/req scripts.
# Understands [[Moose]]
 
## "extends" - subclassing
 
## "with" - roles
 
## "metaclass" - metaclasses
 
## "traits" - metaclass roles
 
# Understands [[Catalyst]] plugin speficication syntax
 
#* This should be extensible to other module classes
 
# Doesn't generate duplicates.  e.g.: perl(Foo) and perl(Foo) >= 1.9
 
# Better able to deal with the wonders of Perl versioning; e.g.
 
#* 1.20a stays 1.20a
 
#* 1.20 becomes 1.020000 (version triplet)
 
  
 
= Questions =
 
= Questions =
  
# Should we attempt to compile? (a la <code>perl -wc</code> or {{CPAN|Module::ScanDeps}})
 
#* PROS: highly accurate
 
#* CONS: may fail for a variety of reasons
 
 
# Should we try to normalize the versions?
 
# Should we try to normalize the versions?
  
 +
== Requirements ==
 +
 +
Apologies to those of us without widescreen monitors :)
  
 
{|
 
{|
|'''Requirement'''||'''Example'''||'''Current'''||'''Target'''||'''Compat?'''||'''Comment'''
+
|'''Requirement'''||'''Example'''||'''Current Auto-Reqs'''||'''Target Auto-Reqs'''||'''Compat?'''
 
|-
 
|-
 
|''<code>use base</code> constructs correctly evaluated''||<pre>use base 'XXX';</pre>||<pre>perl(base)</pre>||<pre>perl(base)
 
|''<code>use base</code> constructs correctly evaluated''||<pre>use base 'XXX';</pre>||<pre>perl(base)</pre>||<pre>perl(base)
perl(XXX)</pre>|| ||Need also to correctly evaluate <code>use parent ...</code>, etc.
+
perl(XXX)</pre>||  
 
|-
 
|-
|''No duplicate provides''|| || || || ||We often see duplicate requires.  These are harmless, except in the case where one requires is versioned and another unversioned.<br><br>This might need to be addressed at a higher level than perl.prov.
+
|''No duplicate provides''|| || || ||  
 
|-
 
|-
|''Mo*se subclassing''||<pre>extends 'Some::Class';</pre>|| ||<pre>perl(Some::Class)</pre>|| ||Multiple classes can be specified; not possible to specify version with this syntax.
+
|''Mo*se subclassing''||<pre>extends 'Some::Class';</pre>||None.||<pre>perl(Some::Class)</pre>||
 
|-
 
|-
 
|''Mo*se roles''||<pre>with 'Some::Class';
 
|''Mo*se roles''||<pre>with 'Some::Class';
  
 
# multiple roles at once
 
# multiple roles at once
with 'Role::A', 'Role::B';</pre>|| ||<pre>perl(Some::Class)
+
with 'Role::A', 'Role::B';</pre>||None.||<pre>perl(Some::Class)
  
 
perl(Role::A)
 
perl(Role::A)
perl(Role::B)</pre>|| ||Multiple classes can be specified; not possible to specify version with this syntax.
+
perl(Role::B)</pre>||
 
|-
 
|-
 
|''Mo*se traits''||...in an attribute specification:<pre>...
 
|''Mo*se traits''||...in an attribute specification:<pre>...
traits => [ 'X', 'Y' ]</pre>|| ||<pre>perl(Moose::Meta::Custom::Trait::X)
+
traits => [ 'X', 'Y' ]</pre>||None.||<pre>perl(Moose::Meta::Custom::Trait::X)
perl(Moose::Meta::Custom::Trait::Y)</pre>|| ||This is going to be tricky.
+
perl(Moose::Meta::Custom::Trait::Y)</pre>||
 
|-
 
|-
|''Mo*se metaclasses''|| || || || ||
+
|''Mo*se metaclasses''|| || || ||
 
|-
 
|-
 
|''Catalyst and other plugin syntax''||<pre>use Catalyst qw/
 
|''Catalyst and other plugin syntax''||<pre>use Catalyst qw/
Line 57: Line 46:
 
perl(Catalyst::Plugin::ConfigLoader)
 
perl(Catalyst::Plugin::ConfigLoader)
 
perl(Catalyst::Plugin::Static::Simple)
 
perl(Catalyst::Plugin::Static::Simple)
</pre>|| ||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
+
</pre>||
 +
|-
 +
|''Ability to include/exclude''|| || || ||
 +
|}
 +
 
 +
=== 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 <code>use base</code> and <code>use parent</code> style constructs need to be recognized and handled.  (They're basically the same thing, anyways.)
 +
 
 +
{|
 +
|-
 +
|'''Example'''||'''Current'''||'''Target'''||'''Compat?'''||'''Comment'''
 +
|-
 +
|}
 +
 
 +
=== Mo*se syntax ===
 +
 
 +
Both {{CPAN|Moose}} and {{CPAN|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
 +
 
 +
==== with ====
 +
 
 +
* Multiple classes can be specified
 +
* not possible to specify version with this syntax
 +
 
 +
==== metaclasses ====
 +
 
 +
Class, attribute, methods.
 +
 
 +
{|
 +
|-
 +
|'''Example'''||'''Current'''||'''Target'''||'''Compat?'''||'''Comment'''
 
|-
 
|-
|''Ability to include/exclude''|| || || || ||
 
 
|}
 
|}
  
 +
==== traits ====
 +
 +
Class, attribute, methods.
  
== Requirements ==
+
{|
 +
|-
 +
|'''Example'''||'''Current'''||'''Target'''||'''Compat?'''||'''Comment'''
 +
|-
 +
|}
  
 
=== Catalyst and other plugin syntax ===
 
=== 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 <code>use</code> statements.
  
 
{|
 
{|

Revision as of 00:32, 20 February 2009

Brain dump. Comments welcome and appreciated, on the talk page.

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 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 Example Current Auto-Reqs Target Auto-Reqs Compat?
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 include/exclude

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 Compat? Comment

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

with

  • Multiple classes can be specified
  • not possible to specify version with this syntax

metaclasses

Class, attribute, methods.

Example Current Target Compat? Comment

traits

Class, attribute, methods.

Example Current Target Compat? 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 Compat? Comment
use Catalyst qw/
  -Debug 
  ConfigLoader 
  Static::Simple/;
perl(Catalyst)
perl(Catalyst)
perl(Catalyst::Plugin::ConfigLoader)
perl(Catalyst::Plugin::Static::Simple)
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