syphilis has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

(Herein lies a complaint against the CPAN test reporting process ... not against the testers themselves, who provide a wonderful service.)

The "CPAN Testers" entry at http://search.cpan.org/~SISYPHUS/Math-MPC-0.45/ tells me that there are 8 FAILS for that module. If I click on the "View" link, the details are not yet to be seen there ... but I can find those details at http://cpantesters.perl.org/author/SISYPHUS.html (near the bottom of that page).

Each of those FAILS arise because a requisite 3rd party C library (namely, the mpc library) is not installed on the tester's machine. This deficiency in the tester's environment is being detected at the 'Makefile.PL' stage - at which point the 'Makefile.PL' process prints out an explanatory message and dies, without creating a Makefile. I was hopeful that the result would therefore be an "NA" instead of a "FAIL".

In my opinion it's ludicrous to assert that a module that needs to be built against a specific 3rd party C library has "FAIL"ed simply because the machine on which it is being built does not have that requisite C library installed. (It makes about as much sense as giving libwin a "FAIL" because it won't build on linux.) What can I do to ensure that, in future, "NA" is returned as the verdict when a tester tries to build the module without having the mpc library installed ?

Cheers,
Rob
  • Comment on Ridiculous "FAIL" reports from CPAN Testers

Replies are listed 'Best First'.
Re: Ridiculous "FAIL" reports from CPAN Testers
by xdg (Monsignor) on Sep 24, 2007 at 11:18 UTC

    If you read the grade definitions, this particular case is properly graded as a "FAIL" -- but I agree with you that it's probably shouldn't be since, conceptually, it's a failure in a prerequisite. This is part of the broader problem of how CPAN distributions can/should specify non-perl dependencies (e.g. libraries, OS, etc.).

    As a workaround (some might call it an abuse of the system) -- you can have your Makefile.PL die with the message "OS unsupported". That will be detected by CPAN::Reporter or CPANPLUS and will cause your module to be graded "NA" instead of "FAIL".

    But please come join the new cpan-testers-discuss mailing list and help us hash out a better approach. Email cpan-testers-discuss-subscribe@perl.org to join.

    Update -- please note:

    The "OS unsupported" answer is a hack and a bad one that pollutes the CPAN Testers database. "OS unsupported" should be reserved for a case where the module in question will never work on the platform in question. I don't want to encourage this since it's an easy enough case to fix in the CPAN Testers toolchain itself.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      A third option is to simply ignore it. Everyone who clicks on the FAIL to see what happened will see the obviousness of the missing lib. I know I click them when I see them.

      I like the Alien suggestion above though. I'm definitely using that in my own stuff at some point.

      -Paul

        I like the Alien suggestion above though. I'm definitely using that in my own stuff at some point.

        Alien is only good if there is actually an Alien module for the library. E.g. Alien::wxWidgets or Alien::SVN. Otherwise, CPAN can never find and install the appropriate Alien module -- and thus your module can never satisfy its prerequisites and will not be installed unless forced.

        -xdg

        Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      As a workaround (some might call it an abuse of the system) -- you can have your Makefile.PL die with the message "OS unsupported".

      That's the sort of solution I was looking for. I think the element of abuse would be removed if CPAN::Reporter and CPANPLUS also searched for (something like) "System inadequate" ... or maybe there's a single phrase that caters for both scenarios.

      But please come join the new cpan-testers-discuss mailing list and help us hash out a better approach

      If that's the best way to get it sorted, then I'll do that. (Subscribing right now, but I might wait a day or two to see what else eventuates here before posting there.)

      Thanks, as always, to *all* respondents.

      Cheers,
      Rob
        It seems to me that adding another flag value ("dependency not met" sounds better/more neutral to me than "system inadequate") would be better than trying to find a single phrase that can cover both situations, because they are, IMO, fundamentally different.

        Fixing a missing dependency (generally) only requires you to install it. Fixing an incorrect OS requires throwing out all of your existing software (and potentially most/all of your data with it) and replacing it with something else. Most people won't blink at installing a missing dependency, but few would change to a different OS just to use an unsupported module, so failures should report different results in each case.

Re: Ridiculous "FAIL" reports from CPAN Testers
by Prof Vince (Friar) on Sep 24, 2007 at 11:06 UTC
    You could add a dependency to an Alien module for mpc. This would ensure that the mpc library is present before installing your module.
Re: Ridiculous "FAIL" reports from CPAN Testers
by andreas1234567 (Vicar) on Sep 24, 2007 at 18:53 UTC
    Math::MPC is similar to Math::Pari in the sense that they both depend on underlying (mathematical) libraries.

    Math::Pari has a companion in module Math::PariBuild, where the latter (unsurprisingly) is used during configuration of the former. Math::Pari depends on an underlying library (the PARI/GP library), and it actually attempts to download, compile and install the library, if not present during build.

    Could that be an option for Math::MPC as well?

    --
    Andreas
      Could that be an option for Math::MPC as well?

      I'm sure it could be made to work ... but it would create an added responsibility that I'm not (at this stage, anyway) prepared to take on. The mpc library itself needs the mpfr library, which in turn needs the gmp library ... seems to me that what you're suggesting could easily turn into a nightmare (especially if *I* am at the helm :-)

      Cheers,
      Rob
Re: Ridiculous "FAIL" reports from CPAN Testers
by CountZero (Bishop) on Sep 24, 2007 at 16:24 UTC
    I'm sure it is different for simple users and for developers. As a user I'm just interested whether the module installs "out of the box", so if I see failure notices, I might first go and find me another module (if it exists) which does install cleanly. Whether it doesn't install for reasons of incompatible OS or missing libraries or wrong phase of the moon, is not something I'm interested in at that moment. If I want or have to dig deeper I go and look-up the reasons for the failure and see if I can work around it.

    CountZero

    A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James

Re: Ridiculous "FAIL" reports from CPAN Testers
by xdg (Monsignor) on Oct 21, 2007 at 16:16 UTC

    For anyone catching up on this thread later, let me point out that the experimental Devel::CheckLib is out and may be the solution to this problem eventually. See Devel::CheckLib: Please break our code! for more details.

    -xdg

    Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.