Dear fellow monks, I'm interested in hearing your philosophies, practices, opinions and/or rants about what version of module dependencies to list in a Makefile.PL or Build.PL. I've been pondering this for a while (and churning some of my modules on CPAN to fiddle with dependency versions) and have yet to come up with a "system" I'd want to apply consistently.

I see several extremes and some painstaking middle ground:

  1. Just list all prerequisites as needing version "0" -- take any version and let the module user hope that their modules are sufficiently up to date to run without problems and bugs. E.g.:

    # From a Build.PL requires => { Scalar::Util => 0, Test::Exception => 0, Test::More => 0, }
  2. Whenever updating the module, update all dependencies to their latest and greatest versions on CPAN -- causing builds to fail whenever an installer has old versions that can't/won't be updated (legacy support; binary PPM/RPM release cycle, etc.). E.g. (as of today, anyway):

    requires => { Scalar::Util => 1.17, Test::Exception => 0.21, Test::More => 0.60, }
  3. List whatever version of dependencies happen to be installed on the development machine -- i.e. use at least one known working configuration that passes all test as the minimal standard. E.g. (for my Win32 ActiveState Perl 5.8.7, at least since the last time I updated anything):

    requires => { Scalar::Util => 1.14, Test::Exception => 0.20, Test::More => 0.54, }
  4. Work out exactly when certain necessary features became available in each dependency or when significant bugs were fixed -- potentially painstaking and really hard to regression test. E.g. (somewhat contrived):

    requires => { Scalar::Util => 1.09, # first appearance of refaddr() Test::Exception => 0.21, # 0.20 doesn't build well with CPANPLUS Test::More => 0.48, # thread safe }

None of these jump out at me as an "a-ha!" approach that I like.

What other philosophies do people have on this? Is it different for ordinary CPAN modules versus core modules (that may or may not have updated versions on CPAN not yet in core)? Are there certain versions that you target for certain modules no matter what? (E.g. Test::More has morphed rather substantially since it was last included in a core release.)

Your input is greatly appreciated. Regards,

-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.


In reply to Which version to target for module dependencies? by xdg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.