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

I've made various attempts. The one that has elicited the most reaction was version 1.0.2, and I will refer to this throughout. After the initial acknowledgment email, I received a second, with the subject "Failed: PAUSE indexer report DAVIES/App-ipchgmon-1.0.2.tar.gz". The body includes the following:

This distribution name will only be indexed when uploaded by users with permission for the package App::ipchgmon. Either someone else has ownership over that package name, or this is a brand new distribution and that package name was neither listed in the 'provides' field in the META file nor found inside the distribution's modules. Therefore, no modules will be indexed.
Further details on the indexing attempt follow.
You appear to be missing a .pm file containing a package matching the dist name (App::ipchgmon). Adding this may solve your issue. Or maybe it is the other way round and a different distribution name could be chosen to reflect an actually included package name (eg. ipchgmon-...).

This is the beginning of my uncertainty. Is this a permissions issue or a missing .pm file? The archive contents certainly contain the .pm:

dr@distzilla:~/App/ipchgmon$ tar --list -f App-ipchgmon-1.0.2.tar.gz App-ipchgmon-1.0.2/ App-ipchgmon-1.0.2/Changes App-ipchgmon-1.0.2/lib/ App-ipchgmon-1.0.2/lib/App/ App-ipchgmon-1.0.2/lib/App/ipchgmon.pm App-ipchgmon-1.0.2/dist.ini App-ipchgmon-1.0.2/bin/ App-ipchgmon-1.0.2/bin/ipchgmon App-ipchgmon-1.0.2/README App-ipchgmon-1.0.2/LICENSE App-ipchgmon-1.0.2/META.yml App-ipchgmon-1.0.2/t/ App-ipchgmon-1.0.2/t/24-read-file.t App-ipchgmon-1.0.2/t/60-email-address.t App-ipchgmon-1.0.2/t/30-last.t App-ipchgmon-1.0.2/t/50-ip-via-web.t App-ipchgmon-1.0.2/t/34-single-ip-version.t App-ipchgmon-1.0.2/t/22-new-ip.t App-ipchgmon-1.0.2/t/63-email-transport.t App-ipchgmon-1.0.2/t/32-check-dns.t App-ipchgmon-1.0.2/t/51-ip-validation.t App-ipchgmon-1.0.2/t/10-options.t App-ipchgmon-1.0.2/t/00-modulino.t App-ipchgmon-1.0.2/t/20-file.t App-ipchgmon-1.0.2/t/62-email-delivery.t App-ipchgmon-1.0.2/t/28-nslookup.t App-ipchgmon-1.0.2/t/26-check-changes.t App-ipchgmon-1.0.2/Makefile.PL App-ipchgmon-1.0.2/MANIFEST

The structure seems to me to be the same as other "App::" distributions.

Then the daily reports started coming, with masses of failures. Two examples are http://www.cpantesters.org/cpan/report/b76d293e-4c1a-11ed-9806-df4792b6e7ad and http://www.cpantesters.org/cpan/report/c54daa0c-4c46-11ed-aba6-9a79f339625c. The nature of the failure is the same in all; I have two types of tests, unit tests that "use" the .pm and tests that call the modulino from the command line. It is the command line tests that fail, and they all report missing modules. The specific module may differ, although the "Datetime" modules seem to come up the most frequently. The prerequisites sections of the reports all list the modules that do not load.

A small minority, including the second example above, include something like the following:

