Re: Devel::CheckLib: Please try to break our code!

2007-10-21 Thread Ken Williams


On Oct 19, 2007, at 6:00 AM, David Cantrell wrote:

Dave Golden and I have been hacking on Devel::CheckLib, which  
should be
on a CPAN mirror near you soon.  It's similar to Devel::CheckOS, in  
that
it will let module authors specify dependencies which aren't just  
other
perl modules - if they need, eg, libjpeg, then they can use this  
module in

Makefile.PL / Build.PL to make it a pre-req, and if it's missing then
the CPAN testers will SHUT THE HELL UP ABOUT IT and not annoy the  
author.


Regarding the number of platforms supported: ExtUtils::CBuilder could  
be a big help here, since basically its whole purpose is to translate  
Config.pm into compiler  linker invocations.  Maybe use it if it's  
installed.


 -Ken



Re: Devel::CheckLib: Please try to break our code!

2007-10-21 Thread demerphq
On 10/20/07, A. Pagaltzis [EMAIL PROTECTED] wrote:
 * demerphq [EMAIL PROTECTED] [2007-10-19 23:10]:
  On 10/19/07, A. Pagaltzis [EMAIL PROTECTED] wrote:
   * demerphq [EMAIL PROTECTED] [2007-10-19 18:50]:
How does one use this then? Where is it documented?
  
   http://module-build.sourceforge.net/META-spec-blead.html#configure_requires
 
  So how do i use this with MakeMaker?

 Doesn't seem like you can do that from within MakeMaker so far.

 However you can certainly hand-edit your META.yml to add it. Once
 created the meta file is not regenerated if you don't ask for it,
 I think.

The point of my reply to Eric was dialectical, in the sense that the
answer to my question revealed the flaw in his response.

A) The contents of META.yml is not well or widely documented. That
META-spec-blead in the Module::Build source code repository does
mention it does not make it well publicized nor documented. About the
only people who would know about it are META.yml wonks and active
developers on the MB project.
B) Absent a documented way to set this in MakeMaker, suggesting that
it is the appropriate solution to the problem intended to be solved by
Devel::CheckLib seems out of place at best, and presumptive at worst.

As an aside, it seems to me that both Devel::CheckLib and
configure_requires suffer from a fatal flaw in that they do not solve
the problem for existing modules. The solution to this problem lies in
better logic in CPAN Testers. What that logic should be is left as an
exercise for the reader, but i suspect it has something to do with
being better at detecting errors generated by the build process and
discriminating between them. If  XS code fails to build because it
can't link to a required non-bundled library then this should be
distinguished from things like something failing to build because the
author used unportable GCC'isms like declarations after code.
Naturally of course this is a Hard Problem, hence why i leave it as an
exercise :-)

cheers,
Yves


-- 
perl -Mre=debug -e /just|another|perl|hacker/


Re: Devel::CheckLib: Please try to break our code!

2007-10-21 Thread David Golden
On 10/21/07, demerphq [EMAIL PROTECTED] wrote:
 B) Absent a documented way to set this in MakeMaker, suggesting that
 it is the appropriate solution to the problem intended to be solved by
 Devel::CheckLib seems out of place at best, and presumptive at worst.

 As an aside, it seems to me that both Devel::CheckLib and
 configure_requires suffer from a fatal flaw in that they do not solve
 the problem for existing modules. The solution to this problem lies in
 better logic in CPAN Testers. What that logic should be is left as an

The more important words in these paragraphs above are these: the problem.

The problem is not well defined or perceived the same by everyone.

At the core CPAN Testers provides a means to capture the experience of
users attempting to build and test a module.  As I see it, the root of
the problem is that there are many ways for things to fail, and
authors tend to object to getting FAIL grades (in big capital
letters) for things outside their control.

Authors complain to CPAN Testers, testers complain to those who write
CPAN Testers clients about getting complaints for authors.  The
investment of time and energy to improve CPAN Testers clients is
weighed against the annoyance of getting complaints.

So, gradually, the more easily determined failure paths have being
pruned out to just cut down on the noise.  Ones that are easy to
automate have been -- e.g. prerequisite failures are now just
discarded (at least by CPAN::Reporter).

Harder failure paths to determine -- such as unsupported operating
systems -- have been addressed by special key words (OS Unsupported
or No support for OS) to let authors abort building or testing with
an NA report.  But apparently that's too hard or too obscure for some
-- thus Devel::CheckOS.

Confirming a working compiler setup and appropriate libraries is an
even tougher problem for authors, and the method for signaling it is
even more obscure.  (exit 0 before creating a Makefile.)  And thus
there is Devel::CheckLib.

