MakeMaker maps a root module to its first helper package
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 初心者へのやさしさ
- 68/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- java
- 領域
- build-system
調査の方向性
Start with _root_pm_install_path in src/main/perl/lib/ExtUtils/MakeMaker.pm, which returns on the first package matching NAME or NAME::. Change it to scan all package declarations in the root .pm, prefer an exact NAME match, and fall back to a nested declaration only when none exists. Add a MakeMaker regression test with a root module that declares a nested helper package first, and check that the file stages at the exact main-module path.
索引モデルが issue の本文から書いたものです。
説明
Summary
The PerlOnJava CPAN run for Algorithm-Tree-NCA 0.02 fails because the MakeMaker compatibility layer stages its main module at the wrong path. The distribution provides a single root-level NCA.pm, but that file declares a helper package before its main package. PerlOnJava maps it to the helper package path, so the distribution's test programs cannot load Algorithm::Tree::NCA.
Evidence
- CPAN random-tester run:
20261015-111423-76219 - Distribution:
Algorithm-Tree-NCA0.02 (Algorithm::Tree::NCA) - Upstream files:
t/basic.t,t/preprocess.t, andt/random.t - System Perl 5.42.2: PASS; all 3 files and 16 tests pass.
- PerlOnJava CPAN test: FAIL; all 3 files stop before executing assertions because
Algorithm/Tree/NCA.pmcannot be found (0/0 assertions ran). - The PerlOnJava MakeMaker output maps
NCA.pmtoAlgorithm/Tree/NCA/Data.pm. - The distribution has no XS/native code or external service prerequisite.
The module file begins with package Algorithm::Tree::NCA::Data; and later declares package Algorithm::Tree::NCA;. The stock MakeMaker build stages the same file as blib/lib/Algorithm/Tree/NCA.pm, after which the complete test suite passes.
Root cause
src/main/perl/lib/ExtUtils/MakeMaker.pm, in _root_pm_install_path, scans a root .pm file and returns as soon as it sees a package equal to NAME or prefixed by NAME::. For this distribution, the first matching declaration is the nested helper package Algorithm::Tree::NCA::Data, so the function immediately chooses Algorithm/Tree/NCA/Data.pm and never reaches the exact main-package declaration later in the file.
This treats the first matching package as the module represented by the file. A root file can declare helper packages before its primary package, so the exact NAME declaration needs to take precedence over nested declarations.
Proposed fix
Scan all package declarations in the root module before selecting the destination. Prefer an exact declaration matching NAME; use a nested NAME::... declaration only as a fallback when there is no exact declaration. Preserve the existing NAME-derived fallback for files with no matching package.
Add a MakeMaker regression test with a root-level module that declares a nested helper package before its main package. Verify that staging places the file at the exact main module path and that the module can be loaded from blib/lib.
Acceptance criteria
- The new regression test passes under system Perl and PerlOnJava.
Algorithm-Tree-NCA0.02's three upstream test files pass through the PerlOnJava CPAN build/test path.- Existing tests for root modules that only declare nested packages continue to stage those modules at the appropriate path.
Related issues
These closed reports cover nearby but distinct build compatibility problems: #1279 (custom test include paths), #1372 (pm_to_blib marker creation), and #1432 (Module::Build nested-module staging). This report concerns MakeMaker choosing the wrong destination for a root-level .pm file with multiple package declarations.
- 主要言語
- Perl
- スター
- 64
- フォーク
- 8
- 平均マージ
- 5時間 43分
- マージ済み PR(30日)
- 204
環境構築
- Dockerfile または Docker Compose ファイルあり
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
fglock/PerlOnJava のほかの issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
fglock/PerlOnJava#1579 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 56/100
fglock/PerlOnJava#1851 ·
メンテナーはふだん 1 日以内に返信
-
area:performance enhancement
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
fglock/PerlOnJava#1846 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
fglock/PerlOnJava#1835 ·
メンテナーはふだん 1 日以内に返信
-
難易度 3/5 半日 初心者へのやさしさ 45/100
fglock/PerlOnJava#1808 ·
メンテナーはふだん 1 日以内に返信
fglock/PerlOnJava の issue をすべて見る
似ている issue
-
fix(api): API v3 Product Read ignores request language (lc) for sample products and image URLs対応中かも @muntasir-396 が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
openfoodfacts/openfoodfacts-server#15042 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
libwww-perl/URI#214 ·
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
dekobon/big-code-analysis#1644 ·
メンテナーはふだん 1 日以内に返信
-
Type: Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
inverse-inc/packetfence#9549 ·
メンテナーはふだん 1 日以内に返信