|
| 1 | +# CPAN compiler and tooling compatibility batch (2026-08-13) |
| 2 | + |
| 3 | +## Goal |
| 4 | + |
| 5 | +Make the system-Perl-compatible surfaces of these targets work through |
| 6 | +`jcpan`, fixing shared compiler, runtime, and CPAN tooling behavior instead of |
| 7 | +adding distribution preferences: |
| 8 | + |
| 9 | +- `Net::FS::Flickr` |
| 10 | +- `Marlin::X::Clone` |
| 11 | +- `Sys::GetRandom::PP` |
| 12 | +- `App::calendr` |
| 13 | +- `App::upf` |
| 14 | +- `Hades::Realm::OO` |
| 15 | +- `Authen::Simple::Kerberos` |
| 16 | + |
| 17 | +Reuse bundled Java providers where native CPAN dependencies need equivalent |
| 18 | +primitives. |
| 19 | + |
| 20 | +## Baseline |
| 21 | + |
| 22 | +| Target | Initial PerlOnJava result | |
| 23 | +| --- | --- | |
| 24 | +| Net::FS::Flickr | dependency resolution reached Imager/Flickr::Upload, then a sandboxed download was blocked | |
| 25 | +| Marlin::X::Clone | `Class::XSConstructor` has no Java or pure-Perl XS replacement | |
| 26 | +| Sys::GetRandom::PP | rejects both Darwin system Perl and PerlOnJava as unsupported platforms | |
| 27 | +| App::calendr | Moo's ithread type map cannot resolve a raw `B::SV` address | |
| 28 | +| App::upf | long Data::Sah/Perinci dependency resolution reached a sandboxed download | |
| 29 | +| Hades::Realm::OO | Hades compiles a self-recursive `(??{ ... })` pattern | |
| 30 | +| Authen::Simple::Kerberos | `Authen::Krb5::Simple` has no Java XS replacement | |
| 31 | + |
| 32 | +The isolated system-Perl comparison passed `Marlin::X::Clone`, |
| 33 | +`App::calendr`, `Hades::Realm::OO`, and `Authen::Simple::Kerberos`. |
| 34 | +`Net::FS::Flickr` was excluded because its upstream |
| 35 | +`Acme::Steganography::Image::Png` dependency fails its own system-Perl tests. |
| 36 | +`Sys::GetRandom::PP` was excluded because the distribution rejects Darwin. |
| 37 | +The `App::upf` comparison exceeded its 20-minute bounded dependency run and |
| 38 | +was kept in the PerlOnJava validation set. |
| 39 | + |
| 40 | +## Progress tracking |
| 41 | + |
| 42 | +### Current status: Complete, reconciled with current master (2026-08-14) |
| 43 | + |
| 44 | +### Completed phases |
| 45 | + |
| 46 | +- [x] Initial `jcpan -t` classification (2026-08-13) |
| 47 | + - Captured full per-target logs with hard process timeouts. |
| 48 | + - Excluded `Sys::GetRandom::PP` because its current distribution rejects |
| 49 | + Darwin under system Perl as well. |
| 50 | +- [x] System-Perl differential (2026-08-13) |
| 51 | + - Excluded the two upstream failures described above. |
| 52 | + - Kept `App::upf` in scope after the bounded comparison timed out. |
| 53 | +- [x] Shared runtime and CPAN tooling fixes (2026-08-13) |
| 54 | + - Added bounded, process-wide address-to-reference recovery for |
| 55 | + `B::SV::object_2svref`, including addresses exposed through |
| 56 | + `Scalar::Util::refaddr` across compiler/runtime threads. |
| 57 | + - Made `jcpan` load its targeted `Module::Build::Base` compatibility |
| 58 | + overlay ahead of stale site-installed copies. |
| 59 | + - Made explicit target failures produce a failing `jcpan` exit status. |
| 60 | + - Deferred unsupported dynamic-regex diagnostics from `qr//` construction |
| 61 | + to first match, allowing modules to define unused patterns honestly. |
| 62 | + - Added pure-Perl XS overlays for `Class::XSConstructor` and |
| 63 | + `B::Hooks::AtRuntime::OnlyCoreDependencies`. |
| 64 | + - Applied one-shot source filters immediately after explicit `BEGIN` blocks |
| 65 | + and preserved localized at-runtime callback arrays across whole-file |
| 66 | + tokenization. |
| 67 | + - Added a JDK Kerberos backend for `Authen::Krb5::Simple`. |
| 68 | + - Files: `B.pm`, `Module/Build/Base.pm`, `App/Cpan.pm`, `XSLoader.java`, |
| 69 | + `RuntimeRegex.java`, runtime reference types, and new provider overlays. |
| 70 | +- [x] Target and dependency validation except `App::upf` (2026-08-13) |
| 71 | + - `Marlin::X::Clone`: 3 files, 8 tests passed. |
| 72 | + - `Class::XSConstructor`: 27 files, 134 tests passed (two optional suites |
| 73 | + skipped for unavailable dependencies). |
| 74 | + - `B::Hooks::AtRuntime::OnlyCoreDependencies`: 3 files, 12 tests passed. |
| 75 | + - `App::calendr`: 2 files, 2 tests passed; its optional |
| 76 | + `Calendar::Bahai` suite was skipped upstream. |
| 77 | + - `Hades::Realm::OO`: 5 files, 40 tests passed (three author-only suites |
| 78 | + skipped upstream). |
| 79 | + - `Authen::Simple::Kerberos`: functional load test passed; two author-only |
| 80 | + POD suites skipped for unavailable test dependencies. |
| 81 | + - Full project `make` passed after the final runtime changes. |
| 82 | +- [x] Bounded `App::upf` validation (2026-08-13) |
| 83 | + - A clean run progressed through QuickJS configuration and more than 4,000 |
| 84 | + lines of Data::Sah/Perinci dependency resolution without reaching the |
| 85 | + target distribution or exposing a PerlOnJava compiler/runtime failure. |
| 86 | + - The equivalent isolated system-Perl run also did not complete its |
| 87 | + dependency graph within 20 minutes, so no target-test differential was |
| 88 | + available. The PerlOnJava run was stopped after exceeding the intended |
| 89 | + bound while still resolving dependencies. |
| 90 | +- [x] Core-suite regression follow-up (2026-08-13) |
| 91 | + - Rebased the branch onto current master and removed the obsolete whole-file |
| 92 | + source-filter pre-pass. Explicit `BEGIN` filters now run only through the |
| 93 | + parser-time path, fixing the double filtering seen in `op/incfilter.t`. |
| 94 | + - Preserved the existing `JPERL_UNIMPLEMENTED=warn` dynamic-regex fallback |
| 95 | + while retaining normal-mode deferred errors for unused `(??{...})` |
| 96 | + patterns. Regex cache entries now distinguish those modes. |
| 97 | + - Replaced the bounded strong B-address registry with weak entries so |
| 98 | + address recovery does not extend Perl value lifetimes. |
| 99 | + - Exact runs against an isolated current-master build matched the repaired |
| 100 | + branch for the remaining reported core-test counts. `op/incfilter.t` |
| 101 | + improved from the regressed 14 tests to 158 passing assertions. |
| 102 | + - Revalidated `Hades::Realm::OO` (40 tests), |
| 103 | + `B::Hooks::AtRuntime::OnlyCoreDependencies` (12 tests), `App::calendr` |
| 104 | + (2 tests), and `Authen::Simple::Kerberos` (functional suite); all passed. |
| 105 | + - Full project `make` passed after the final regression repairs. |
| 106 | +- [x] Upstream reconciliation (2026-08-14) |
| 107 | + - Rebuilt PR #949 on current `origin/master`, which now contains the shared |
| 108 | + regex, warning, tied-array, and other core compatibility repairs. |
| 109 | + - Retained only this batch's CPAN compiler, source-filter, runtime-provider, |
| 110 | + and tooling changes; dropped the branch-local core regression commit so |
| 111 | + the upstream implementations remain authoritative. |
| 112 | + - Preserved the source-filter and weak-reference corrections that are part |
| 113 | + of the CPAN objectives. |
| 114 | + - Full `make` passed. The reported core-test set matched an isolated |
| 115 | + `origin/master` build; `re/speed.t` varied only with its process timeout |
| 116 | + and reproduced the upstream 25 passing assertions on a quiet repeat. |
| 117 | + - Revalidated `Marlin::X::Clone` (8 tests), `App::calendr` (2 tests), |
| 118 | + `Hades::Realm::OO` (40 tests), and `Authen::Simple::Kerberos` (1 functional |
| 119 | + test); all passed. |
| 120 | +- [x] Contention-sensitive regression tooling (2026-08-14) |
| 121 | + - Confirmed the reported `re/speed*.t` losses coincided with concurrent |
| 122 | + PerlOnJava regression runs and CPAN JVMs from other worktrees; the tests' |
| 123 | + internal watchdogs expired before the runner's outer timeout. |
| 124 | + - Applied the runner's existing timeout factor to `re/speed*.t`, keeping the |
| 125 | + watchdog inside the 600-second resource-sensitive allowance. |
| 126 | + - Increased the `gh7094` Benchmark.pm sample from three to five CPU seconds |
| 127 | + to stabilize its global-versus-lexical hash ratios under JVM contention. |
| 128 | + - Verified `re/pat_advanced.t` at 1376/1687 and the benchmark at 6/6 before |
| 129 | + the tooling change; `run/switches.t` matched current master at 76/142. |
| 130 | + - Under continued CPAN JVM load, the adjusted runner reported the benchmark |
| 131 | + at 6/6, `re/speed.t` at the 26/59 baseline, and `re/speed_thr.t` at 25/59 |
| 132 | + versus the reported 18/59 baseline. |
| 133 | + |
| 134 | +### Next steps |
| 135 | + |
| 136 | +1. Update PR #949 and monitor CI. |
| 137 | + |
| 138 | +### Open questions |
| 139 | + |
| 140 | +- `App::upf` has an unusually large dependency graph; neither system Perl nor |
| 141 | + PerlOnJava reached its target tests in the bounded comparison. |
| 142 | + |
| 143 | +## References |
| 144 | + |
| 145 | +- [Module porting guide](../../docs/guides/module-porting.md) |
| 146 | +- [Executable regex callbacks](executable-regex-callbacks.md) |
| 147 | +- Skills: `debug-perlonjava`, `port-cpan-module` |
0 commit comments