|
| 1 | +# CPAN compiler/tooling batch: Perl::ToPerl6 through Devel::SlowBless |
| 2 | + |
| 3 | +## Goal |
| 4 | + |
| 5 | +Classify and repair the reusable compiler, regex, runtime, and CPAN-tooling |
| 6 | +defects exposed by `jcpan -t` for Perl::ToPerl6, |
| 7 | +Game::HeroesVsAliens::Alien, App::Greple::update, GCJ::Cni, |
| 8 | +Data::Semantic, Text::HTML::CollapseWhitespace, DBM::Deep::Blue, and |
| 9 | +Devel::SlowBless. Distributions that fail under the same local system Perl are |
| 10 | +out of scope, as requested. |
| 11 | + |
| 12 | +## System Perl classification (2026-08-16) |
| 13 | + |
| 14 | +| Target | Classification | |
| 15 | +|---|---| |
| 16 | +| Perl::ToPerl6 | Ignore: system Perl also fails `t/05_utils.t` test 136. | |
| 17 | +| Game::HeroesVsAliens::Alien | Ignore: system Perl cannot build Alien::SDL/SDL; the native dependency download/build fails. | |
| 18 | +| App::Greple::update | In scope: system Perl passes 2 files / 4 tests. | |
| 19 | +| GCJ::Cni | Ignore: system Perl cannot find the obsolete `gcj/cni.h` toolchain. | |
| 20 | +| Data::Semantic | In scope: system Perl passes 15 files / 16 tests. | |
| 21 | +| Text::HTML::CollapseWhitespace | Ignore: its Text-HTML-Turndown distribution also fails under system Perl (`t/01-turndown.t` test 46). | |
| 22 | +| DBM::Deep::Blue | Ignore: its native source includes unavailable `malloc.h` and fails compilation on this host. | |
| 23 | +| Devel::SlowBless | In scope: system Perl passes 1 file / 4 tests. | |
| 24 | + |
| 25 | +Full baseline output is captured in `/tmp/jcpan_*_baseline.log` and |
| 26 | +`/tmp/system_perl_*` logs. |
| 27 | + |
| 28 | +## Progress Tracking |
| 29 | + |
| 30 | +### Current Status: Complete (2026-08-16) |
| 31 | + |
| 32 | +### Completed Phases |
| 33 | + |
| 34 | +- [x] Phase 1: Baseline and system-Perl classification (2026-08-16) |
| 35 | + - Ran every requested `jcpan -t` target sequentially with hard timeouts. |
| 36 | + - Installed missing system-Perl prerequisites into an isolated `/tmp` tree |
| 37 | + and tested the exact unpacked distributions. |
| 38 | +- [x] Phase 2: Root-cause reduction (2026-08-16) |
| 39 | + - App::Greple::update requires named-capture regex conditionals, which the |
| 40 | + vendored Joni engine supports but the backend router did not select. |
| 41 | + - Data::Semantic exposes a lazy generated-sub VerifyError after module |
| 42 | + registration side effects; file-level interpreter retry then duplicates |
| 43 | + those registrations. |
| 44 | + - Devel::SlowBless needs its two XS generation-counter functions backed by |
| 45 | + runtime-owned Java state. |
| 46 | +- [x] Phase 3: Implementation (2026-08-16) |
| 47 | + - Routed named-capture conditionals to Joni. |
| 48 | + - Translated Perl brace-form named backreferences for Joni and covered |
| 49 | + recursive named patterns. |
| 50 | + - Added eager lazy-sub verification so only the invalid sub falls back. |
| 51 | + - Added the Devel::SlowBless Java XS bridge and runtime sub-generation |
| 52 | + counter. |
| 53 | + - Corrected string typeglob aliases and ampersand calls inside |
| 54 | + `delete`/`exists` subscripts. |
| 55 | + - Implemented registered-child handling for `wait`/`waitpid`, made pipe |
| 56 | + output pumps drain before close returns, and isolated replay-process STDIN |
| 57 | + until the fork point. These fixes make Perl's `open HANDLE, '|-'` filter |
| 58 | + pattern reliable without distribution-specific changes. |
| 59 | + - Added system-Perl-validated regression tests. |
| 60 | +- [x] Phase 4: End-to-end validation (2026-08-16) |
| 61 | + - `App::Greple::update`: 2 files / 4 tests, PASS. |
| 62 | + - `Data::Semantic`: 15 files / 16 tests, PASS. |
| 63 | + - `Devel::SlowBless`: bundled upstream suite, 1 file / 4 tests, PASS. |
| 64 | + - All new unit tests pass under system Perl and both PerlOnJava backends. |
| 65 | + - Full `make` completed successfully. |
| 66 | + |
| 67 | +### Files Changed |
| 68 | + |
| 69 | +- Compiler/backend: `EmitSubroutine.java`, `ParseInfix.java`. |
| 70 | +- Regex: `JoniRegexPattern.java`. |
| 71 | +- Process and IO runtime: `PerlRuntime.java`, `RuntimeIO.java`, |
| 72 | + `PipeOutputChannel.java`, `WaitpidOperator.java`. |
| 73 | +- Runtime semantics: `RuntimeGlob.java`, `MroRuntimeState.java`, `Mro.java`. |
| 74 | +- Java module bridge: `DevelSlowBless.java`, `Devel/SlowBless.pm`. |
| 75 | +- Regression coverage: eight focused tests in `src/test/resources/unit`. |
| 76 | + |
| 77 | +### Next Steps |
| 78 | + |
| 79 | +1. Merge after CI and review. |
| 80 | + |
| 81 | +### Open Questions |
| 82 | + |
| 83 | +- None. Native distributions excluded by the system-Perl rule remain |
| 84 | + documented rather than hidden behind distribution preferences. |
| 85 | + |
| 86 | +## Related References |
| 87 | + |
| 88 | +- `.agents/skills/debug-perlonjava/SKILL.md` |
| 89 | +- `docs/guides/module-porting.md` |
0 commit comments