Q about prerequisites

2010-03-25 Thread craig

I added LWP::UserAgent to a test, and thought I had it covered
by adding LWP to Makefile.PL like this:

'BUILD_REQUIRES' = {'LWP'   = 5.834,
 'Test::More'= 0},

One of many smoke-test systems has a problem with this.
http://www.cpantesters.org/cpan/report/6979525

The report says Can't locate LWP/UserAgent.pm in @INC

Which is the best way to fix this?

1. Change 'LWP' to 'LWP::UserAgent' in BUILD_REQUIRES
2. Add 'LWP' to PREREQ_PM
3. Add 'LWP::UserAgent' to PREREQ_PM
4. Add 'LWP::UserAgent' and 'Test::More' to PREREQ_PM
5. #4 plus delete BUILD_REQUIRES

It seems we have 3 categories: config_requires, build_requires, and
requires, and it's not clear which of the last 2 applies to something
required by a test.

Please forgive if this has been asked and answered before.
I've given up on my data mining skills.

Thanks,
cmac



Re: Q about prerequisites

2010-03-25 Thread Jonathan Yu
Craig,

I havne't looked into your issue specifically but this looks like it
may be related to older CPAN.pm's which did not honour build_requires
and configure_requires. Subsequently, you probably have to do some
manual checking, though hopefully someone more experienced with doing
that sort of thing will speak up...

On Thu, Mar 25, 2010 at 12:58 PM,  cr...@animalhead.com wrote:
 I added LWP::UserAgent to a test, and thought I had it covered
 by adding LWP to Makefile.PL like this:
     'BUILD_REQUIRES' = {'LWP'           = 5.834,
                          'Test::More'    = 0},
 One of many smoke-test systems has a problem with this.
 http://www.cpantesters.org/cpan/report/6979525
 The report says Can't locate LWP/UserAgent.pm in @INC
 Which is the best way to fix this?
 1. Change 'LWP' to 'LWP::UserAgent' in BUILD_REQUIRES
 2. Add 'LWP' to PREREQ_PM
 3. Add 'LWP::UserAgent' to PREREQ_PM
 4. Add 'LWP::UserAgent' and 'Test::More' to PREREQ_PM
 5. #4 plus delete BUILD_REQUIRES
 It seems we have 3 categories: config_requires, build_requires, and
 requires, and it's not clear which of the last 2 applies to something
 required by a test.
 Please forgive if this has been asked and answered before.
 I've given up on my data mining skills.
 Thanks,
 cmac



Re: Q about prerequisites

2010-03-25 Thread David Golden
On Thu, Mar 25, 2010 at 12:58 PM,  cr...@animalhead.com wrote:
     'BUILD_REQUIRES' = {'LWP'           = 5.834,

BUILD_REQUIRES was only recently added to ExtUtils::MakeMaker in 6.56.
 You need to add 'configure_requires' to META.yml specifying
ExtUtils::MakeMaker 6.56.

That won't help users with old CPAN/CPANPLUS clients that do not honor
configure_requires, but I think most CPAN Testers use an updated
version.

-- David


Re: Q about prerequisites

2010-03-25 Thread Aristotle Pagaltzis
* cr...@animalhead.com cr...@animalhead.com [2010-03-25 18:00]:
 1. Change 'LWP' to 'LWP::UserAgent' in BUILD_REQUIRES

This won’t fix this problem, but you should do that anyway. Do
not mention distributions. The CPAN client will figure out which
distributions the user needs. Your job is to list the *modules*
you require – every single one of them, regardless of what the
distribution is called or whether several of them are part of the
same distribution.

Distributions can and do get split or combined.

If you list modules, you will be unaffected by that: the CPAN
client will simply figure out the right set of distributions to
install regardless of how they’ve evolved since the time when
your own code was released.

 It seems we have 3 categories: config_requires, build_requires,
 and requires, and it's not clear which of the last 2 applies to
 something required by a test.

None of these, really. There should really be a `test_requires`.
However, in absence of that option, what remains to be said is
that both `configure_requires` and `requires` are more wrong than
`build_requires`, so that’s what you should pick for now.

Regards,
-- 
Aristotle Pagaltzis // http://plasmasturm.org/


Re: Q about prerequisites

2010-03-25 Thread craig

Jonathan, David, Aristotle:

With such smart and helpful people as you, all problems can be solved.

Looking at the test report, EU::MM was only 6.42, which is before
it could process BUILD_REQUIRES, which makes David correct in his
diagnosis.  So I'll put CONFIG_REQUIRES = {EU:MM = 6.56} into
Makefile.PL, and check that it propagates to META.yml.

CPAN on the smokebox was 1.9402, which can presumably act on the
CONFIG_REQUIRES in META.yml.  Otherwise there would seem to be a
semantic knot wherein the 6.42 EU:MM doesn't know how to process
the new CONFIG_REQUIRES so it can replace itself!

Also I'll replace LWP by LWP::UserAgent in BUILD_REQUIRES as
Aristotle suggests.

The tester is being uncharacteristically quiet on this matter,
for someone named David :-)

Thanks to all,
cmac


On Mar 25, 2010, at 3:01 PM, Aristotle Pagaltzis wrote:


* cr...@animalhead.com cr...@animalhead.com [2010-03-25 18:00]:

