Skip Menu |
 

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Dist-Zilla CPAN distribution.

Report information
The Basics
Id: 73207
Status: open
Priority: 0/
Queue: Dist-Zilla

People
Owner: Nobody in particular
Requestors: rjbs [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: look at adding an underscore ("_0") to trial versions with pkgversion
Download (untitled) / with headers
text/plain 149b
14:54 >@mst< rjbs: --trial is still producing versions without underscores 14:54 >@mst< rjbs: you were going to fix that like 6 months ago -- rjbs
Download (untitled) / with headers
text/plain 2.2k
There are several obvious ways to approach this: ## 1. PkgVersion takes full responsibility. When emitting the $VERSION declaration, PkgVersion (if some boolean option, like auto_underscore, is true) checks is_trial. If it's true, and if $zilla->version does not match /_/, it tacks on "_0" and also adds a second line, $VERSION = eval $VERSION. This is nice and simple, and automatically affects everyone... but not everything. Basically, everything else checking $zilla->version still sees no underscore. This is either a bug or a feature, depending on how you define things, but I think it's a bug. ## 2. AutoVersion gets a new default Right now, the default AutoVersion template ends with something like this: {{$ENV{DEV} ? (sprintf '_%03u', $ENV{DEV}) : ''}} We could extend that so that if ! $ENV{DEV} but is_trial, it appends _0 This is really really simple, which is nice, but it only helps if you're using AutoVersion. It doesn't affect, say, Git::NextVersion. ## 3. Some very early plugin mutates $zilla->version A plugin fairly early on in the life cycle of things looks at $zilla->version and $zilla->is_trial; if is_trial and $version !~ /_/ then it mutates $zilla->version in place, before it affects anything else. This "solves everything." But, of course, it doesn't work. $zilla->version is populated by Dist::Zilla::_build_version, which flips through the "version =" root dist.ini option and then all the VersionProvider plugins. If there is exactly one answer, everything works out. If there is more than one answer ā€“ i.e., you have a dist.ini version AND a VersionProvider plugin offers a setting, or you have two opinionated VersionProvider plugins ā€“ then an exception is thrown. Initially there was some notion of adding a VersionMunger kind of plugin, but we didn't do that. We could still do this, by replacing the use of a builder for version with some mechanism to build the version during BUILD differently. VersionProviders could blindly set the version, clear it and re-set it, or {set it if unset and die otherwise} mimicking the current behavior. In this scenario, PkgVersion will still need a (presumably default true) auto_eval option to add a second $V = eval $V line when the version string contains an underscore. (Of course, it should probably have that option now, too!) -- rjbs


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.