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:
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,
}
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,
}
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,
}
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.
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|