[Eval] Preserve hashref results for decoded Unicode config source
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ó
- 5/5
- Thời gian dự kiến
- Hơn một tuần
- Mức phù hợp với người mới
- 38/100
Hướng nghiên cứu
Start by tracing string eval result handling in PerlOnJava and identify the project’s regression test entry point for eval behavior; compare the decoded Unicode reproducer under system Perl, JVM, and interpreter backends. Done means project-owned coverage passes on both backends and the RoutesConfig 0.07 t/basic.t suite completes successfully.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Summary
Mojolicious::Plugin::Config evaluates UTF-8-decoded configuration source and expects the source's outer hash expression to return a hash reference. With a nested route group containing four route descriptions, PerlOnJava's string eval returns the nested array reference instead. Mojolicious::Plugin::Config::parse then dies because the result is not a hash reference.
This is reproducible on both PerlOnJava backends and passes on standard Perl. The failure is in dynamic eval's result for the decoded config source, not in the CPAN harness or a missing prerequisite.
CPAN evidence
- Distribution:
Mojolicious-Plugin-RoutesConfig0.07; runtime prerequisiteMojolicious>= 9.17. - CPAN random tester run:
20261129-192130-74689. - Failing test:
t/basic.t; it prints its first passing assertion, then exits 255 before completing TAP. - System Perl 5.42.2 with Mojolicious 9.49: all 23 tests across five files pass; the three author tests are skipped.
- PerlOnJava at
cce9dbe100157df64836677c95a50775bc53ac80, with Mojolicious 9.49:t/basic.tfails on both JVM and interpreter. The config loader reports thatcomplex_routes.confdid not return a hash reference. - The distribution is pure Perl and does not require a native dependency for this test.
With JPERL_EVAL_TRACE=1, the config eval completes without a syntax error, but its result is reported as RuntimeList with scalar value ARRAY(...). The corresponding system Perl result is a hash reference.
Reproducer
This follows the config-loading pattern in Mojolicious::Plugin::Config::parse. The route source is encoded and decoded so the eval receives a UTF-8-decoded string, as it does when loading the CPAN fixture.
use utf8;
use Encode qw(encode);
use Mojo::Util qw(decode);
my $octets = encode('UTF-8', <<'CONFIG');
{ routes => [{
under => {
'/управление' => sub {
my $c = shift;
return 1 if $c->current_route('login') || $c->user;
$c->redirect_to('login');
return;
},
},
routes => [
{ any => '/blah/:id', to => {controller => 'Blah', action => 'index'} },
{ get => '/вход', to => 'Login#index' },
{ post => '/вход', to => 'Login#index' },
{ any => '/lbah/:id', to => {controller => 'Lbah', action => 'index'} },
],
}] };
CONFIG
my $content = decode('UTF-8', $octets);
my $code = 'package Mojolicious::Plugin::Config::Sandbox; no warnings;'
. 'sub app; local *app = sub {}; use Mojo::Base -strict; ' . $content;
my $config = eval $code;
die $@ if $@;
die 'expected HASH, got ' . (ref($config) || 'SCALAR')
unless ref($config) eq 'HASH';
System Perl evaluates this to HASH. PerlOnJava JVM and interpreter evaluate it to ARRAY.
Expected behavior
A scalar-context string eval of this configuration source should return the outer hash reference on both PerlOnJava backends, matching system Perl. The existing RoutesConfig upstream suite should then complete successfully.
Acceptance criteria
- Add project-owned regression coverage for the decoded Unicode config eval and validate its expected behavior with system Perl first.
- Pass the regression on both JVM and interpreter backends.
- Run
Mojolicious::Plugin::RoutesConfig0.07t/basic.tand confirm the upstream suite passes on PerlOnJava.
- Ngôn ngữ chính
- Perl
- Star
- 67
- Fork
- 9
- Merge trung bình
- 6 giờ 45 phút
- Pull request đã merge (30 ngày)
- 104
Chuẩn bị môi trường
- Có Dockerfile hoặc tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- 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.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fglock/PerlOnJava
-
area:cpan-port area:performance bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#2230 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:runtime documentation enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
fglock/PerlOnJava#1579 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:ownership area:performance area:runtime bug
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 35/100
fglock/PerlOnJava#2232 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:backend area:cpan-port area:runtime bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 72/100
fglock/PerlOnJava#2231 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:cpan-port area:runtime bug
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 70/100
fglock/PerlOnJava#2227 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fglock/PerlOnJava
Issue tương tự
-
[doc] perlsub wrongly says that `"sub { ... }" creates a new subroutine each time it is executed'Đang mởdocumentation Needs Triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 69/100
Maintainer thường phản hồi trong vòng 1 ngày
-
docs(api): /api/v3/external_sources spec is missing lc and section_titleCó thể đã có người làm @subhwastaken đã nhận hôm nay. Đang mở
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
openfoodfacts/openfoodfacts-server#15626 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 67/100
LMS-Community/slimserver#1742 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
brucemiller/LaTeXML#2894 ·