Summary
Port Variable::Magic to PerlOnJava or provide a compatible Java-backed implementation so CPAN modules that depend on Perl variable magic can load and run without native XS.
Variable::Magic exposes Perl's low-level variable-magic API, including callbacks for get, set, clear, free, copy, local, and hash fetch/store/exists/delete operations. The current distribution is XS-only and requires a C compiler; PerlOnJava reports:
Can't load loadable object for module Variable::Magic: no Java XS implementation available
CPAN evidence
In CPAN run 20260918-141920-96054, MooX::LvalueAttribute v0.16 passes completely under system Perl:
Files=6, Tests=33
Result: PASS
Under PerlOnJava, 4/6 test programs fail during loading because Variable::Magic cannot load. The affected downstream tests are:
t/00-compile.t
t/lvalue.t
t/lvalue_in_role.t
t/lvalue_in_role_with_xs.t
This prevents the lvalue-attribute implementation from exercising its normal behavior; the failure is in the native dependency rather than in MooX::LvalueAttribute itself.
Ecosystem impact
The current MetaCPAN release index contains 38 unique CPAN distributions with a runtime requires dependency on Variable::Magic, deduplicated across 634 matching release records. Two dependant distributions have releases within the preceding 12 months: Dios and MooseX-Params.
Representative runtime dependants include DBIx-Class, KiokuDB, MRO-Magic, MooX-LvalueAttribute, MooseX-Lexical-Types, MooseX-LvalueAttribute, Type-Alias, warnings-lock, and Variable-Temp.
Source query: https://fastapi.metacpan.org/v1/release/_search?q=dependency.module%3A%22Variable%3A%3AMagic%22&size=1000&from=0
Expected behavior
A supported PerlOnJava implementation should allow modules using the documented Variable::Magic API to load and provide compatible variable-magic behavior, or clearly expose a supported substitute that downstream CPAN modules can use without native code.
Suggested scope
- Define the supported Variable::Magic API and identify which magic operations can be represented by PerlOnJava runtime hooks.
- Implement the highest-value operations first, including wizard creation, casting, retrieving data, and dispelling magic.
- Preserve callback timing and lvalue/hash behavior where the Perl runtime exposes an equivalent operation.
- Add focused unit tests for the Java-backed implementation on both JVM and interpreter backends.
- Use
MooX::LvalueAttribute as downstream acceptance coverage, followed by other dependants such as MRO::Magic and warnings-lock.
- Document unsupported operations explicitly if complete parity cannot be achieved in the first port.
Notes
This is a porting/enhancement request for a native CPAN dependency, not a defect in MooX::LvalueAttribute. The reverse-dependency lookup in the local CPAN-priority tool previously failed with MetaCPAN HTTP 599; the count above was independently obtained from the current MetaCPAN release index and filtered to unique runtime dependants.
Summary
Port
Variable::Magicto PerlOnJava or provide a compatible Java-backed implementation so CPAN modules that depend on Perl variable magic can load and run without native XS.Variable::Magicexposes Perl's low-level variable-magic API, including callbacks for get, set, clear, free, copy, local, and hash fetch/store/exists/delete operations. The current distribution is XS-only and requires a C compiler; PerlOnJava reports:CPAN evidence
In CPAN run
20260918-141920-96054,MooX::LvalueAttributev0.16 passes completely under system Perl:Under PerlOnJava, 4/6 test programs fail during loading because
Variable::Magiccannot load. The affected downstream tests are:t/00-compile.tt/lvalue.tt/lvalue_in_role.tt/lvalue_in_role_with_xs.tThis prevents the lvalue-attribute implementation from exercising its normal behavior; the failure is in the native dependency rather than in
MooX::LvalueAttributeitself.Ecosystem impact
The current MetaCPAN release index contains 38 unique CPAN distributions with a runtime
requiresdependency onVariable::Magic, deduplicated across 634 matching release records. Two dependant distributions have releases within the preceding 12 months:DiosandMooseX-Params.Representative runtime dependants include
DBIx-Class,KiokuDB,MRO-Magic,MooX-LvalueAttribute,MooseX-Lexical-Types,MooseX-LvalueAttribute,Type-Alias,warnings-lock, andVariable-Temp.Source query: https://fastapi.metacpan.org/v1/release/_search?q=dependency.module%3A%22Variable%3A%3AMagic%22&size=1000&from=0
Expected behavior
A supported PerlOnJava implementation should allow modules using the documented
Variable::MagicAPI to load and provide compatible variable-magic behavior, or clearly expose a supported substitute that downstream CPAN modules can use without native code.Suggested scope
MooX::LvalueAttributeas downstream acceptance coverage, followed by other dependants such asMRO::Magicandwarnings-lock.Notes
This is a porting/enhancement request for a native CPAN dependency, not a defect in
MooX::LvalueAttribute. The reverse-dependency lookup in the local CPAN-priority tool previously failed with MetaCPAN HTTP 599; the count above was independently obtained from the current MetaCPAN release index and filtered to unique runtime dependants.