Skip to content

fix: unify CPAN compatibility fixes for Type::Tiny and DBIx::Class - #885

Merged
fglock merged 17 commits into
masterfrom
fix/unified-cpan-882-884
Aug 4, 2026
Merged

fix: unify CPAN compatibility fixes for Type::Tiny and DBIx::Class#885
fglock merged 17 commits into
masterfrom
fix/unified-cpan-882-884

Conversation

@fglock

@fglock fglock commented Aug 3, 2026

Copy link
Copy Markdown
Owner

Summary

This PR combines and supersedes #882, #883, and #884.

It preserves the original Type::Tiny deparse/Storable/eval work, the
namespace::clean/Test::Deep/Exporter scope fixes, and the Sub::Quote/Hash::Merge
warning fixes. The combined review also fixes the integration issues exposed by
the wider CPAN and DBIx::Class suites:

  • correct localized named-sub dispatch and anonymous caller names
  • make localized hash slices work in both bytecode backends
  • implement PadWalker::set_closed_over closure rebinding
  • preserve tied scalar elements during Storable::dclone
  • release nested blessed containers and overwritten lexical owners correctly
  • avoid stale weak references without dropping Sub::Quote metadata owners
  • handle Class::XSAccessor emulated XSUB detection
  • make UNIVERSAL::isa reject arbitrary plain strings as class invocants
  • canonicalize numeric IPv6 getnameinfo results
  • pass lexical handles through XML::Parser subclass wrappers

Focused regression tests were added for each issue and validated against
standard Perl before being run on PerlOnJava.

Validation

  • make — PASS
  • timeout 1200 prove -r src/test/resources/unit with system Perl — PASS
    • 508 files, 9,419 tests
  • make test-bundled-modules — PASS
  • timeout 2400 ./jcpan --jobs 8 DBIx::Class — PASS
    • 314 files, 13,121 tests
  • Parallel CPAN acceptance installs (8 workers) — PASS
    • Type::Tiny: 375 files, 8,994 tests
    • namespace::clean: 14 files, 2,099 tests
    • Test::Deep: 42 files, 1,268 tests
    • Config::Locale: 3 files, 14 tests
    • Sub::Quote: 15 files, 5,427 tests
    • Hash::Merge: 12 files, 680 tests
    • Path::Tiny: 30 files, 1,779 tests
    • Algorithm::Loops: 2 files, 111 tests
  • GitHub Actions — PASS
    • Ubuntu: 9m57s
    • Windows: 13m28s

The branch is ready for combined-PR validation.

fglock and others added 17 commits August 3, 2026 14:03
Allow the native Storable writer to serialize Perl code references when Storable::Deparse is enabled, using compiler-retained source text. Add a unit regression test validated against standard Perl.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
(cherry picked from commit 57a55e4)
Carry anonymous-sub source spans through Internals and RuntimeCode definition
transfers so B::Deparse can recover compiler-retained source for CPAN closures.
Use the exact span before line-based source heuristics and retain compatibility
with existing source-visible deparse behavior.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex@users.noreply.github.com>
Carry parser source spans and bounded source text through interpreted
anonymous subroutines and closure copies. Make B::Deparse use the standard
source formatter while honoring ambient pragmas and AST offsets that fall
inside the subroutine body.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+codex[bot]@users.noreply.github.com>
Include each distribution's inc directory in the PERL5LIB generated for
Test::Harness child processes. This lets bundled test helpers such as
Test::Fatal remain discoverable during jcpan test runs.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+codex[bot]@users.noreply.github.com>
Make Scalar::Util::looks_like_number treat false as non-numeric while true
remains numeric, matching Perl and the Type::Tiny numeric constraints.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+codex[bot]@users.noreply.github.com>
Preserve blessed Perl die payloads when eval compilation catches a BEGIN-time exception, and parse known callback subs with block arguments as anonymous CODE references.

Generated with Codex

Co-Authored-By: Codex <noreply@openai.com>
Track B::Hooks::EndOfScope callbacks against parser lexical scopes so
namespace::clean removes nested imports at the correct compile boundary.
Release temporary localized container contents during global local restoration
to avoid retaining package-level caches across scopes.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Recursively clean discarded container values and clear weak references when
an overwritten scalar no longer has a package-global strong path. Add a
system-Perl-validated regression for Test::Deep's second-argument comparison
case.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Collapse only the compiler-wrapper/interpreted-code duplicate when resolving
caller(N), keeping recursive calls with the same name as distinct Perl frames.
This restores Exporter::as_heavy's caller lookup so goto dispatch resolves
heavy_export instead of the nonexistent heavy_as_heavy.

Add a TAP regression covering the bundled Exporter path.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Preserve lexical warning metadata and runtime warning-bit overrides across
interpreter eval STRING compilation, including warning-aware arithmetic.
Correct incomplete infix-expression diagnostics so CPAN-generated quoted
subroutines report the same source line as Perl.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+codex[bot]@users.noreply.github.com>
Prevent ${^WARNING_BITS} assignments from leaking into later top-level
compile-time warning handling; only eval STRING execution installs the
runtime override, and RuntimeCode restores the prior value on exit.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+codex[bot]@users.noreply.github.com>
Unify the Type::Tiny, namespace::clean, Test::Deep, Sub::Quote, and
Hash::Merge compatibility work and address the regressions exposed by
DBIx::Class and the combined CPAN acceptance suite.

Add focused standard-Perl-validated regressions for closure lifetime,
localized calls and hash slices, PadWalker rebinding, tied containers,
Storable cloning, IPv6 formatting, anonymous caller names, UNIVERSAL::isa,
and deterministic destruction.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex@users.noreply.github.com>
Keep Perl's `(eval)` stack marker ahead of the anonymous-callback fallback so
caller reports the correct subroutine name and hasargs value for eval BLOCK
and eval STRING frames.

Wire the interpreter's existing virtual eval-frame support into inline eval
execution and unwind it across normal, exceptional, and non-local exits.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <158243242+openai-codex@users.noreply.github.com>
Keep the future user module directory in the parent jcpan process's
include path and remove failed false-returning modules from INC so they
can be retried correctly.

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
Replace the dependency on an ignored local perl5/cpan checkout with a
reduced in-test model of Test::Deep's localized wrapper-cache lifetime.
This preserves the runtime regression coverage in clean Linux and Windows
CI workspaces.

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
Skip PerlOnJava-specific B::Deparse, interpreter launcher, and Java
Net::SSLeay assertions when the suite runs under native Perl. Preserve
their complete coverage under jperl, and tolerate hosts that prohibit
IPv6 loopback binding while retaining the portable socket checks.

Generated with [Codex](https://openai.com/codex/)

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
@fglock
fglock merged commit 2bb9007 into master Aug 4, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant