You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix the remaining CPANPLUS blockers after Archive::Extract by handling
tied lexical scalar cleanup, strict bareword coderef arrow calls,
version numification, and stale blib/lib sources in PerlOnJava
MakeMaker reruns.
Add focused regressions and update the CPANPLUS progress note with the
passing test result and follow-up warning.
Generated with [Codex](https://openai.com/codex)
Co-Authored-By: Codex <codex@openai.com>
Copy file name to clipboardExpand all lines: dev/modules/cpanplus.md
+36-18Lines changed: 36 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,20 +2,21 @@
2
2
3
3
## Current Status
4
4
5
-
`CPANPLUS::Config`now loads under PerlOnJava after fixing loop-control parsing for bare labels that share a name with an imported constant. This unblocks the upstream `Makefile.PL` path that declares CPANPLUS' dynamic prerequisites.
5
+
`CPANPLUS::Config` loads under PerlOnJava after fixing loop-control parsing for bare labels that share a name with an imported constant. This unblocks the upstream `Makefile.PL` path that declares CPANPLUS' dynamic prerequisites.
6
6
7
-
The current `./jcpan -t CPANPLUS`run now gets through dependency discovery and the `Archive::Extract` dependency. It is blocked by `Object::Accessor`:
7
+
`./jcpan -t CPANPLUS` now passes with CPANPLUS 0.9916:
8
8
9
9
```text
10
-
t/03_Object-Accessor-local.t line 49
11
-
got: 't/03_Object-Accessor-local.t'
12
-
expected: '<process pid>'
10
+
Files=20, Tests=1751, Result: PASS
11
+
EXIT: 0
13
12
```
14
13
15
-
Because `Object::Accessor` fails its dependency test, it is not installed, and CPANPLUS' own test files then fail at compile time with:
14
+
The run also verifies the dependency chain that previously blocked CPANPLUS: `Archive::Extract`, `Object::Accessor`, `File::Fetch`, `Log::Message`, `Module::Loaded`, `Package::Constants`, `Log::Message::Simple`, and `Term::UI`.
15
+
16
+
The only observed remaining issue is a non-fatal warning during CPANPLUS' own suite:
16
17
17
18
```text
18
-
Base class package "Object::Accessor" is empty.
19
+
Use of uninitialized value in addition (+) at jar:PERL5LIB/File/Copy.pm line 303.
19
20
```
20
21
21
22
## Symptom
@@ -39,7 +40,7 @@ WriteMakefile(
39
40
40
41
That fallback had no `PREREQ_PM`, so `Log::Message` was never scheduled.
41
42
42
-
## Root Cause Fixed
43
+
## Root Causes Fixed
43
44
44
45
`CPANPLUS::Config` imports constants from `CPANPLUS::Internals::Constants`, including:
45
46
@@ -59,6 +60,16 @@ Perl treats bare `last BIN` as a literal loop label, even when a constant sub na
59
60
60
61
The fix keeps a standalone bare identifier immediately after `last`, `next`, or `redo` as a literal loop label. Parenthesized and expression labels still go through the dynamic-label path.
61
62
63
+
`Archive::Extract` then failed because PerlOnJava's bundled `Archive::Zip` member objects exposed `_name` but CPAN `Archive::Extract` expects the compatibility hash key `fileName`, and it passes member objects back into `extractMember`. The bundled module now exposes both names and accepts member objects.
64
+
65
+
`Object::Accessor` then exposed tied lexical cleanup differences. A tied lexical scalar whose tie object should be destroyed at scope exit was being cleaned through the generic scalar path, so `DESTROY` did not fire at the Perl-compatible time. Tied scalar cleanup is now explicit and idempotent, including the closure-capture case.
66
+
67
+
CPANPLUS' tests also use strict bareword coderef calls in forms such as `BUILD_PL->(...)`, `-e BUILD_PL->(...)`, and `stat MAKEFILE->(...)`. PerlOnJava now treats a bareword to the left of `->(...)` as a sub call returning a coderef, and reassociates filetest and `stat`/`lstat` unary operators so those expressions match Perl's parse.
68
+
69
+
Version checks then exposed decimal vs dotted-version numification differences. `version->parse("v1.5")->numify` now returns `1.005000`, while decimal versions such as `1.5` and `1.2345` retain decimal-padding semantics.
70
+
71
+
The final CPANPLUS blocker was in the generated Makefile for a dummy `Foo-Bar` distribution. When `Makefile.PL` was rerun after `blib/lib` already existed, PerlOnJava's MakeMaker treated staged `blib/lib/*.pm` files as source files. Its generated `pm_to_blib` target could delete `blib/lib/Foo/Bar.pm` and then try to copy that same path back to itself. MakeMaker now prefers real `lib/` sources over stale `blib/` entries and does not stage already-staged files back into `blib`.
72
+
62
73
## Completed Work
63
74
64
75
- Fixed loop-control parsing in [`OperatorParser.java`](../../src/main/java/org/perlonjava/frontend/parser/OperatorParser.java).
@@ -67,30 +78,37 @@ The fix keeps a standalone bare identifier immediately after `last`, `next`, or
67
78
- Fixed the `Archive::Extract` dependency failure by making PerlOnJava's bundled `Archive::Zip` expose the CPAN-compatible member hash field `fileName` and accept member objects in `extractMember`.
68
79
- Added regression coverage in [`archive_zip_members_matching_qr.t`](../../src/test/resources/unit/archive_zip_members_matching_qr.t) for direct member hash access and object extraction.
- Verified `./jcpan -t CPANPLUS` now gets past `Archive::Extract`; `File::Fetch`, `Log::Message`, `Module::Loaded`, `Package::Constants`, `Log::Message::Simple`, and `Term::UI` pass in the observed run.
81
+
- Fixed tied scalar scope cleanup so `Object::Accessor` local attribute restore passes.
82
+
- Added regression coverage in [`tie_scalar.t`](../../src/test/resources/unit/tie_scalar.t) for tied lexical `DESTROY` at scope exit and deferred destruction while a tie object is still referenced.
83
+
- Fixed strict bareword coderef arrow parsing and filetest/stat reassociation for CPANPLUS' `BUILD_PL->(...)` and `MAKEFILE->(...)` patterns.
84
+
- Added regression coverage in [`subroutine.t`](../../src/test/resources/unit/subroutine.t) for strict bareword coderef calls and unary-operator reassociation.
85
+
- Fixed `version` numification/normalization for dotted `v` versions and decimal versions.
86
+
- Added regression coverage in [`version_numify.t`](../../src/test/resources/unit/version_numify.t).
87
+
- Fixed PerlOnJava MakeMaker reruns after `blib/lib` exists so stale staged files are not copied onto themselves.
88
+
- Added regression coverage in [`makemaker_stale_blib_source.t`](../../src/test/resources/unit/makemaker_stale_blib_source.t).
89
+
- Verified `Object::Accessor` upstream suite passes: `Files=7, Tests=155, Result: PASS`.
Before running the full `jcpan -t CPANPLUS` acceptance, make sure no local CPANPLUS distropref is masking the dependency path. A previous investigation generated `/Users/fglock/.perlonjava/cpan/prefs/CPANPLUS.yml`; move it aside or use an isolated CPAN home before judging dependency discovery.
83
103
84
104
## Next Steps
85
105
86
-
1. Reduce `Object::Accessor`'s `t/03_Object-Accessor-local.t` failure. The failing construct is scoped attribute restore via `$Object->$Acc( $0 => \my $temp )`; PerlOnJava restores `$0` instead of the previous `$$` value when `$temp` leaves scope.
87
-
2. Compare the reduced `Object::Accessor` case with system Perl and both PerlOnJava backends. Likely areas are `local`/scope cleanup, weak/DESTROY-like cleanup behavior around temporary references, or assignment to lexical references passed as arguments.
88
-
3. Add a minimal unit regression for the runtime behavior before changing CPAN module prefs or overlays.
89
-
4. Re-run `timeout 600 ./jcpan -t Object::Accessor` after the runtime fix, then re-run `timeout 1200 ./jcpan -t CPANPLUS`.
90
-
5. Inspect the generated `Makefile`, `MYMETA.yml`, and CPAN log to verify `PREREQ_PM` includes the CPANPLUS runtime dependency set from `CPANPLUS::Selfupdate`.
91
-
6. When CPANPLUS tests are passing or have documented non-runtime blockers, update this document with the final test count and remaining skips/failures.
106
+
1. Reduce the non-fatal `File::Copy.pm line 303` warning from CPANPLUS' own suite. It appears to come from numeric conversion of `$!` or `$^E` after a failed move fallback, but it does not currently fail CPANPLUS.
107
+
2. Re-run `timeout 1200 ./jcpan -t CPANPLUS` from a fresh or isolated CPAN home before merging if cache independence is required.
108
+
3. Audit whether MakeMaker still needs to discover installable files from `blib/lib`; if it does, keep the new no-self-staging behavior as the regression guard.
109
+
4. Keep CPANPLUS as a regression target when touching `Archive::Extract`, `Object::Accessor`, `ExtUtils::MakeMaker`, parser precedence, or `version`.
92
110
93
111
## Open Questions
94
112
95
-
-Is the `Object::Accessor` failure a generic PerlOnJava scope-cleanup bug or specific to the module's accessor implementation?
96
-
-After `Object::Accessor` installs, do CPANPLUS' own tests expose runtime failures beyond dependency loading?
113
+
-Does the `File::Copy` warning reveal a generic `$!` / `$^E` numeric conversion difference when the error variables are unset?
114
+
-Are there CPAN distributions that intentionally rely on MakeMaker installing files that only exist under `blib/lib` after configure/build, and should that path be modeled more explicitly?
0 commit comments