1. Change 'LWP' to 'LWP::UserAgent' in BUILD_REQUIRES


This won’t fix this problem, but you should do that anyway. Do
not mention distributions. The CPAN client will figure out which
distributions the user needs. Your job is to list the *modules*
you require – every single one of them, regardless of what the
distribution is called or whether several of them are part of the
same distribution.

Distributions can and do get split or combined.

If you list modules, you will be unaffected by that: the CPAN
client will simply figure out the right set of distributions to
install regardless of how they’ve evolved since the time when
your own code was released.


It seems we have 3 categories: config_requires, build_requires,
and requires, and it's not clear which of the last 2 applies to
something required by a test.


None of these, really. There should really be a `test_requires`.
However, in absence of that option, what remains to be said is
that both `configure_requires` and `requires` are more wrong than
`build_requires`, so that’s what you should pick for now.

Regards,
--
Aristotle Pagaltzis // http://plasmasturm.org/




Re: Q about prerequisites

2010-03-25 Thread Eric Wilhelm
# from cr...@animalhead.com
# on Thursday 25 March 2010 16:39:

CPAN on the smokebox was 1.9402, which can presumably act on the
CONFIG_REQUIRES in META.yml.  Otherwise there would seem to be a
semantic knot wherein the 6.42 EU:MM doesn't know how to process
the new CONFIG_REQUIRES so it can replace itself!

If the client understands configure_requires, it gets that from META.yml 
and the Makefile.PL won't be run until there's a new EU::MM = no knot.

--Eric
-- 
Speak softly and carry a big carrot.
---
http://scratchcomputing.com
---


Re: Q about prerequisites

2010-03-25 Thread David Golden
On Thu, Mar 25, 2010 at 7:39 PM,  cr...@animalhead.com wrote:
 diagnosis.  So I'll put CONFIG_REQUIRES = {EU:MM = 6.56} into
 Makefile.PL, and check that it propagates to META.yml.

Nit:  It's CONFIGURE_REQUIRES, not CONFIG_REQUIRES.  Also, you'll
probably want to put that in a section that only runs if EU::MM is =
6.56.

-- David


Re: Q about prerequisites

2010-03-25 Thread craig

Nit: I'm a lazy typist.

The new module (HTTP::ProxyAutoConfig 0.3) has already been
uploaded.

Your comment put that in a section that only runs...
has me all confused.
I just put CONFIGURE_REQUIRES = {EU:MM = 6.56} into Makefile.PL.
It went into META.yml.

This is a small module and has no sections that I can think of.
What do you mean?

Craig


On Mar 25, 2010, at 6:10 PM, David Golden wrote:


On Thu, Mar 25, 2010 at 7:39 PM,  cr...@animalhead.com wrote:

diagnosis.  So I'll put CONFIG_REQUIRES = {EU:MM = 6.56} into
Makefile.PL, and check that it propagates to META.yml.


Nit:  It's CONFIGURE_REQUIRES, not CONFIG_REQUIRES.  Also, you'll
probably want to put that in a section that only runs if EU::MM is =
6.56.

-- David




Re: Q about prerequisites

2010-03-25 Thread David Golden
On Thu, Mar 25, 2010 at 11:04 PM,  cr...@animalhead.com wrote:
 Your comment put that in a section that only runs...
 has me all confused.
 I just put CONFIGURE_REQUIRES = {EU:MM = 6.56} into Makefile.PL.
 It went into META.yml.

 This is a small module and has no sections that I can think of.
 What do you mean?

Here is an example from Module-Starter.  Note the (eval {
ExtUtils::MakeMaker-VERSION(...) }) stanzas, which avoid older EU::MM
from complaining about invalid arguments to WriteMakefile;

  WriteMakefile(
  NAME= 'Module::Starter',
  AUTHOR  = 'Andy Lester a...@petdance.com',
  VERSION_FROM= 'lib/Module/Starter.pm',
  (eval { ExtUtils::MakeMaker-VERSION(6.21) } ? (LICENSE = 'perl') : ()),
  ABSTRACT_FROM   = 'lib/Module/Starter.pm',
  EXE_FILES   = [ 'bin/module-starter' ],
  PREREQ_PM = {
  'Test::More'= 0,
  'Test::Harness' = 0.21,
  'ExtUtils::Command' = 0,
  'File::Spec'= 0,
  'Getopt::Long'  = 0,
  'Pod::Usage'= 1.21,
  },
  (! eval { ExtUtils::MakeMaker-VERSION(6.46) } ? () :
  (META_ADD = {
  resources = {
  homepage   = 'http://code.google.com/p/module-starter/',
  repository =
'http://module-starter.googlecode.com/svn/trunk/',
  bugtracker =
'http://rt.cpan.org/NoAuth/Bugs.html?Dist=Module-Starter',
  },
  })
  ),
  dist= { COMPRESS = 'gzip -9f', SUFFIX = 'gz', },
  clean   = { FILES = 'Module-Release-*' },
  );

Some Makefile.PL's do it slightly differently, by putting all args
into something like %WriteMakefileArgs and then deleting them out
before calling WriteMakefile:

  delete $WriteMakefileArgs{LICENSE}
unless eval { ExtUtils::MakeMaker-VERSION(6.31) };

  WriteMakefile(%WriteMakefileArgs);

I hope that clarifies what I meant.

-- David