Text::CSV::csv fails with bundled Text::CSV_XS shim

オープン
#2,116 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
68/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
perl
領域
backend, testing

調査の方向性

Start by reading the bundled Text::CSV_XS shim and the Text::CSV wrapper’s direct backend call. Add a focused regression test for Text::CSV::csv; confirm it fails on the unfixed parent and passes under standard Perl and both PerlOnJava backends. Then run WHO-GrowthReference-Table 0.013’s t/00-compile.t on both backends and confirm it passes.

索引モデルが issue の本文から書いたものです。

説明

area:cpan-port bug

Summary

WHO::GrowthReference::Table 0.013 fails its compile test under PerlOnJava because the bundled Text::CSV_XS compatibility shim does not define a package-level csv function. The failure is reproducible on both the JVM and interpreter backends. The same upstream distribution suite passes under system Perl.

Root cause

The bundled Text::CSV wrapper implements Text::CSV::csv by directly calling the selected backend's package symbol (&{"$backend\::csv"}). When it selects Text::CSV_XS, that requires Text::CSV_XS::csv to exist directly in the package stash.

The PerlOnJava Text::CSV_XS shim inherits from Text::CSV_PP and explicitly installs inherited methods into its own stash so direct symbol lookups work. Its export/alias block includes methods such as version, error_diag, and the CSV constants, but omits csv. Inheritance alone does not satisfy the wrapper's direct symbolic call, so the invocation dies with:

Undefined subroutine &Text::CSV_XS::csv called at jar:PERL5LIB/Text/CSV.pm line 97.

WHO::GrowthReference::Table calls Text::CSV::csv in compile-time data initialization. Therefore its t/00-compile.t fails while loading the module.

Reproduction

A minimal reproducer is:

use Text::CSV;
my $rows = Text::CSV::csv(in => "a,b\n");

On PerlOnJava source commit 36d061932880b125578ca915c78613ce469b1675, this fails with the undefined Text::CSV_XS::csv error on both backends:

timeout 60 ./jperl -e 'use Text::CSV; my $x = Text::CSV::csv(in => "a,b\n"); print scalar(@$x), qq(\\n)'
timeout 60 ./jperl --interpreter -e 'use Text::CSV; my $x = Text::CSV::csv(in => "a,b\n"); print scalar(@$x), qq(\\n)'

Both exit 255 with the same error. Under system Perl, the archived CPAN oracle passed the complete WHO::GrowthReference::Table 0.013 test suite: 5 test programs, 1 assertion, all successful.

CPAN evidence

  • Distribution: WHO-GrowthReference-Table 0.013 (WHO::GrowthReference::Table)
  • CPAN random tester run: 20261118-104825-43075
  • Failing test: t/00-compile.t (WHO/GrowthReference/Table.pm loaded ok)
  • PerlOnJava result: 1 of 5 test programs failed; the remaining four were author/release tests skipped by the distribution.
  • System Perl oracle: all 5 test programs passed (1 assertion).
  • Runtime prerequisites used by the failing run: Data::Section::Seekable::Reader 0.092 and Data::TableData::Lookup 0.003; both dependency test suites passed under the system Perl oracle.
  • Reproduction environment: macOS 26 / Darwin 25.6, ARM64, OpenJDK 24.0.2, PerlOnJava Perl 5.44.1.

The closedir() warning in the archived log is unrelated; the test's fatal error is the missing Text::CSV_XS::csv symbol.

Acceptance criteria

  • The bundled Text::CSV_XS backend exposes csv as a package-level function compatible with Text::CSV::csv's direct backend call.
  • Add a focused project regression test for the Text::CSV::csv functional interface.
  • Validate the new test with standard Perl, retain evidence that it fails on the unfixed PerlOnJava parent, and verify it passes on both JVM and interpreter backends.
  • Re-run WHO-GrowthReference-Table 0.013 t/00-compile.t on both PerlOnJava backends.
主要言語
Perl
スター
67
フォーク
8
平均マージ
5時間 12分
マージ済み PR(30日)
131

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

fglock/PerlOnJava のほかの issue

fglock/PerlOnJava の issue をすべて見る

似ている issue

Perl の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。