Skip to content

Commit c8182f2

Browse files
authored
Merge pull request #964 from fglock/fix/jcpan-compiler-tooling-modules-20260815
Fix CPAN compiler, runtime, and jcpan tooling blockers
2 parents 6189122 + a8bef45 commit c8182f2

38 files changed

Lines changed: 932 additions & 66 deletions

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ dependencies {
220220
implementation libs.jing // RELAX NG validation for XML::LibXML
221221
implementation libs.snakeyaml.engine // YAML processing
222222
implementation libs.tomlj // TOML processing
223+
implementation libs.zxing.core // QR encoding for Text::QRCode
223224
implementation libs.commons.csv // CSV processing
224225
implementation libs.commonmark // CommonMark rendering
225226
implementation libs.commonmark.autolink // GFM autolinks

dev/design/jcpan-compiler-tooling-followup.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ The following are not treated as PerlOnJava regressions because their current di
3737

3838
## Progress Tracking
3939

40-
### Current Status: implementation complete; PR ready for review
40+
### Current Status: unified into PR #964; combined CI passing
4141

4242
### Completed Phases
4343

@@ -59,11 +59,34 @@ The following are not treated as PerlOnJava regressions because their current di
5959
- Opened PR #962 from `fix/jcpan-compiler-tooling-followup`.
6060
- GitHub Actions passed on Ubuntu and Windows; the Windows run specifically
6161
confirmed the platform-default newline fix in `pipe_jperl_shebang.t`.
62+
- [x] Phase 7: post-merge warning cleanup (2026-08-15)
63+
- Replaced deprecated `Zstd.decompressedSize` calls with
64+
`Zstd.getFrameContentSize` and reject unknown or invalid frame sizes before
65+
allocating decoder buffers.
66+
- [x] Phase 8: core-suite regression audit (2026-08-15)
67+
- Compared the reported core files against isolated current-master and
68+
historical baseline builds instead of treating aggregate TAP counts as
69+
deterministic.
70+
- Fixed PVLV filehandle handling so `-t` follows the glob's IO slot without
71+
stringification and `close` warnings retain ASCII and Unicode glob names.
72+
- Restored `op/gv.t` from 253/304 to 255/304 and `uni/gv.t` from 176/206 to
73+
178/206. `re/pat_advanced.t`, `re/pat_advanced_thr.t`, and
74+
`test_pl/examples.t` reproduce their higher reported counts. The remaining
75+
`japh/abigail.t` 109/130 result matches both current master and the
76+
documented historical baseline, so it is not a PR #963 regression.
77+
- Added a four-case system-Perl oracle and verified it with both PerlOnJava
78+
backends; the full `make` suite passes.
79+
- PR #963 CI passed on Ubuntu and Windows at commit `b48f504d8`.
80+
- [x] Phase 9: unified review branch (2026-08-15)
81+
- Merged all five PR #963 commits into PR #964 so the compiler, runtime,
82+
CPAN-tooling, and Java-module changes can be tested and approved together.
83+
- The combined full `make` suite passed before the unified branch was pushed.
84+
- Unified PR #964 CI passed on Ubuntu in 14m35s and Windows in 17m27s.
6285

6386
### Next Steps
6487

65-
1. Review PR #962.
66-
2. Merge after approval.
88+
1. Mark PR #963 as superseded by PR #964.
89+
2. Hand PR #964 back for user testing and review.
6790

6891
### Open Questions
6992

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
# jcpan compiler and tooling modules
2+
3+
## Goal
4+
5+
Fix reusable compiler and CPAN-tooling blockers exposed by Pegex::JSON,
6+
Music::Factory, Bio::Data::Plasmid::CloningVector,
7+
Catalyst::Engine::HTTP::POE::YieldCC, App::Chained, Queue, and their
8+
dependencies. Prefer shared runtime/tooling fixes and existing Java libraries
9+
over distribution preferences.
10+
11+
## Progress Tracking
12+
13+
### Current Status: PR #963 commits unified into PR #964; combined CI passing
14+
15+
### Completed Phases
16+
17+
- [x] Phase 1: baseline and system-Perl classification (2026-08-15)
18+
- Captured bounded `jcpan -t` logs for all six requested modules.
19+
- Identified malformed Bio-MCPrimers packaging and Catalyst's omitted
20+
Restarter::Watcher as upstream distribution failures.
21+
- [x] Phase 2: shared root-cause implementation (2026-08-15)
22+
- Restored YAML::PP's standard object `dump` API.
23+
- Serialized scalar references through their referents for boolean.pm parity.
24+
- Made gzip EOF status compatible with CPAN single-file extraction.
25+
- Extended generic missing-prerequisite discovery to TAP diagnostics.
26+
- Routed Object::Pad's core syntax to PerlOnJava's native class compiler.
27+
- [x] Phase 3: cross-runtime regression validation (2026-08-15)
28+
- Validated YAML, gzip, native-class, and CPAN-tooling regressions with
29+
system Perl where applicable.
30+
- Passed the focused regressions on JVM and interpreter backends.
31+
- [x] Phase 4: requested module verification (2026-08-15)
32+
- Pegex::JSON: 4 files, 21 assertions, PASS.
33+
- Music::Factory: 5 files, 20 assertions, PASS.
34+
- App::Chained: 2 files, 9 assertions, PASS after generic dependency retry.
35+
- Queue: single-file distribution built and tested successfully; upstream
36+
ships no test directory.
37+
- Bio::Data::Plasmid::CloningVector excluded because Bio-MCPrimers has no
38+
Makefile.PL and fails system-Perl configuration.
39+
- Catalyst::Engine::HTTP::POE::YieldCC excluded because its distribution
40+
requires but does not ship or declare Restarter::Watcher; system Perl
41+
reproduces the missing-module failure.
42+
- [x] Phase 5: full verification (2026-08-15)
43+
- Full `make` passed all unit shards.
44+
- [x] Phase 6: pull request and CI (2026-08-15)
45+
- Opened [PR #964](https://github.com/fglock/PerlOnJava/pull/964).
46+
- Ubuntu CI passed in 11m20s.
47+
- Windows CI passed in 18m10s.
48+
- [x] Phase 7: unified review branch (2026-08-15)
49+
- Merged all five commits from PR #963 into PR #964 for joint testing and
50+
approval.
51+
- The combined full `make` suite passed before push.
52+
- Unified PR #964 CI passed on Ubuntu in 14m35s and Windows in 17m27s.
53+
54+
### Next Steps
55+
56+
1. Mark PR #963 as superseded by PR #964.
57+
2. Await joint testing and review of PR #964.
58+
59+
### Open Questions
60+
61+
- Object::Pad-specific MOP and extension APIs remain outside the native class
62+
compatibility pragma; the requested Music::Factory surface uses core syntax.
63+
64+
## References
65+
66+
- Skills: `debug-perlonjava`, `port-cpan-module`

docs/about/changelog.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ Release history of PerlOnJava. See [Roadmap](roadmap.md) for future plans.
44

55
## Work in progress
66

7+
- CPAN/compiler tooling: restore YAML::PP's object `dump` API, recognize
8+
TAP-indented missing prerequisites, report gzip stream completion for CPAN
9+
single-file distributions, and route Object::Pad's core syntax through the
10+
native class compiler. This unblocks Pegex::JSON, Music::Factory,
11+
App::Chained, and Queue without distribution preferences.
712
- CPAN/compiler tooling: add transitive prerequisites to the bundled-provider
813
manifest, provide a JAXP-backed `XML::LibXSLT`, and preserve descriptors for
914
anonymous handles stored in container lvalues. This unblocks

docs/reference/bundled-modules.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -377,6 +377,7 @@ These are loaded automatically or via `use`:
377377

378378
| Module | Implementation | Notes |
379379
|--------|---------------|-------|
380+
| `Object::Pad` | Perl/compiler | Core `class`, `field`, `method`, `:param`, and `:isa` syntax uses PerlOnJava's native class compiler; Object::Pad MOP extensions are not included |
380381
| `Scalar::Util` | Java | |
381382
| `Sub::Name` | Java | |
382383
| `Sub::Util` | Java | |

docs/reference/feature-matrix.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,9 @@ The `:encoding()` layer supports all encodings provided by Java's `Charset.forNa
771771
-**Safe** module.
772772

773773
### Non-core modules
774+
- 🟡 **Object::Pad**: core class, field, method, parameter, and inheritance
775+
syntax is handled by PerlOnJava's native class compiler; Object::Pad-specific
776+
MOP extensions are not implemented.
774777
-**JSON::DWIW**: relaxed JSON conversion implemented over the bundled
775778
pure-Perl `JSON::PP` backend.
776779
-**Taint::Runtime**: Java XS replacement for runtime taint toggling and

docs/reference/xs-compatibility.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@ These modules have optimized Java implementations built into PerlOnJava:
2626
| Exporter::Lexical | ExporterLexical.java | 0.02 | Installs lexical subs into the enclosing compile-time scope |
2727
| HTML::Content::Extractor | HTMLContentExtractor.java | 0.17 | Uses jsoup's HTML5 parser with a small legacy tree-compatibility layer |
2828
| Crypt::Twofish2 | CryptTwofish2.java | 1.03 | Uses BouncyCastle Twofish; ECB, stateful zero-IV CBC, and CFB1 |
29+
| Math::Cephes | MathCephes.java | 0.5308 | Implements the normal and chi-square distribution functions used by CPAN statistics modules |
30+
| Text::QRCode | TextQRCode.java | 0.05 | Uses ZXing in forced byte mode with libqrencode-compatible mask selection |
2931

3032
## Modules with PP Fallbacks or Shims
3133

gradle/libs.versions.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ snappy-java = "1.1.10.8"
1313
sqlite-jdbc = "3.53.2.1"
1414
tomlj = "1.1.1"
1515
zstd-jni = "1.5.7-8"
16+
zxing = "3.5.4"
1617

1718
[libraries]
1819
asm = { module = "org.ow2.asm:asm", version.ref = "asm" }
@@ -37,6 +38,7 @@ snappy-java = { module = "org.xerial.snappy:snappy-java", version.ref = "snappy-
3738
sqlite-jdbc = { module = "org.xerial:sqlite-jdbc", version.ref = "sqlite-jdbc" }
3839
tomlj = { module = "org.tomlj:tomlj", version.ref = "tomlj" }
3940
zstd-jni = { module = "com.github.luben:zstd-jni", version.ref = "zstd-jni" }
41+
zxing-core = { module = "com.google.zxing:core", version.ref = "zxing" }
4042

4143
[plugins]
4244
cyclonedx = "org.cyclonedx.bom:2.3.0"

jcpan

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ export JPERL_ORPHAN_EXIT=1
116116
# CPAN build tools may install copies of their own implementation modules into
117117
# the user library. Keep PerlOnJava's narrow compatibility overlays ahead of
118118
# those copies while jcpan and its child build processes run.
119-
export PERLONJAVA_PREFER_BUNDLED_MODULES="Module/Build/Base.pm${PERLONJAVA_PREFER_BUNDLED_MODULES:+,$PERLONJAVA_PREFER_BUNDLED_MODULES}"
119+
export PERLONJAVA_PREFER_BUNDLED_MODULES="Module/Build/Base.pm,Object/Pad.pm${PERLONJAVA_PREFER_BUNDLED_MODULES:+,$PERLONJAVA_PREFER_BUNDLED_MODULES}"
120120

121121
# CPAN test suites should run with deterministic semantics. User-interface
122122
# color preferences such as NO_COLOR can change module behavior under test

src/main/java/com/booking/sereal/Decoder.java

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,13 @@ private void uncompressZstd() throws SerealException {
334334
int len = (int) read_varint();
335335

336336
byte[] compressedData = Arrays.copyOfRange(originalData.array, position, position + len);
337-
long decompressedSize = Zstd.decompressedSize(compressedData);
337+
long decompressedSize = Zstd.getFrameContentSize(compressedData);
338+
if (Zstd.isError(decompressedSize)) {
339+
String message = decompressedSize == -1
340+
? "Zstd frame content size is unknown"
341+
: Zstd.getErrorName(decompressedSize);
342+
throw new SerealException(message);
343+
}
338344

339345
if (decompressedSize > this.maxSize) {
340346
throw new SerealException("The expected uncompressed size is larger than the allowed maximum size");

0 commit comments

Comments
 (0)