MISSING PREREQUISITES:
It was observed that the test suite seem to fail without these modules:
Module::Pluggable
As such, adding the prerequisite module(s) to 'PREREQ_PM' in your Makefile.PL should solve this problem. For example:
WriteMakefile( AUTHOR => 'DAVIES (cpanplus-info@lists.sf.net)', ... # other information PREREQ_PM => { 'Module::Pluggable' => '0', # or a minimum working version } );

My code does not use Module::Pluggable directly; it is a dependency of Email::Sender::Transport::SMTP. This is listed in the report's prerequisites section without any sign of complaint and unit tests that use it pass. I am left wondering whether this is the "permissions" issue mentioned in the email. The changes of format and of the module specified in the error do not appear to be related to the OS being tested or the tester, but I have not done a formal analysis.

I wondered whether the command line call was failing because of permissions, but that isn't the problem; the reports show a failure at compile time. While the release is not "indexed", it can be addressed from the CPAN shell with a command such as test DAVIES/App-ipchgmon-1.0.2.tar.gz. All tests pass. I have put the code up at https://github.com/DrJHD/ipchgmon.

I believe that it is far more likely that I am doing something wrong than that there is a bug in the PAUSE system. But I can't see my error. What it is, please?

Regards,

John Davies

Replies are listed 'Best First'.
Re: Unable to release modulino to CPAN
by Corion (Patriarch) on Oct 28, 2022 at 16:25 UTC

    At least, App::ipchgmon 1.0.2 has entered your CPAN directory. This means that anything you want to upload must have a new (higher) version number.

    I can't make sense of the missing Module::Pluggable prerequisite, as that is listed indirectly through your prerequisites, and even less of the DateTime prerequisite, as you list that one directly.

    You also have a NAME section in your POD, but your package name in App/ipchgmon.pm is:

    package ipchgmon;

    I think that CPAN / MetaCPAN expect App::ipchgmon there - that may be the cause.

      You are perfectly correct about the package naming issue. I have made the changes (including the tests) and the upload has worked without the failure email. Whether the testers will still have problems remains to be seen, but if so, you have at least enabled me to remove one problem.

      Thanks and regards,

      John Davies

Re: Unable to release modulino to CPAN
by ikegami (Patriarch) on Oct 31, 2022 at 19:42 UTC

    What is this all about?

    #!/usr/bin/perl use strict; use warnings; use FindBin qw($RealBin); use File::Find; use feature 'say'; find ({wanted =>\&wanted, follow => 1 }, ($RealBin . '/..', @INC)); sub wanted { if ($File::Find::name =~ m/App\/ipchgmon.pm$/) { # Changed from "perl" to "$^X" per Slaven Rezic's advice # in issue 144972. I wouldn't have got near this issue # on my own. Many thanks, Slaven. my $cmd = join " ", $^X, $File::Find::name, @ARGV; say qx($cmd 2>&1); exit; } }

    Why aren't you using

    #!/usr/bin/perl use App::ipchgmon; App::ipchgmon::run();

    Of course, you'll need to move the top-level stuff into run, and fix the incorrect package name in the module.

      This is an attempt to ensure that the same code is called in the same way whether during developer testing, installation testing or production. I am trying to avoid anything like your App::ipchgmon::run line, as that would mean moving the option parsing out of the modulino. I understand StevieB's recommendation about having the invoker, POD and module as separate files, but I don't like it as I have the scars from separating them. If I knew enough about all the operating system issues, I'd prefer to change this to a simple link to the modulino, but I don't think I could do it in an OS-agnostic way for Windows and Linux, let alone others I don't use. But I'll happily listen to help and advice.

      Regards,

      John Davies

        This is an attempt to ensure that the same code is called in the same way whether during developer testing, installation testing or production

        It has no such benefit over the code I posted.

        If anything, the fragility of your approach has the opposite effect of the one that's desired.

        App::ipchgmon::run line, as that would mean moving the option parsing out of the modulino

        You just said you wanted to use the same approach everywhere, so that's a good thing. The script calls run. The modulino calls run. You get the same code both ways.

        But why are you using a modulino at all? You just said you wanted to always call the code in the same way. But making it a modulino does the exact opposite of that. It gives you two ways to use the module, and two ways of running the tool.

        I'd prefer to change this to a simple link to the modulino

        Why??? Hacks upon hacks for no benefit.

Re: Unable to release modulino to CPAN - still struggling
by davies (Monsignor) on Oct 31, 2022 at 14:44 UTC

    I'm posting this as a follow-up to my original post as the original problem is listed there. Corion has got me past the first hurdle to the point where the modulino is indexed on CPAN and I have cleared up one minor issue. But the major issue of the test failures remains. The problem space has been narrowed down by Slaven Rezic (is he a Monk? If you read this, Slaven, many thanks) in issue 144972 (https://rt.cpan.org/Public/Bug/Display.html?id=144972). Excerpts:

    The test suite is failing on systems where the perl used for the current build is not the first perl in path... Probably at some point $^X should be used to call the correct perl.
    I'm pretty confident that it is something to do with the file in the bin directory, which is quite short:

    #!/usr/bin/perl use strict; use warnings; use FindBin qw($RealBin); use File::Find; use feature 'say'; find ({wanted =>\&wanted, follow => 1 }, ($RealBin . '/..', @INC)); sub wanted { if ($File::Find::name =~ m/App\/ipchgmon.pm$/) { # Changed from "perl" to "$^X" per Slaven Rezic's advice # in issue 144972. I wouldn't have got near this issue # on my own. Many thanks, Slaven. my $cmd = join " ", $^X, $File::Find::name, @ARGV; say qx($cmd 2>&1); exit; } }

    Line 15, in the earlier versions, used perl instead of $^X and I hoped that this change would solve the missing modules problem. It doesn't. So I now have two problems. The first is how to use the "correct" perl. The second is how to test any solution on my machine. The only way I have is to upload and wait for the error reports, but this isn't the job of the CPAN testers. It's mine. Any advice on how to do that job would be greatly appreciated.

    Regards,

    John Davies

      The second [problem] is how to test any solution on my machine.

      If I understand you correctly, the thing you want to test is "if there is another perl earlier on the path than the one I am being built with, it has not been called". So mimic that scenario:

      % cat t/perl #!/bin/bash echo "Wrong perl" exit 1 % perl -E 'say "ok"' ok % PATH=`pwd`/t:$PATH \ perl -E 'say "ok"' Wrong perl % PATH=`pwd`/t:$PATH \ /usr/bin/perl -E 'say "ok"' ok %

      You could also have the wrong-perl script touch a file, in case something invokes it and ignores both its output and its exit code.

        I may not have explained my problem adequately. On my machine, everything works. It's on the testers' machines that I have a problem and I don't know if there is a simple way to mimic what they are doing that causes the test failures. My reading indicates that this could be done my setting up an entire virtual machine to act as a pre-release test environment, but even then I would have to set it up in such a way that it would generate the errors, and not all test runs return errors. It also seems like a very large yak to shave unless there is no option.

        I get it now. Apologies for my earlier stupidity - it's amazing what a night's sleep can do. I was misunderstanding the bash (I default to Windows) and getting a totally false impression. I have implemented a Windows version of your code & I think it does what I need.

        Regards,

        John Davies

      Since the problem in that report was with t/00-modulino.t, did you check that for external perl calls? Like the invocation string in L14?

      You will want to audit all your tests for such invocations, just to make sure.

        Thanks; you may well be right. I had ignored that aspect. I'll try that out but will wait before uploading in the hope that I will be able to test on my machine before wasting the testers' time.

        Regards,

        John Davies