Shlomi Fish | 2 Aug 2008 16:17
Picon
Gravatar

[RESEND] Machine-Manipulatable Arguments for Module::Build

Hi,

I'm re-sending this message that I sent back in 10-April and which amounted to 
very little, this time to the module-build mailing list too. See this link 
for the original message:

http://www.nntp.perl.org/group/perl.module-authors/2008/04/msg6419.html

-----------

http://xrl.us/bi6n9 (link to svn.berlios.de) is a functional spec for a way to 
tag and classify CPAN modules. Those tags and catgories should end up in the 
META.yml. However, inserting them by hand by editing the Build.PL will be:

1. Error-prone.

2. Not capabale of being manipulated by an external program - "Only perl can 
understand Perl, etc.".

3. Because of #2 won't allow the current design in the functional spec of 
invoking a "./Build config --gui" stage which will communicate with a 
web-service to give an up-to-date selection of categories.

Of course, this is not limited to this issue. I've overheard a conversation on 
a #perl where some people said they'd like to have all the (non-code) 
parameters to Module::Build be speicified in a YAML format or so.

So I've been thinking of having a special file or files for this (or 
alternatively possibly re-use the __DATA__ section of the Build.PL) in order 
to specify machine-manipulatable parameters to the Build process.
(Continue reading)

David E. Wheeler | 2 Aug 2008 22:40
Gravatar

Re: [RESEND] Machine-Manipulatable Arguments for Module::Build

On Aug 2, 2008, at 07:17, Shlomi Fish wrote:

> http://xrl.us/bi6n9 (link to svn.berlios.de) is a functional spec  
> for a way to
> tag and classify CPAN modules. Those tags and catgories should end  
> up in the
> META.yml. However, inserting them by hand by editing the Build.PL  
> will be:

You are aware of the keywords param to new(), right?

=item keywords

For describing the distribution using keyword (or "tags") in order to
make CPAN.org indexing and search more efficient and useful.

See L<http://module-build.sourceforge.net/META-spec-current.html#keywords 
 >.

> 1. Error-prone.

Why is that?

> 2. Not capabale of being manipulated by an external program - "Only  
> perl can
> understand Perl, etc.".

It looks like M::B does not current put the keywords into the META.yml  
file when you run `make distmeta`. It ought to. That's where you  
should start your patch, IMHO. Once the're in the META.yml, any YAML- 
(Continue reading)

David E. Wheeler | 2 Aug 2008 22:44
Gravatar

Re: [RESEND] Machine-Manipulatable Arguments for Module::Build

On Aug 2, 2008, at 13:40, David E. Wheeler wrote:

>> 2. Not capabale of being manipulated by an external program - "Only  
>> perl can
>> understand Perl, etc.".
>
> It looks like M::B does not current put the keywords into the  
> META.yml file when you run `make distmeta`. It ought to.

Actually, I was mistaken: It does. You just have to write it like this:

     meta_add => {
         keywords => [qw(foo bar baz)],
     },

And then it gets written to META.yml. So I'm not sure what more you  
could need.

Best,

David

Shlomi Fish | 3 Aug 2008 14:19
Picon
Gravatar

Re: [RESEND] Machine-Manipulatable Arguments for Module::Build

On Saturday 02 August 2008, David E. Wheeler wrote:
> On Aug 2, 2008, at 07:17, Shlomi Fish wrote:
> > http://xrl.us/bi6n9 (link to svn.berlios.de) is a functional spec
> > for a way to
> > tag and classify CPAN modules. Those tags and catgories should end
> > up in the
> > META.yml. However, inserting them by hand by editing the Build.PL
> > will be:
>
> You are aware of the keywords param to new(), right?
>
> =item keywords
>
> For describing the distribution using keyword (or "tags") in order to
> make CPAN.org indexing and search more efficient and useful.
>
> See L<http://module-build.sourceforge.net/META-spec-current.html#keywords
>

Hmmm... that's interesting. Sounds useful. Is it supported in 
search.cpan.org/kobesearch yet? Of course, I'd also like to have 
Freshmeat-like categories:

http://freshmeat.net/browse/18/

>  >.
> >
> > 1. Error-prone.
>
> Why is that?
(Continue reading)

Eric Wilhelm | 3 Aug 2008 19:56
Picon

Re: [RESEND] Machine-Manipulatable Arguments for Module::Build

# from Shlomi Fish
# on Sunday 03 August 2008 05:19:

>Well, I'm not proposing that we completely do away with Build.PL or
> even with the parameters given to the Module::Build constructor. I'm
> just saying that we should give a way for programs to give it
> arguments as well, without having to parse the Perl and try to make
> sense of it.
>
>So we have the machine+human-manipulatable input and the data and code
> in the Build.PL as input to Module::Build.

Ok.  So, there's an AUTHOR_META.yml or something which gets merged into 
the constructor arguments.  Except now you have to have that file and 
the latest M::B on the install machine.  But that only takes care of 
the author's side of things.

Are you wanting to modify the constructor arguments on the install side?  
Maybe some code would clarify your goal.

--Eric
--

-- 
"If you dig it, it's yours."
--An old village poet (via Al Pacino)
---------------------------------------------------
    http://scratchcomputing.com
---------------------------------------------------

