Skip to content

Commit 3075f67

Browse files
fglockDevin
andauthored
Update design docs with current status (#340)
* 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 <noreply@cognition.ai> * 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 <noreply@cognition.ai> --------- Co-authored-by: Devin <noreply@cognition.ai>
1 parent 49de071 commit 3075f67

2 files changed

Lines changed: 53 additions & 63 deletions

File tree

dev/design/cpan_client.md

Lines changed: 38 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -530,7 +530,7 @@ cpan> install Module::Name
530530

531531
---
532532

533-
## Phase 11: DateTime Dependency Investigation (2026-03-19)
533+
## Phase 11: DateTime Dependency Investigation (2026-03-19, UPDATED)
534534

535535
### Problem Statement
536536

@@ -540,60 +540,57 @@ When running `jcpan install DateTime`, CPAN reports "DateTime is up to date (1.6
540540

541541
However, when actually using DateTime, the CPAN-installed `DateTime.pm` fails to load due to missing dependencies.
542542

543-
### Dependency Chain Analysis
543+
### Current Status (Updated 2026-03-19)
544+
545+
**Symbol table dereference bug: FIXED**
546+
547+
```perl
548+
# Now works correctly
549+
./jperl -e 'package Foo; our $VERSION = "1.0"; print ${ $Foo::{VERSION} }, "\n"'
550+
# Output: 1.0
551+
```
552+
553+
**New blocker discovered**: Package::Stash::PP doesn't return a true value.
554+
555+
```
556+
Could not find a suitable Package::Stash implementation:
557+
Can't locate Package/Stash/XS.pm
558+
Package/Stash/PP.pm did not return a true value
559+
```
560+
561+
### Dependency Chain Analysis (Updated)
544562
545563
```
546564
DateTime.pm
547565
├── namespace::autoclean 0.19
548-
│ └── B::Hooks::EndOfScope (XS - MISSING)
566+
│ └── namespace::clean
567+
│ └── Package::Stash
568+
│ └── Module::Implementation
569+
│ ├── ${ $stash{NAME} } - FIXED
570+
│ └── Package::Stash::PP - BROKEN (doesn't return true)
549571
├── Params::ValidationCompiler 0.26 ✓
550-
├── Specio::Subs
551-
│ └── Specio
552-
│ └── Module::Implementation
553-
│ └── BUG: ${ $Package::{NAME} } returns empty
572+
├── Specio::Subs ✓ (after Package::Stash fix)
554573
├── Try::Tiny ✓
555574
├── DateTime::Locale 1.06
556575
├── DateTime::TimeZone 2.44
557576
└── POSIX (built-in) ✓
558577
```
559578
560-
### Root Cause: Symbol Table Dereference Bug
561-
562-
**Bug discovered**: `${ $Package::{NAME} }` returns empty instead of the variable value.
563-
564-
```perl
565-
# PerlOnJava - BROKEN
566-
package Foo;
567-
our $VERSION = "1.0";
568-
my $glob = $Foo::{VERSION};
569-
print ${$glob}; # prints empty string (should print "1.0")
570-
571-
# Perl5 - WORKS
572-
package Foo;
573-
our $VERSION = "1.0";
574-
my $glob = $Foo::{VERSION};
575-
print ${$glob}; # prints "1.0"
576-
```
577-
578-
This bug blocks `Module::Implementation` which is used by `Specio` which is used by `DateTime`.
579-
580579
### Blocking Issues Summary
581580
582581
| Issue | Module Affected | Status |
583582
|-------|-----------------|--------|
584-
| `${ $stash{NAME} }` dereference | Module::Implementation | **BUG - needs fix** |
585-
| B::Hooks::EndOfScope (XS) | namespace::autoclean | XS module - needs stub or Java impl |
583+
| ~~`${ $stash{NAME} }` dereference~~ | ~~Module::Implementation~~ | **FIXED** |
584+
| Package::Stash::PP doesn't return true | Package::Stash | **BUG - needs investigation** |
586585
587586
### Proposed Solutions
588587
589-
#### Option A: Fix Symbol Table Dereference (Recommended)
588+
#### Option A: Fix Package::Stash::PP (Recommended)
590589
591-
Fix the bug where `${ $glob_from_stash }` doesn't properly dereference to the scalar value.
590+
Investigate why Package::Stash::PP.pm doesn't return a true value.
592591
593592
**Files to investigate:**
594-
- `RuntimeScalar.java` - scalar dereference
595-
- `RuntimeGlob.java` - glob handling
596-
- `GlobalContext.java` - symbol table access
593+
- `~/.perlonjava/lib/Package/Stash/PP.pm` - Check for compilation errors
597594
598595
#### Option B: Create Bundled DateTime.pm
599596
@@ -602,31 +599,20 @@ Create a simplified `DateTime.pm` in `src/main/perl/lib/` that:
602599
2. Uses our Java XS implementation or DateTime::PP
603600
3. Provides core DateTime functionality
604601
605-
This is a fallback if Option A is too complex.
606-
607-
#### Option C: Document DateTime as Requiring Manual Setup
608-
609-
Document that DateTime requires additional setup and can't be installed via jcpan directly.
610-
611602
### Investigation Commands
612603
613604
```bash
614-
# Test symbol table dereference
605+
# Test symbol table dereference (NOW FIXED)
615606
./jperl -e 'package Foo; our $VERSION = "1.0"; print ${ $Foo::{VERSION} }, "\n"'
607+
# Output: 1.0 (correct)
616608
617-
# Compare with Perl5
618-
perl -e 'package Foo; our $VERSION = "1.0"; print ${ $Foo::{VERSION} }, "\n"'
619-
620-
# Test Module::Implementation
621-
./jperl -e 'use Module::Implementation; print "OK\n"'
622-
623-
# Test DateTime after fix
609+
# Test DateTime - still blocked by namespace::autoclean
624610
./jperl -MDateTime -e 'print DateTime->now->ymd, "\n"'
611+
# Error: Can't locate namespace/autoclean.pm
625612
```
626613

627614
### Next Steps
628615

629-
1. **Investigate** `RuntimeScalar.java` and `RuntimeGlob.java` for scalar dereference from stash glob
630-
2. **Fix** the `${ $glob }` pattern when glob comes from `%Package::` stash
631-
3. **Test** Module::Implementation, Specio, DateTime in sequence
632-
4. **Alternative**: If fix is complex, create bundled DateTime.pm wrapper
616+
1. **Install namespace::autoclean dependencies** via jcpan to test further
617+
2. **If blocked by Package::Stash::PP**, investigate why modules ending with `sub foo { }` return undef
618+
3. **Alternative**: Create bundled DateTime.pm wrapper that skips heavy dependencies

dev/design/log4perl-compatibility.md

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -223,22 +223,24 @@ BEGIN failed--compilation aborted at -e line 1, near ""
223223
**Affected Tests:**
224224
- t/016Export.t (1 failure)
225225

226-
### Issue 4: File Permissions (stat/chmod)
226+
### Issue 4: Multiple File Appenders (Pre-existing)
227227

228-
**Status:** Unchanged - needs investigation.
228+
**Status:** Pre-existing bug - NOT a regression.
229229

230-
**Symptom:** t/026FileApp.t tests 6-7 fail comparing expected vs actual file permissions.
230+
**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.
231231

232-
**Example:**
232+
**Test:**
233233
```perl
234-
# Expected: '488' (octal 0750)
235-
# Got: '511' (octal 0777)
234+
# Two appenders configured: FileAppndr1 -> file1, FileAppndr2 -> file2
235+
$log->info("Shu-wa-chi!");
236+
# Expected: Each file gets "INFO - Shu-wa-chi!"
237+
# Got: file1 is empty, file2 gets the message twice
236238
```
237239

238-
**Root Cause:** Likely issue with `umask` handling or `chmod` implementation.
240+
**Root Cause:** Unknown - possibly related to how multiple file handles are managed when opening different files with similar configurations.
239241

240242
**Affected Tests:**
241-
- t/026FileApp.t (tests 6-7, 25)
243+
- t/026FileApp.t (tests 6-7)
242244

243245
### Issue 5: Safe.pm Compartment Restrictions
244246

@@ -414,16 +416,18 @@ For chmod/umask:
414416
- [x] caller() line number fix (2026-03-19) - Fixed 7/8 failures
415417
- [x] eval block "(eval)" name in caller() (2026-03-19) - Fixed test 62
416418
- [x] local $OurVariable fix (2026-03-19) - Fixed %T stack trace format
419+
- [x] mkdir umask handling (2026-03-19, PR #338) - Fixed t/026FileApp.t test 25
420+
- [x] local *GLOB semantics (2026-03-19, PR #338) - Correct file handle capture
417421

418422
### Active Issues
419423
- [ ] DESTROY during global destruction (1 test)
420-
- [ ] chmod/file permissions (3 tests)
424+
- [ ] Multiple file appenders - pre-existing (2 tests) - tests 6-7 in t/026FileApp.t
421425
- [ ] Safe.pm restrictions (3 tests)
422426
- [ ] Source filters (1 test)
423427

424428
### Next Steps
425-
1. Investigate DESTROY during global destruction
426-
2. Investigate chmod/file permissions issue
429+
1. Investigate multiple file appenders bug
430+
2. Investigate DESTROY during global destruction
427431

428432
---
429433

0 commit comments

Comments
 (0)