PrereqScanner TestNeeds loses quoted module names and version literals
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 42/100
調査の方向性
まず upstream の t/test.t の失敗しているケースから始め、最初に system Perl で、次に JVM とインタープリターの両方のバックエンドで再現します。引用符付きリテラルと数値リテラルを、parser/compiler の値の経路および PPI/PPIx::Literal 互換レイヤーを通して追跡します。完了の条件は、プロジェクト所有のリグレッションカバレッジによって、複数のモジュール名とバージョン 5.020 が両方のバックエンドで一貫して保持されることです。
索引モデルが issue の本文から書いたものです。
説明
Summary
Perl::PrereqScanner::Scanner::TestNeeds v0.001 regressed on PerlOnJava.
The scanner no longer preserves quoted module names or Perl version literals
when processing use Test::Needs statements.
The regression reproduces identically on both the JVM backend and the
interpreter backend.
CPAN evidence
- Distribution:
Perl-PrereqScanner-Scanner-TestNeedsv0.001 - Module:
Perl::PrereqScanner::Scanner::TestNeeds - CPAN run:
20260915-125610-17469 - Result: 2/3 assertions failed; 1/2 test programs failed
- Previous passing result: 2026-08-27, commit
4ebea751e - Standard Perl: complete upstream suite passes, 9 tests
- PerlOnJava: 2 assertions fail, followed by an invalid-version exception
- Native code: none in the target distribution or its relevant dependencies
The failing upstream tests are t/test.t assertions for one and multiple
module prerequisites. The failure occurs after the module's load test passes.
Reproduction
use Perl::PrereqScanner;
my $scanner = Perl::PrereqScanner->new({ scanners => ['TestNeeds'] });
my $prereqs = $scanner->scan_string(
q{use Test::Needs 'Local::Module1'}
);
use Data::Dumper;
print Dumper($prereqs->as_string_hash);
Expected under standard Perl:
{ 'Local::Module1' => 0 }
Observed on both PerlOnJava backends:
{ '' => 0 }
The version-literal case also differs:
$scanner->scan_string(q{use Test::Needs { perl => 5.020 }});
Expected:
{ perl => '5.020' }
Observed:
{ perl => '5.000' }
The upstream test then aborts with:
Can't convert '': Invalid version format (version required)
Backend scope
The exact upstream test command fails on both execution backends with the
same results:
- JVM backend:
Local::Module1andLocal::Module2are missing from the
prerequisite map; the test ends with invalid-version parsing. - Interpreter backend: the same missing module names and invalid-version
failure occur.
Likely ownership
The target module's implementation delegates source literal handling to
PPIx::Literal and prerequisite accumulation to Perl::PrereqScanner. The
failure is not in the upstream distribution: its complete suite passes under
standard Perl.
The PerlOnJava result suggests a shared literal/value representation defect:
- quoted string literals are converted to an empty string;
- version-like numeric literals lose their significant digits and become
5.000instead of5.020; - the resulting values are then passed into the scanner and version parser.
The regression should be investigated in the parser/compiler value path and
the PPI/PPIx::Literal compatibility layer, rather than by changing the CPAN
module or its tests.
Impact
This breaks static prerequisite scanning for Test::Needs, causing module
requirements to be silently recorded under the wrong name or omitted. It can
also misrepresent Perl version requirements, potentially allowing an
incorrect prerequisite set to pass validation or causing downstream tools to
abort with invalid-version errors.
Because Perl::PrereqScanner is used by CPAN tooling and distribution build
systems, the defect may affect more scanners and prerequisite declarations
than this small test distribution exposes.
Expected fix
Preserve the exact value and type of PPI/PPIx::Literal results when scanning
quoted strings and numeric/version literals. In particular:
use Test::Needs 'Local::Module1'must produce
Local::Module1 => 0.- Multiple quoted module names must all be retained.
perl => 5.020must retain the Perl version value5.020.- JVM and interpreter backends must agree.
Add permanent project-owned regression coverage, validated first with system
Perl, for quoted module names, multiple module names, and Perl version
literals.
Deduplication
GitHub searches were performed for PPIx::Literal, Perl::PrereqScanner,
Test::Needs, the empty-string prerequisite symptom, and the 5.020 version
conversion.
No existing issue directly covers this regression. Existing parser/runtime
issues found by the search concern unrelated behaviors, including DBI trace,
Unicode regex handling, typeglob localization, and hash-reference aliasing.
This report is therefore not a duplicate.
- 主要言語
- Perl
- スター
- 64
- フォーク
- 7
- 平均マージ
- 4時間 29分
- マージ済み PR(30日)
- 176
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fglock/PerlOnJava のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fglock/PerlOnJava#1579 ·
メンテナーはふだん 1 日以内に返信
-
area:cpan-port area:unicode bug
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
fglock/PerlOnJava#1341 ·
メンテナーはふだん 1 日以内に返信
-
area:platform area:runtime bug
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
fglock/PerlOnJava#1635 ·
メンテナーはふだん 1 日以内に返信
-
area:cpan-port area:runtime bug
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
fglock/PerlOnJava#1634 ·
メンテナーはふだん 1 日以内に返信
-
area:cpan-port bug
難易度 3/5 1〜2日 初心者へのやさしさ 72/100
fglock/PerlOnJava#1633 ·
メンテナーはふだん 1 日以内に返信
fglock/PerlOnJava の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 70/100
convos-chat/convos#977 ·
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
inverse-inc/packetfence#9387 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
linux-test-project/lcov#552 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
szTheory/exifcleaner#383 ·
メンテナーはふだん 1 日以内に返信
-
1.severity: security
難易度 2/5 1〜3時間 初心者へのやさしさ 62/100
NixOS/nixpkgs#569828 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信