From 49404c335d2e0b31fae8d149186c9f4628d32f38 Mon Sep 17 00:00:00 2001 From: "Flavio S. Glock" Date: Thu, 19 Mar 2026 17:02:04 +0100 Subject: [PATCH 1/2] Update log4perl-compatibility.md with latest status - 7/700 subtests failing (was 8/700) - Documented mkdir umask fix (PR #338) - Documented local *GLOB semantics fix (PR #338) - Identified tests 6-7 failure as pre-existing multiple file appenders bug - Updated progress tracking with completed items Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin --- dev/design/log4perl-compatibility.md | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/dev/design/log4perl-compatibility.md b/dev/design/log4perl-compatibility.md index 70355cf68..f42425c58 100644 --- a/dev/design/log4perl-compatibility.md +++ b/dev/design/log4perl-compatibility.md @@ -223,22 +223,24 @@ BEGIN failed--compilation aborted at -e line 1, near "" **Affected Tests:** - t/016Export.t (1 failure) -### Issue 4: File Permissions (stat/chmod) +### Issue 4: Multiple File Appenders (Pre-existing) -**Status:** Unchanged - needs investigation. +**Status:** Pre-existing bug - NOT a regression. -**Symptom:** t/026FileApp.t tests 6-7 fail comparing expected vs actual file permissions. +**Symptom:** t/026FileApp.t tests 6-7 fail - when using two file appenders, both messages go to the second file and the first file is empty. -**Example:** +**Test:** ```perl -# Expected: '488' (octal 0750) -# Got: '511' (octal 0777) +# Two appenders configured: FileAppndr1 -> file1, FileAppndr2 -> file2 +$log->info("Shu-wa-chi!"); +# Expected: Each file gets "INFO - Shu-wa-chi!" +# Got: file1 is empty, file2 gets the message twice ``` -**Root Cause:** Likely issue with `umask` handling or `chmod` implementation. +**Root Cause:** Unknown - possibly related to how multiple file handles are managed when opening different files with similar configurations. **Affected Tests:** -- t/026FileApp.t (tests 6-7, 25) +- t/026FileApp.t (tests 6-7) ### Issue 5: Safe.pm Compartment Restrictions @@ -414,16 +416,18 @@ For chmod/umask: - [x] caller() line number fix (2026-03-19) - Fixed 7/8 failures - [x] eval block "(eval)" name in caller() (2026-03-19) - Fixed test 62 - [x] local $OurVariable fix (2026-03-19) - Fixed %T stack trace format +- [x] mkdir umask handling (2026-03-19, PR #338) - Fixed t/026FileApp.t test 25 +- [x] local *GLOB semantics (2026-03-19, PR #338) - Correct file handle capture ### Active Issues - [ ] DESTROY during global destruction (1 test) -- [ ] chmod/file permissions (3 tests) +- [ ] Multiple file appenders - pre-existing (2 tests) - tests 6-7 in t/026FileApp.t - [ ] Safe.pm restrictions (3 tests) - [ ] Source filters (1 test) ### Next Steps -1. Investigate DESTROY during global destruction -2. Investigate chmod/file permissions issue +1. Investigate multiple file appenders bug +2. Investigate DESTROY during global destruction --- From fb9242bc25975524e03c5faac5e120937c721a4b Mon Sep 17 00:00:00 2001 From: "Flavio S. Glock" Date: Thu, 19 Mar 2026 17:08:22 +0100 Subject: [PATCH 2/2] Update cpan_client.md - symbol table dereference bug is fixed - Symbol table dereference (${ $Pkg::{NAME} }) now works correctly - DateTime still blocked by namespace::autoclean dependency - Updated investigation commands and next steps Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin --- dev/design/cpan_client.md | 90 +++++++++++++++++---------------------- 1 file changed, 38 insertions(+), 52 deletions(-) diff --git a/dev/design/cpan_client.md b/dev/design/cpan_client.md index 708d1b52f..b727b507f 100644 --- a/dev/design/cpan_client.md +++ b/dev/design/cpan_client.md @@ -530,7 +530,7 @@ cpan> install Module::Name --- -## Phase 11: DateTime Dependency Investigation (2026-03-19) +## Phase 11: DateTime Dependency Investigation (2026-03-19, UPDATED) ### Problem Statement @@ -540,60 +540,57 @@ When running `jcpan install DateTime`, CPAN reports "DateTime is up to date (1.6 However, when actually using DateTime, the CPAN-installed `DateTime.pm` fails to load due to missing dependencies. -### Dependency Chain Analysis +### Current Status (Updated 2026-03-19) + +**Symbol table dereference bug: FIXED** + +```perl +# Now works correctly +./jperl -e 'package Foo; our $VERSION = "1.0"; print ${ $Foo::{VERSION} }, "\n"' +# Output: 1.0 +``` + +**New blocker discovered**: Package::Stash::PP doesn't return a true value. + +``` +Could not find a suitable Package::Stash implementation: +Can't locate Package/Stash/XS.pm +Package/Stash/PP.pm did not return a true value +``` + +### Dependency Chain Analysis (Updated) ``` DateTime.pm ├── namespace::autoclean 0.19 -│ └── B::Hooks::EndOfScope (XS - MISSING) +│ └── namespace::clean +│ └── Package::Stash +│ └── Module::Implementation +│ ├── ${ $stash{NAME} } - FIXED +│ └── Package::Stash::PP - BROKEN (doesn't return true) ├── Params::ValidationCompiler 0.26 ✓ -├── Specio::Subs -│ └── Specio -│ └── Module::Implementation -│ └── BUG: ${ $Package::{NAME} } returns empty +├── Specio::Subs ✓ (after Package::Stash fix) ├── Try::Tiny ✓ ├── DateTime::Locale 1.06 ├── DateTime::TimeZone 2.44 └── POSIX (built-in) ✓ ``` -### Root Cause: Symbol Table Dereference Bug - -**Bug discovered**: `${ $Package::{NAME} }` returns empty instead of the variable value. - -```perl -# PerlOnJava - BROKEN -package Foo; -our $VERSION = "1.0"; -my $glob = $Foo::{VERSION}; -print ${$glob}; # prints empty string (should print "1.0") - -# Perl5 - WORKS -package Foo; -our $VERSION = "1.0"; -my $glob = $Foo::{VERSION}; -print ${$glob}; # prints "1.0" -``` - -This bug blocks `Module::Implementation` which is used by `Specio` which is used by `DateTime`. - ### Blocking Issues Summary | Issue | Module Affected | Status | |-------|-----------------|--------| -| `${ $stash{NAME} }` dereference | Module::Implementation | **BUG - needs fix** | -| B::Hooks::EndOfScope (XS) | namespace::autoclean | XS module - needs stub or Java impl | +| ~~`${ $stash{NAME} }` dereference~~ | ~~Module::Implementation~~ | **FIXED** | +| Package::Stash::PP doesn't return true | Package::Stash | **BUG - needs investigation** | ### Proposed Solutions -#### Option A: Fix Symbol Table Dereference (Recommended) +#### Option A: Fix Package::Stash::PP (Recommended) -Fix the bug where `${ $glob_from_stash }` doesn't properly dereference to the scalar value. +Investigate why Package::Stash::PP.pm doesn't return a true value. **Files to investigate:** -- `RuntimeScalar.java` - scalar dereference -- `RuntimeGlob.java` - glob handling -- `GlobalContext.java` - symbol table access +- `~/.perlonjava/lib/Package/Stash/PP.pm` - Check for compilation errors #### Option B: Create Bundled DateTime.pm @@ -602,31 +599,20 @@ Create a simplified `DateTime.pm` in `src/main/perl/lib/` that: 2. Uses our Java XS implementation or DateTime::PP 3. Provides core DateTime functionality -This is a fallback if Option A is too complex. - -#### Option C: Document DateTime as Requiring Manual Setup - -Document that DateTime requires additional setup and can't be installed via jcpan directly. - ### Investigation Commands ```bash -# Test symbol table dereference +# Test symbol table dereference (NOW FIXED) ./jperl -e 'package Foo; our $VERSION = "1.0"; print ${ $Foo::{VERSION} }, "\n"' +# Output: 1.0 (correct) -# Compare with Perl5 -perl -e 'package Foo; our $VERSION = "1.0"; print ${ $Foo::{VERSION} }, "\n"' - -# Test Module::Implementation -./jperl -e 'use Module::Implementation; print "OK\n"' - -# Test DateTime after fix +# Test DateTime - still blocked by namespace::autoclean ./jperl -MDateTime -e 'print DateTime->now->ymd, "\n"' +# Error: Can't locate namespace/autoclean.pm ``` ### Next Steps -1. **Investigate** `RuntimeScalar.java` and `RuntimeGlob.java` for scalar dereference from stash glob -2. **Fix** the `${ $glob }` pattern when glob comes from `%Package::` stash -3. **Test** Module::Implementation, Specio, DateTime in sequence -4. **Alternative**: If fix is complex, create bundled DateTime.pm wrapper +1. **Install namespace::autoclean dependencies** via jcpan to test further +2. **If blocked by Package::Stash::PP**, investigate why modules ending with `sub foo { }` return undef +3. **Alternative**: Create bundled DateTime.pm wrapper that skips heavy dependencies