Nested require loses package for helper subs in List::Vectorize

Đang mở
#2,078 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
52/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
java, perl
Lĩnh vực
backend

Hướng nghiên cứu

Start by comparing this nested dependency load with the caller/package handling and regression coverage added for #1601. Reproduce with ./jcpan -t Statistics::Multtest, then run the focused ./jperl command from the issue on both JVM and interpreter backends. Add a project owned regression test for the minimal nested load, and confirm the reproducer and all 52 unchanged Statistics-Multtest assertions pass.

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

Mô tả

area:cpan-port area:runtime bug

Summary

Statistics::Multtest 0.14 fails six assertions in t/1prototype.t on the PerlOnJava JVM backend. Its initial routine calls List::Vectorize::is_array_ref and List::Vectorize::is_hash_ref, but those functions are not present in the expected package after use Statistics::Multtest loads List::Vectorize and its helper files.

The same distribution and dependencies pass under system Perl. This appears related to package context while loading a nested required Perl file without an explicit package declaration, and may be a remaining case in the nested-require caller/package handling addressed by #1601. The small reproducer below fails in the current checkout.

Reproduction

Install Statistics::Multtest 0.14 and its List::Vectorize dependency, then load them through the distribution's normal module path:

./jcpan -t Statistics::Multtest

The failing calls can be isolated after the distributions are installed:

./jperl \
  -I<Statistics-Multtest-blib-lib> \
  -I<List-Vectorize-blib-lib> \
  -e 'use Statistics::Multtest; Statistics::Multtest::initial([0.1])'

On the JVM backend this dies with:

Undefined subroutine &List::Vectorize::is_array_ref called

In List::Vectorize 1.05, is_array_ref is defined in List/Vectorize/lib/Datatype.pl. That file has no package declaration; it is loaded by List::Vectorize.pm using require. With List::Vectorize loaded directly in a top-level one-liner, the symbol is present, but when loaded as a dependency of Statistics::Multtest, it is absent from List::Vectorize's package.

Evidence

  • Distribution/version: Statistics-Multtest 0.14; dependency List-Vectorize 1.05.
  • Archived CPAN run: 20261117-092012-89323.
  • PerlOnJava JVM backend: 46/52 assertions passed; six failures (tests 1, 3, 5, 7, 9, and 11) in t/1prototype.t, all failing at the undefined List::Vectorize::is_array_ref call in Statistics::Multtest::initial.
  • System Perl oracle from the same run: Statistics-Multtest passed all 52 tests; List-Vectorize passed all 643 dependency tests.
  • No XS/native dependency is involved.
  • The isolated reproducer was run on the JVM backend. Interpreter behavior has not yet been checked.

Expected behavior

Loading List::Vectorize as a dependency should define its helper functions in List::Vectorize, so Statistics::Multtest::initial can validate array and hash references as it does under system Perl.

Related issue

This may be an additional package-context case related to #1601 (nested require caller context). The focused Statistics::Multtest reproducer above still fails in the current checkout and should be compared against the regression coverage added for that issue.

Acceptance criteria

  • Add a project-owned regression test for the minimal nested dependency load and validate its expected behavior under system Perl.
  • Make the focused reproducer pass on both JVM and interpreter backends.
  • Rerun the unchanged Statistics-Multtest 0.14 test suite and confirm all 52 assertions pass.
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.