I'm not interested in spending my time writing an omniscient failure
detection tool.  I'm not interested in trying to solve the problem
(many ways for things to fail and authors affronted by FAIL reports)
for all of CPAN.

I'm am willing to invest my time in making it easier for authors to do
something about being annoyed by FAIL reports from missing libraries.
And I'm willing to invest my time to have something more constructive
to say in response to complains. (You're right that this is a library
problem -- go use Devel::CheckLib and you won't get these FAIL
reports).  That is the problem that Devel::CheckLib is trying to
solve.

David


Re: Devel::CheckLib: Please try to break our code!

2007-10-21 Thread Michael G Schwern
demerphq wrote:
 On 10/19/07, A. Pagaltzis [EMAIL PROTECTED] wrote:
 * demerphq [EMAIL PROTECTED] [2007-10-19 18:50]:
 How does one use this then? Where is it documented?
 http://module-build.sourceforge.net/META-spec-blead.html#configure_requires
 
 So how do i use this with MakeMaker?

Step One:  Use Module::Build.

Then proceed as normal.

I'll take a patch though.


-- 
You know what the chain of command is? It's the chain I go get and beat you
with 'til you understand who's in ruttin' command here.
-- Jayne Cobb, Firefly


Re: Devel::CheckLib: Please try to break our code!

2007-10-21 Thread Sébastien Aperghis-Tramoni

Hello David,


I should have answered your mail earlier, but I keep forgetting things..


David Cantrell wrote:


NB: this has been sent to several mailing lists.  Watch those replies!

Dave Golden and I have been hacking on Devel::CheckLib, which  
should be
on a CPAN mirror near you soon.  It's similar to Devel::CheckOS, in  
that
it will let module authors specify dependencies which aren't just  
other
perl modules - if they need, eg, libjpeg, then they can use this  
module in

Makefile.PL / Build.PL to make it a pre-req, and if it's missing then
the CPAN testers will SHUT THE HELL UP ABOUT IT and not annoy the  
author.


It's still in something of a state of flux so not ready for real- 
world use
yet, but we're at the stage where we need lots of people to beat it  
to hell
and back.  Please try to run the tests on as many platforms as  
possible,
with as many perls as possible, and in particular using perls built  
with

as many compilers and linkers as possible.


I had begun working on a module like this last year. It would have  
been part of the refactoring of the Makefile.PL of Net::Pcap, itself  
borrowed from XML::LibXML's, then improved. The first part is already  
on the CPAN as the module ExtUtils::FindFunctions, which tries to  
detect the functions present in a library. The second is is  
ExtUtils::FindLibrary, not yet released, which is mainly the  
have_library() function in Net::Pcap Makefile.PL. It's more  
heavyweight than the code current present in Devel::CheckLib, but it  
works nice on Unix, Win32 and Cygwin given that Net::Pcap only had  
PASSes for the last stable releases.



The more alert of you will have noticed that there is a bootstrapping
problem in using this from within a Makefile.PL - relax, it will come
with a script to bundle itself in an inc/ directory.


ExtUtils::FindFunctions and ExtUtils::FindLibrary do this as well  
with their included commands. The code is simple but you can copy it  
if you want.


--
Sébastien Aperghis-Tramoni

Close the world, txEn eht nepO.



Re: Devel::CheckLib: Please try to break our code!

2007-10-21 Thread A. Pagaltzis
* demerphq [EMAIL PROTECTED] [2007-10-21 16:50]:
 A) The contents of META.yml is not well or widely documented.
 That META-spec-blead in the Module::Build source code
 repository does mention it does not make it well publicized nor
 documented. About the only people who would know about it are
 META.yml wonks and active developers on the MB project.

Support has been in CPAN.pm for no more than three or so months,
if memory serves, and the toolchain is not (as you found out)
ubiquitously aware of this option yet. So the fact that this
feature is barely documented by anyone is less than surprising.
Give it a bit of time so everyone can catch up.

 B) Absent a documented way to set this in MakeMaker, suggesting
 that it is the appropriate solution to the problem intended to
 be solved by Devel::CheckLib seems out of place at best, and
 presumptive at worst.

Huh? As I understood Eric’s mail, he suggested configure_requires
solves the bootstrapping problem where a Makefile.PL itself has a
dependency on Devel::CheckLib that it can’t communicate before it
runs. And that’s precisely the scenario that configure_requires
was invented to solve.

 As an aside, it seems to me that both Devel::CheckLib and
 configure_requires suffer from a fatal flaw in that they do not
 solve the problem for existing modules. The solution to this
 problem lies in better logic in CPAN Testers.

