version::qv stringification incorrectly adds a leading v

Đang mở
#2,140 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
Nửa ngày
Mức phù hợp với người mới
66/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, perl
Lĩnh vực
compilers

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.

Ngôn ngữ chính
Perl
Star
67
Fork
8
Merge trung bình
5 giờ 12 phút
Pull request đã merge (30 ngày)
131

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của fglock/PerlOnJava

Tất cả issue của fglock/PerlOnJava

Issue tương tự

Thêm issue về Perl

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.