Port Variable::Magic for CPAN compatibility
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
Research direction
Start by defining the supported Variable::Magic API and reviewing the runtime hooks available on the JVM and interpreter backends. Use t/00-compile.t, t/lvalue.t, t/lvalue_in_role.t, and t/lvalue_in_role_with_xs.t from MooX::LvalueAttribute as downstream coverage, then add focused unit tests for the Java-backed implementation. Done means supported modules load without native XS, with unsupported operations documented.
Written by the indexing model from the issue text.
Description
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.tt/lvalue.tt/lvalue_in_role.tt/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::LvalueAttributeas downstream acceptance coverage, followed by other dependants such asMRO::Magicandwarnings-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.
- Dominant language
- Perl
- Stars
- 64
- Forks
- 6
- Avg merge
- 5h 18m
- Merged PRs (30d)
- 162
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from fglock/PerlOnJava
-
area:cpan-port area:unicode bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
fglock/PerlOnJava#1341 ·
-
area:backend area:cpan-port area:parser area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 52/100
fglock/PerlOnJava#1477 ·
-
area:cpan-port area:parser area:unicode bug
Difficulty 3/5 1-2 days Newbie friendliness 67/100
fglock/PerlOnJava#1476 ·
-
area:backend area:cpan-port area:runtime bug
Difficulty 4/5 3-5 days Newbie friendliness 55/100
fglock/PerlOnJava#1475 ·
-
area:parser area:warnings bug
Difficulty 4/5 3-5 days Newbie friendliness 48/100
fglock/PerlOnJava#1473 ·
All issues in fglock/PerlOnJava
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
corazawaf/coraza-nginx#140 ·
-
1.severity: security
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
api7/lua-resty-saml#63 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 68/100
-
Difficulty 1/5 Under an hour Newbie friendliness 82/100