David E. Wheeler | 4 Aug 2008 00:58
Gravatar

Re: [RESEND] Machine-Manipulatable Arguments for Module::Build

On Aug 3, 2008, at 05:19, Shlomi Fish wrote:

> Hmmm... that's interesting. Sounds useful. Is it supported in
> search.cpan.org/kobesearch yet? Of course, I'd also like to have
> Freshmeat-like categories:
>
> http://freshmeat.net/browse/18/

You would need to get them into the META spec, I think.

> Because "The only thing that can parse Perl is perl". It would be  
> very hard to
> write a third-party program that will parse a typical Build.PL  
> syntax and
> manipulate it along with all the possible edge-cases. For example,  
> in some of
> my modules I have used a sub-class of Module::Build (which I called
> Test::Run::Builder) instead, so if I'm looking for Module::Build I  
> won't find
> it.

Um, nothing has to parse Build.PL. It generates META.yml, which can be  
parsed. End of story. (Oh, and BTW, Adam Kennedy put the lie to "only  
Perl can parse Perl" myth.)

> Similarly, I can name the Module::Build instance in any way I want  
> which will
> further complicate things. Or I can put some of the parameters in  
> variables,
> etc.
(Continue reading)

Shlomi Fish | 4 Aug 2008 13:14
Picon
Gravatar

Re: [RESEND] Machine-Manipulatable Arguments for Module::Build

Hi!

On Monday 04 August 2008, David E. Wheeler wrote:
> On Aug 3, 2008, at 05:19, Shlomi Fish wrote:
> > Hmmm... that's interesting. Sounds useful. Is it supported in
> > search.cpan.org/kobesearch yet? Of course, I'd also like to have
> > Freshmeat-like categories:
> >
> > http://freshmeat.net/browse/18/
>
> You would need to get them into the META spec, I think.
>

OK, sounds fair.

> > Because "The only thing that can parse Perl is perl". It would be
> > very hard to
> > write a third-party program that will parse a typical Build.PL
> > syntax and
> > manipulate it along with all the possible edge-cases. For example,
> > in some of
> > my modules I have used a sub-class of Module::Build (which I called
> > Test::Run::Builder) instead, so if I'm looking for Module::Build I
> > won't find
> > it.
>
> Um, nothing has to parse Build.PL. 

Parse and modify Build.PL

(Continue reading)

David E. Wheeler | 4 Aug 2008 19:01
Gravatar

Re: [RESEND] Machine-Manipulatable Arguments for Module::Build

On Aug 4, 2008, at 04:14, Shlomi Fish wrote:

>> Um, nothing has to parse Build.PL.
>
> Parse and modify Build.PL

I agree with you: nothing should do that.

> So you agree that I should not edit META.yml directly?

Yes.

> In this case I want
> something machine-readable as input to M::B, which will eventually  
> end up at
> META.yml where the CPAN interfaces can find it.

Why? The META itself is machine-readable.

> Ah. But if I want to make it machine-readable, then I'll need a YAML  
> (or
> whatever) file which will in turn be read by Meta-Build.PL which  
> will run
> Build.PL with all of these command line args. This will add more  
> complexity,
> and will be probelamtic if someone runs Build.PL directly.

You're already talking about adding complexity, and I don't understand  
why.

(Continue reading)

Eric Wilhelm | 4 Aug 2008 19:46
Picon

Re: more META.*.yml files

# from Shlomi Fish
# on Monday 04 August 2008 04:14:

>> But a patch demonstrating what you want would probably be more
>> convincing, in that we could much better understand what it is you
>> want.
>
>I think I can accomplish that using a sub-class, so that will be my
> first lead. I'll also do it TDD-style, so you can understand what I
> mean using the tests.

Just write some code that does what you want to do.  I recommend that it 
is neither a patch nor a subclass.

  #META.in.yml
  add_to_cleanup:
    - Math-Vec-*
    - META.yml
  create_makefile_pl: passthrough
  dist_version_from: lib/Math/Vec.pm
  license: perl
  module_name: Math::Vec
  test_requires:
    Test::More: 0

  # Build.PL
  ...
  use YAML;
  my $builder = $build_class->new(
    %{YAML::LoadFile('META.in.yml')},
(Continue reading)

Shlomi Fish | 5 Aug 2008 11:03
Picon
Gravatar

Re: more META.*.yml files

On Monday 04 August 2008, Eric Wilhelm wrote:
> # from Shlomi Fish
>
> # on Monday 04 August 2008 04:14:
> >> But a patch demonstrating what you want would probably be more
> >> convincing, in that we could much better understand what it is you
> >> want.
> >
> >I think I can accomplish that using a sub-class, so that will be my
> > first lead. I'll also do it TDD-style, so you can understand what I
> > mean using the tests.
>
> Just write some code that does what you want to do.  I recommend that it
> is neither a patch nor a subclass.
>
>   #META.in.yml
>   add_to_cleanup:
>     - Math-Vec-*
>     - META.yml
>   create_makefile_pl: passthrough
>   dist_version_from: lib/Math/Vec.pm
>   license: perl
>   module_name: Math::Vec
>   test_requires:
>     Test::More: 0
>
>
>   # Build.PL
>   ...
>   use YAML;
(Continue reading)


Gmane