Skip Menu |

This queue is for tickets about the Text-Layout CPAN distribution.

Report information
The Basics
Id: 131568
Status: resolved
Priority: 0/
Queue: Text-Layout

People
Owner: jv [...] cpan.org
Requestors: SREZIC [...] cpan.org
Cc: ANDK [...] cpan.org
AdminCc:

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



CC: ANDK [...] cpan.org
Subject: $Text::Layout::VERSION is undef
CPAN.pm thinks that the module's $VERSION is undef, and may refuse installation: ... CPAN::Reporter: make result is 'pass', No errors. JV/Text-Layout-0.014.tar.gz /usr/bin/make -- OK Testing/Installation stopped: allow_installing_module_downgrades: JV/Text-Layout-0.014.tar.gz (called for J/JV/JV/Text-Layout-0.014.tar.gz) contains downgrading module(s) (e.g. 'Text/Layout.pm' would downgrade installed '0.013' to 'undef') JV/Text-Layout-0.014.tar.gz [testing] -- NOT OK ... My guess is that a local evaluation of this code line to get to the $VERSION just fails (and maybe that's what CPAN.pm and PAUSE are doing): https://metacpan.org/source/JV/Text-Layout-0.014/lib/Text/Layout.pm#L13 CC'ing Andreas, maybe he has more insights to this problem.
The PAUSE indexer tells me: Status: Successfully indexed ============================ module : Text::Layout version: 0.014 in file: lib/Text/Layout.pm status : indexed MetaCPAN reports it as 0.014. cpanm upgrades flawlessly: % cpanm Text::Layout --> Working on Text::Layout Fetching http://www.cpan.org/authors/id/J/JV/JV/Text-Layout-0.014.tar.gz ... OK Configuring Text-Layout-0.014 ... OK Building and testing Text-Layout-0.014 ... OK Successfully installed Text-Layout-0.014 (upgraded from 0.013) 1 distribution installed Apparently only 'cpan' has problems detecting the version. I do not know what I would have done wrong...
RT-Send-CC: ANDK [...] cpan.org
On 2020-01-25 16:22:16, JV wrote: Show quoted text
> The PAUSE indexer tells me: > > Status: Successfully indexed > ============================ > module : Text::Layout > version: 0.014 > in file: lib/Text/Layout.pm > status : indexed > > MetaCPAN reports it as 0.014.
Another guess: PAUSE is fine because it uses the "provides" information from META.*. Show quoted text
> > cpanm upgrades flawlessly: > > % cpanm Text::Layout > --> Working on Text::Layout > Fetching http://www.cpan.org/authors/id/J/JV/JV/Text-Layout- > 0.014.tar.gz ... OK > Configuring Text-Layout-0.014 ... OK > Building and testing Text-Layout-0.014 ... OK > Successfully installed Text-Layout-0.014 (upgraded from 0.013) > 1 distribution installed > > Apparently only 'cpan' has problems detecting the version. > I do not know what I would have done wrong...
The allow_installing_module_downgrades option is a relatively new CPAN.pm feature. cpanm does not have something similar --- yet.
Point is that while cpan and cpanm have similar functionality, the version detection of cpanm succeeds where cpan fails. Maybe CPAN.pm needs improving?
Would this (ugly hack) work: our $VERSION = do { require Text::Layout::Version; Text::Layout::Version::VERSION };
RT-Send-CC: ANDK [...] cpan.org
On 2020-01-25 16:44:59, JV wrote: Show quoted text
> Point is that while cpan and cpanm have similar functionality, the version detection of cpanm succeeds where cpan fails. Maybe CPAN.pm needs improving?
To be more precise --- cpanm works because it does not do this kind of sanity check, just like older versions of CPAN.pm or CPAN.pm with the configuration option "allow_installing_module_downgrades" set to "yes". Show quoted text
> Would this (ugly hack) work: > > our $VERSION = do { require Text::Layout::Version; > Text::Layout::Version::VERSION };
This could work. But to be definite, one has to try out, or read the CPAN.pm source, or wait for Andreas' statement. Regards, Slaven
On Sat Jan 25 16:52:29 2020, SREZIC wrote: Show quoted text
> To be more precise --- cpanm works because it does not do this kind of > sanity check,
I don't follow. It's not a matter of sanity checks against downgrading, cpanm just detects the version correctly (see the original log): Successfully installed Text-Layout-0.014 (upgraded from 0.013)
RT-Send-CC: ANDK [...] cpan.org
On 2020-01-25 16:58:00, JV wrote: Show quoted text
> On Sat Jan 25 16:52:29 2020, SREZIC wrote:
> > To be more precise --- cpanm works because it does not do this kind > > of > > sanity check,
> > I don't follow. It's not a matter of sanity checks against > downgrading, cpanm just detects the version correctly (see the > original log): > > Successfully installed Text-Layout-0.014 (upgraded from 0.013)
"Text-Layout-0.014" looks (because of the dashes) like a distribution specification. Actually there's not much of parsing here, this is simply the (shortened) tarball name which was downloaded just before. The "0.013" could actually be the old version of the primary module (to my knowledge the _distribution version_ is nowhere reliably recorded, so it has to be the _module version_). And this was indeed parsed from the module (but CPAN.pm also has no problem parsing the 0.013 version). So what would happen if the version in /opt/perl-5.30.1/lib/site_perl/5.30.1/Text/Layout/Version.pm was lowered to 0.013, and a re-installation with cpanm is done? Interestingly cpanm does not recognize the old version anymore, and the log text just says: Successfully installed Text-Layout-0.014 So it seems that cpanm does the same kind of module version parsing like CPAN.pm, at least for the installed module, and fails in the same way. Regards, Slaven
CC: SREZIC [...] cpan.org, ANDK [...] cpan.org
Subject: Re: [rt.cpan.org #131568] $Text::Layout::VERSION is undef
Date: Sun, 26 Jan 2020 15:30:48 +0100
To: "Johan Vromans via RT" <bug-Text-Layout [...] rt.cpan.org>
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Show quoted text
>>>>> On Sat, 25 Jan 2020 16:58:00 -0500, "Johan Vromans via RT" <bug-Text-Layout@rt.cpan.org> said:
Show quoted text
> <URL: https://rt.cpan.org/Ticket/Display.html?id=131568 > > On Sat Jan 25 16:52:29 2020, SREZIC wrote:
>> To be more precise --- cpanm works because it does not do this kind of >> sanity check,
Show quoted text
> I don't follow. It's not a matter of sanity checks against > downgrading, cpanm just detects the version correctly (see the > original log):
Show quoted text
> Successfully installed Text-Layout-0.014 (upgraded from 0.013)
Yes, it's about version parsing. Relevant links: - https://metacpan.org/pod/ExtUtils::MM_Unix#parse_version - https://metacpan.org/pod/CPAN#Finding-packages-and-VERSION - https://pause.perl.org/pause/query?ACTION=pause_04about#version When I install Text-Layout-0.014, I see (paths shortened manually to improve readability): : % /home/sand/.../bin/perl -MV=Text::Layout : Text::Layout : /home/sand/.../lib/site_perl/5.31.8/Text/Layout.pm: undef # ------------------------------------------------------------^^^^^-- : : % /home/sand/.../bin/perl -MExtUtils::MakeMaker -le 'print MM->parse_version(shift)' '/home/sand/.../lib/site_perl/5.31.8/Text/Layout.pm' : undef # ^^^^^ Out of curiosity I looked up in the perl git repo, when the parse_version() method in MakeMaker was introduced. Here it is: : commit f1387719c66d49522b38f85cae0c68334115d46b : Author: Perl 5 Porters <perl5-porters@africa.nicoh.com> : Date: Mon Jun 24 04:56:22 1996 +0000 : : Update to MakeMaker 5.34 Interestingly, the CPAN is just a tiny bit older than this. Not sure what to conclude from that. -- andreas
I shall replace the version setting with a static one when making a CPAN release kit. However, it does worry me that after all these years the version setting still causes so much troubles. I was under the impression that having META.json/yaml would solve this once and for all...
Subject: Re: [rt.cpan.org #131568] $Text::Layout::VERSION is undef
Date: Sun, 26 Jan 2020 21:24:35 +0100
To: bug-Text-Layout [...] rt.cpan.org
From: Andreas Koenig <andreas.koenig.7os6VVqR [...] franz.ak.mind.de>
Thanks! The META.json/yaml just provides PAUSE a bit relaxation. The end user sees after installation only the pm-files. -- andreas