version::qv stringification incorrectly adds a leading v

Aberta
#2,140 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
3/5
Tempo estimado
Meio dia
Facilidade para iniciantes
66/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
java, perl
Domínio
compilers

Direção de pesquisa

Start in src/main/java/org/perlonjava/runtime/perlmodule/Version.java: read the forceQv branch of parseInternal and stringify(), which returns original after the branch stored a v-prefixed value there. Re-run the four-line qv reproducer against system Perl and PerlOnJava to confirm the divergence, and check how is_qv and version comparison consume the same fields so they keep working. Done looks like qv("1.2.31") printing 1.2.31 while comparison semantics stay unchanged; the Test::ConsistentVersion suite is the wider check.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

area:runtime bug

Summary

version::qv("1.2.31") stringifies as v1.2.31 in PerlOnJava, while system Perl stringifies it as 1.2.31. This breaks consumers that use the stringified value as the declared distribution version. For example, Test::ConsistentVersion v0.3.1 fails changelog and README version checks under PerlOnJava, while its suite passes under system Perl.

Reproduction

use version;
my $v = qv("1.2.31");
print "$v\n";

Observed: PerlOnJava JVM backend and interpreter print v1.2.31; system Perl 5.42.2 prints 1.2.31.

Root cause

Version.qv() calls parseInternal(..., true). In the forceQv branch, parseInternal prepends v to the input and stores the prefixed value in the object’s original field. Version.stringify() returns original directly, making the implementation’s internal dotted-decimal representation visible during stringification.

The behavior appears in src/main/java/org/perlonjava/runtime/perlmodule/Version.java, in the forceQv handling and stringify() implementation.

Impact / evidence

The archived CPAN run reports 3 of 8 test programs failing. Failures come from Test::ConsistentVersion checks that compare the distribution version against changelog and README text. The package’s full test suite passes on system Perl. The missing optional Test::Pod::Content module is also absent on system Perl and is not the cause.

Expected behavior

Match system Perl’s stringification for qv("1.2.31") while retaining dotted-decimal / is_qv semantics for version comparison and normalization.

Linguagem predominante
Perl
Estrelas
67
Forks
8
Merge médio
5h 12min
PRs com merge (30d)
131

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de fglock/PerlOnJava

Todas as issues de fglock/PerlOnJava

Issues semelhantes

Mais issues de Perl

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.