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

I'm a new CPAN author - just uploaded first two modules a few days ago. My chagrin at seeing complete FAILure on the first CPAN Testers reports was mollified somewhat when I determined that the main problems were not with my module code but with minor issues in the MANIFEST file (in one module) and in the Makefile.PL (in the other). My question is two-fold:

(1) It seems silly to bump the version number of a module just because of an edit to the MANIFEST. However, I can't just re-upload a module with the same version number. What is the proper way to deal with this situation (other than being more careful in the first place).

(2) If I upload a development version to CPAN (version number ending in "_\d+") will it still be tested by CPAN Testers? If so, clearly this would have avoided the current situation for me.

  • Comment on CPAN module versioning for slight changes

Replies are listed 'Best First'.
Re: CPAN module versioning for slight changes
by toolic (Bishop) on Jan 04, 2016 at 21:20 UTC
    (1) In my opinion, just bump it. Version numbers are cheap. If your current is 0.002, just make it 0.003.
      That what I ended up doing (hence why 0.002 was released a day after 0.001). Just seemed silly for a missing entry in MANIFEST that caused test failure (tests succeeded on my system because the necessary files were already there, they just weren't getting packaged in the tarball which I didn't realize).

        Cheap... if you're not a tester.

        What?

Re: CPAN module versioning for slight changes
by stevieb (Canon) on Jan 04, 2016 at 21:30 UTC

    You have no choice but to bump your version number each time, and yes, development versions get tested... note that you're taxing the Testers servers with each new upload though.

    What I do, is have a Perlbrew setup locally, for all versions of perl, and spin my tests there (I construct/decom after each dist candidate test run). I also house at least one VM with Strawberry on Windows. If I have a fail on Testers, I'll spin a VM replicating the setup of the failed tests as best as possible and include that in my test regime before upload.

    I also use Travis CI for each build which is run on each github push. See this .travis.yml file if you want an example Travis config (after you're on github and integrate with the service).

Re: CPAN module versioning for slight changes
by Mr. Muskrat (Canon) on Jan 04, 2016 at 21:31 UTC
Re: CPAN module versioning for slight changes (bump, pause cpan identical filename)
by Anonymous Monk on Jan 04, 2016 at 21:25 UTC

    (1) It seems silly to bump the version number of a module just because of an edit to the MANIFEST. However, I can't just re-upload a module with the same version number. What is the proper way to deal with this situation (other than being more careful in the first place).

    Simplest option is bump version number . Also happens to be most popular option. Say go from 0.001 to 0.00101.

    You could try only changing the tarball name :) but meh

    (2) If I upload a development version to CPAN (version number ending in "_\d+") will it still be tested by CPAN Testers? If so, clearly this would have avoided the current situation for me.

    Yes it will be tested.

Re: CPAN module versioning for slight changes
by Anonymous Monk on Jan 05, 2016 at 15:12 UTC

    You can catch errors of the type you mention by doing

    $ make disttest
    before you upload -- or
    $ ./Build disttest
    as the case may be. This makes your tarball if needed, and then unpacks it again into a subdirectory and runs your tests. I do this routinely before releasing, and occasionally catch MANIFEST omissions.

    Editorial comments: Perl's testing culture is one of the things that makes me enthusiastic about the language. Any other language could do this, but no other that I know of does so. All hail CPAN testers.

    What we do not have (I think -- I would love to be shown that I am in error) is a complete how-to on publishing a module. There are pieces/parts various places: the CPAN FAQ has the basics, the Perl foundation has recommended licensing, PAUSE has something on naming modules, CPANTS (not to be confused with CPAN Testers) recommends and tests for ways to structure modules, but nothing I know of ties it all together in a place where the budding module author is bound to find it.

      What we do not have (I think -- I would love to be shown that I am in error) is a complete how-to on publishing a module.
      We're working on it. Feel free to participate.
      ($q=q:Sq=~/;[c](.)(.)/;chr(-||-|5+lengthSq)`"S|oS2"`map{chr |+ord }map{substrSq`S_+|`|}3E|-|`7**2-3:)=~y+S|`+$1,++print+eval$q,q,a,
      Thanks, great tip. After my first MANIFEST mistake I've been basically doing this by hand, but I'll add a disttest before every commit now.