Skip to content

Port Data::Alias for CPAN compatibility #1990

Open

Description

@fglock

Summary

Port Data::Alias so CPAN distributions that rely on its aliasing API can run on PerlOnJava. Data::Reuse is one confirmed consumer. Data::Alias 1.30 contains XS code (Alias.xs) and its Perl module bootstraps that extension; the current CPAN MakeMaker path installs only the .pm file and cannot compile the XS component.

Reproduction and evidence

  • Distribution: Data-Alias 1.30, module Data::Alias.
  • In CPAN run 20261104-151051-20617, the PerlOnJava test run fails to load Data::Alias across 31 of 33 test programs with Type of arg 1 to pop must be array (not constant item) at the pop our @ISA statement in Data/Alias.pm line 18. This is the first observed blocker; the package also needs an implementation for its XS-provided aliasing behavior.
  • On system Perl 5.42.2 (macOS), the same distribution compiled its XS extension and passed all available tests: 637 tests across 33 files. Two optional test files were skipped because Devel::CallParser and Test::Pod::Coverage were unavailable.
  • Data::Reuse 0.13 requires Data::Alias 1.16+. In CPAN run 20261106-154847-45334, its four test files all fail during dependency loading at the same pop our @ISA diagnostic. The system-Perl oracle built Data::Alias and passed all 127 Data::Reuse tests.
  • Targeted MetaCPAN reverse-dependency lookup: 14 unique released distributions have a runtime dependency on Data::Alias; 2 are recent. Examples: Data::Reuse, Alias-Any, PerlX-Window, and XML-Dataset.

Scope

Implement the Data::Alias surface needed by real consumers, including alias, copy, and deref, with Perl-compatible parsing and runtime semantics. The upstream distribution documents context-transparent operations and aliasing of variables, elements, arguments, and aggregates. Do not treat successful parsing alone as completion: exercise the upstream suite and Data::Reuse against the implementation.

Acceptance criteria

  • use Data::Alias loads without native XS and provides the supported API through PerlOnJava implementation code.
  • Focused tests cover pop our @ISA parsing and the documented API semantics, validated against system Perl.
  • Relevant upstream Data::Alias tests and the Data::Reuse 0.13 suite pass on PerlOnJava; test on both JVM and interpreter backends where supported.
  • Document any unsupported API cases and keep the tested distribution versions and results in the compatibility evidence.

Evidence references

Activity

  1. added
    bug
    area:parser
    area:cpan-port
    on Nov 6, 2026
  2. fglock commented on Nov 12, 2026

    @fglock
    OwnerAuthor

    Data::Alias implementation is deferred because its aliasing semantics depend on the lifetime and owner-accounting work tracked in #2043. The active implementation checkpoint is associated with PR #1938; its checkpoint notes that the lifecycle conversion and sweep removal are still in progress.

    The related Safe, strict-module-loading, and tainted-eval fixes are being delivered separately in PR #2044. That PR does not claim to resolve #1990.

  3. fglock commented on Nov 12, 2026

    @fglock
    OwnerAuthor

    Follow-up after merge: PR #2044 merged as 6a3b11780f9456b0b40dbc773942612030a72eea, resolving the Safe shared-sub, strict @ISA, and tainted eval issues tracked separately by #2033, #2011, and #1981. Data::Alias itself remains deferred: its alias semantics depend on lifetime and owner-accounting work in #2043, tracked in PR #1938. This issue remains open until that work is ready and the Data::Alias acceptance criteria are met.

  4. fglock commented on Nov 15, 2026

    @fglock
    OwnerAuthor

    CPAN follow-up: Params-Validate-Aggregated 0.05 (run 20261115-091204-23477) also exercises the existing Data::Alias load failure. PerlOnJava fails t/00-load.t, t/alias.t, t/pod-coverage.t, t/run.t, t/spec.t, and t/with.t; each traces to Data::Alias 1.30 line 18, pop our @ISA, reported as Type of arg 1 to pop must be array (not constant item). Data::Alias's failed import then causes the later undefined pv_disagg errors.

    The archived system-Perl oracle passes all available Params::Validate::Aggregated tests (38 tests) and Data::Alias tests (637 tests; two optional files skipped). A focused import reproduces the diagnostic on both PerlOnJava JVM and interpreter backends. The parser's pop/shift argument validation does not unwrap our declarations before checking whether the operand is an array. Targeted reverse-dependency metadata reports 14 unique runtime dependants of Data::Alias, 2 recent (including Data::Reuse, Alias-Any, and XML-Dataset).

    This run provides additional post-fix verification coverage for #1990: the Params::Validate::Aggregated 0.05 suite depends on successful Data::Alias loading and exercises the same parser behavior.

  5. added
    blocked:ownership
    on Nov 19, 2026
  6. fglock commented on Nov 21, 2026

    @fglock
    OwnerAuthor

    CPAN follow-up: Perl-Critic-PolicyBundle-SNEZ 0.03, selected by the Perl::Critic::Policy::CodeLayout::RequireBreakBeforeOperator target in run 20261120-195805-13340, adds another reproducible consumer of the pop our @ISA parser failure tracked here.

    In the PerlOnJava run, t/00-compile.t fails while requiring Perl::Critic::Policy::ControlStructures::ProhibitMultipleSubscripts. Loading its required Data::Alias 1.30 dependency reports Type of arg 1 to pop must be array (not constant item) at pop our @ISA in Data::Alias.pm. This prevents the policy bundle's test run from completing. The archived system-Perl oracle passes both bundle test files (13 tests total); the Data::Alias dependency tests also pass under system Perl.

    Focused reproducer:

    our @ISA;
    pop our @ISA;
    print "ok\n";

    System Perl 5.42.2 prints ok. PerlOnJava rejects it with the same diagnostic on both the JVM and interpreter backends. The interpreter result was checked in this follow-up; previous evidence on this issue also records both backends.

    The issue's existing targeted MetaCPAN reverse-dependency evidence remains 14 unique released distributions with a required runtime dependency on Data::Alias, 2 recent within five years. Representative dependants include Data::Reuse, Alias-Any, PerlX-Window, and XML-Dataset.

    This is additional post-fix verification coverage for the parser behavior and Data::Alias loading acceptance criteria already tracked by this issue. No separate issue is needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cpan-portarea:parserblocked:ownershipbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions