GNOME Bugzilla – Bug 690464
same $VERSION in all modules
Last modified: 2013-07-29 21:16:45 UTC
Glib::Object::Subclass has a $VERSION set to 0.03 whereas the main Glib-Perl version number is 1.280 or whatever. It'd be good if the $VERSION were the same throughout. (Glib::ParseXSDoc, Glib::GenPod, Glib::CodeGen and Glib::MakeHelper have 0.03 or 1.03.) Updating all the $VERSION for a release can be a bit of a chore. I use an emacs search-and-replace. There's a Test::ConsistentVersion which can check that all modules in a dist have the same version number. It normally looks for a Changes file too, but an undocumented "no_changelog" option suppresses that (and the README check can be suppressed too, if not having the version number in the README).
The work required for a release really is the problem here, I think. Brian, you've been doing the releases lately, so what do you think? Coincidentally, there's been discussion about this problem recently on the module-authors list: <http://markmail.org/thread/426ayvgqem3joe5s>.
Brian writes that he's OK with this change. So let's do it. Kevin, can you come up with a patch, preferably including a unit test that does something like the following? ok ($Glib::VERSION == $Glib::CodeGen::VERSION == ...)
For that module-authors thread I think I'm in the same-version-throughout-the-dist camp :). Too hard to remember to increment per-file versions at sensible times, and hard for a user to find what number to depend on if there's only a single Changes file. For tests I've tended to put an explicit "my $want_version = 1.234" in each .t file which exercises a module and its version number. Which is even more work to update for a dist, though emacs search-and-replace makes it easy enough. Testing everything else against Glib->VERSION() may be enough. I'll see if I can do something like that.
Created attachment 237580 [details] Test module containing tests that use Test::ConsistentVersions
I took a look at Test::ConsistentVersion... it works, but I had to turn most of the functionality off... We don't put the version in the README file, we no longer use Changelog, and the VERSION block is in none of our POD pages currently. It does however check all of the static *.pm files, so it has some usefulness. Here's a quick test that includes Test::ConsistentVersion, please try to run 'make test' both before and after installing Test::ConsistentVersion, in order to verify it works with a clean system and one that has that test module installed.
Also pushed to private github repo if you want to pull the change from there: https://github.com/cpanxaoc/perl-Glib.git
> I took a look at Test::ConsistentVersion... it works, but I had to turn most of > the functionality off... We don't put the version in the README file, we no > longer use Changelog, and the VERSION block is in none of our POD pages > currently. Yes, I don't put a version in readme or the pod parts of my stuff either. > It does however check all of the static *.pm files, so it has some > usefulness. Yes, that's it's best thing. I think I had trouble at one time with some .pm files which only loaded with dependent modules. That probably doesn't apply to glib. If it's an author-only test you don't rely on what the final user has available anyway.
Fixed in release 1.30.0 of Glib.