Well, sure. Makefile.PL/Build.PL can do anything whatsoever, of
course. But once we solve the halting problem, CPAN Testers will
be trivial to fix… ahem. Devel::CheckLib and configure_requires
make things more declarative, so in combination with a better
protocol for CPAN Testers, would allow to fix *some* problems
going forward. It does not seem realistic or even possible to me
to fix them *all*.

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


Re: Devel::CheckLib: Please try to break our code!

2007-10-20 Thread Andreas J. Koenig
 On Sat, 20 Oct 2007 01:31:41 +0200, A. Pagaltzis [EMAIL PROTECTED] 
 said:

   Doesn’t seem like you can do that from within MakeMaker so far.

See also http://rt.cpan.org/Ticket/Display.html?id=30098
(Documentation for EXTRA_META is missing)

-- 
andreas


Re: Devel::CheckLib: Please try to break our code!

2007-10-19 Thread A. Pagaltzis
* demerphq [EMAIL PROTECTED] [2007-10-19 18:50]:
 How does one use this then? Where is it documented?

http://module-build.sourceforge.net/META-spec-blead.html#configure_requires

-- 
*AUTOLOAD=*_;sub _{s/(.*)::(.*)/print$2,(,$\/, )[defined wantarray]/e;$1}
Just-another-Perl-hack;
#Aristotle


Re: Devel::CheckLib: Please try to break our code!

2007-10-19 Thread demerphq
On 10/19/07, A. Pagaltzis [EMAIL PROTECTED] wrote:
 * demerphq [EMAIL PROTECTED] [2007-10-19 18:50]:
  How does one use this then? Where is it documented?

 http://module-build.sourceforge.net/META-spec-blead.html#configure_requires

So how do i use this with MakeMaker?

Yves


-- 
perl -Mre=debug -e /just|another|perl|hacker/


Re: Devel::CheckLib: Please try to break our code!

2007-10-19 Thread A. Pagaltzis
* demerphq [EMAIL PROTECTED] [2007-10-19 23:10]:
 On 10/19/07, A. Pagaltzis [EMAIL PROTECTED] wrote:
  * demerphq [EMAIL PROTECTED] [2007-10-19 18:50]:
   How does one use this then? Where is it documented?
 
  http://module-build.sourceforge.net/META-spec-blead.html#configure_requires
 
 So how do i use this with MakeMaker?

Doesn’t seem like you can do that from within MakeMaker so far.

However you can certainly hand-edit your META.yml to add it. Once
created the meta file is not regenerated if you don’t ask for it,
I think.

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


Re: Devel::CheckLib: Please try to break our code!

2007-10-19 Thread demerphq
On 10/19/07, Eric Wilhelm [EMAIL PROTECTED] wrote:
 # from David Cantrell
 # on Friday 19 October 2007 04:00:

 The more alert of you will have noticed that there is a bootstrapping
 problem in using this from within a Makefile.PL - relax, it will come
 with a script to bundle itself in an inc/ directory.

 Or use configure_requires.

How does one use this then? Where is it documented?

cheers,
Yves


Re: Devel::CheckLib: Please try to break our code!

2007-10-19 Thread Eric Wilhelm
# from David Cantrell
# on Friday 19 October 2007 04:00:

The more alert of you will have noticed that there is a bootstrapping
problem in using this from within a Makefile.PL - relax, it will come
with a script to bundle itself in an inc/ directory.

Or use configure_requires.

--Eric
-- 
perl -e 'srand; print join( ,sort({rand()  0.5}
  qw(sometimes it is important to be consistent)));'
---
http://scratchcomputing.com
---


Devel::CheckLib: Please try to break our code!

2007-10-19 Thread David Cantrell
NB: this has been sent to several mailing lists.  Watch those replies!

Dave Golden and I have been hacking on Devel::CheckLib, which should be
on a CPAN mirror near you soon.  It's similar to Devel::CheckOS, in that
it will let module authors specify dependencies which aren't just other
perl modules - if they need, eg, libjpeg, then they can use this module in
Makefile.PL / Build.PL to make it a pre-req, and if it's missing then
the CPAN testers will SHUT THE HELL UP ABOUT IT and not annoy the author.

It's still in something of a state of flux so not ready for real-world use
yet, but we're at the stage where we need lots of people to beat it to hell
and back.  Please try to run the tests on as many platforms as possible,
with as many perls as possible, and in particular using perls built with
as many compilers and linkers as possible.

The more alert of you will have noticed that there is a bootstrapping
problem in using this from within a Makefile.PL - relax, it will come
with a script to bundle itself in an inc/ directory.

--
David Cantrell