Skip to content

Commit a00404a

Browse files
fglockDevin
andcommitted
Update Moo design doc with remaining issues and jcpan improvements
- Document known Moo test failures: DEMOLISH, SUPER::new, regex escaping - Add Phase 10: jcpan Test::Harness integration - Update success criteria and remaining jcpan improvements - Add ~85% test pass rate status (687/~800) Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <noreply@cognition.ai>
1 parent 053d91a commit a00404a

1 file changed

Lines changed: 59 additions & 13 deletions

File tree

dev/design/moo_support.md

Lines changed: 59 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -314,20 +314,62 @@ All tests meet or exceed the baseline (20260312T075000):
314314
315315
## Success Criteria
316316
317-
1. `jcpan -t Moo` runs Moo tests (tests skipped)
318-
2. **All Moo tests pass** ❌ (needs verification with extends fix)
317+
1. `jcpan -t Moo` runs Moo tests (tests now run with Test::Harness)
318+
2. **All Moo tests pass** ❌ (687/~800 passing, see Known Issues below)
319319
3. `jperl -e 'use Moo; print "OK\n"'` works ✓
320320
4. `has x => (is => "ro")` syntax parses correctly ✓
321321
5. Moo class with attributes works ✓
322322
6. `croak` and `carp` work with proper stack traces ✓
323-
7. `extends 'Parent'` inheritance works ✓ (NEW - fixed in Phase 7)
323+
7. `extends 'Parent'` inheritance works ✓ (fixed in Phase 7)
324324
8. No regressions in baseline tests ✓
325325
326+
## Known Issues (Remaining Moo Test Failures)
327+
328+
### Issue: DEMOLISH Not Being Called (Expected - Not Supported)
329+
**Tests affected**: t/demolish-basics.t (3 failures)
330+
**Symptom**: Object destructors (DEMOLISH methods) are not called when objects go out of scope
331+
**Root cause**: DESTROY/fork/threads are not supported in PerlOnJava (they compile but throw at runtime)
332+
**Status**: Expected failure - these features are out of scope for PerlOnJava
333+
334+
### Issue: SUPER::new Not Working in Extended Classes
335+
**Tests affected**: t/extends-non-moo.t
336+
**Symptom**: `Undefined subroutine &Package::SUPER::new called`
337+
**Root cause**: SUPER:: resolution issue when extending non-Moo classes
338+
**Status**: Needs investigation
339+
340+
### Issue: Regex Escaping in Error Messages
341+
**Tests affected**: t/accessor-coerce.t (1 failure)
342+
**Symptom**: `plus\_three` vs `plus_three` - underscores being escaped
343+
**Root cause**: quotemeta or error message formatting escaping `_` incorrectly
344+
**Status**: Minor - cosmetic issue in error messages
345+
346+
### Issue: Role Application Error Messages
347+
**Tests affected**: t/compose-roles.t (4 failures)
348+
**Symptom**: Missing error messages when required attributes are not provided
349+
**Root cause**: Error throwing in role composition may not propagate correctly
350+
**Status**: Needs investigation
351+
352+
## Remaining jcpan Improvements
353+
354+
### Completed in This Session
355+
- [x] **Version parsing**: Handle "undef" version strings gracefully
356+
- [x] **MM->parse_version**: ExtUtils::MakeMaker now loads ExtUtils::MM
357+
- [x] **Sub::Util**: Java implementation with set_subname (required by Moo)
358+
- [x] **Scalar/List::Util VERSION**: Added $VERSION for CPAN detection
359+
- [x] **Test::Harness**: Added for `make test` support
360+
361+
### Still Needed
362+
- [ ] **Prototype checking**: `$$` prototype with `@array` argument should work (workaround: removed prototype)
363+
- [ ] **CPAN.pm metadata caching**: Reduce repeated dependency checks
364+
- [ ] **Better XS module detection**: Skip XS modules earlier in the process
365+
- [ ] **CPAN::DistnameInfo**: Install to avoid "allow_installing_outdated_dists" warnings
366+
326367
## Progress Tracking
327368
328-
### Current Status: 🟢 WORKING - Moo::Role exports fixed, tests running
369+
### Current Status: 🟢 WORKING - Tests running, ~85% passing
329370
330-
Moo::Role now correctly exports `has`, `with`, `requires`. Test pass rate improved from 591 to 687 tests.
371+
Moo tests now run via `jcpan -t Moo`. Approximately 687 of ~800 tests pass.
372+
Main blockers: DEMOLISH (destructors), SUPER::new resolution, error message escaping.
331373
332374
### Completed Phases
333375
- [x] Phase 1: Replace Carp.java with Carp.pm (2024-03-14)
@@ -358,23 +400,27 @@ Moo::Role now correctly exports `has`, `with`, `requires`. Test pass rate improv
358400
- Added TAILCALL trampoline in StatementParser.parseUseDeclaration()
359401
- Moo::Role now correctly exports has, with, requires
360402
- Moo test pass rate: 591687 tests (+96)
361-
- Improved jcpan MakeMaker:
362-
- Cross-platform test running with Test::Harness
363-
- MYMETA.yml generation for CPAN.pm dependency resolution
364-
- Added MM_PerlOnJava.pm stub for future MakeMaker integration
403+
- [x] Phase 10: jcpan Test::Harness integration (2024-03-15)
404+
- Added Test::Harness and TAP:: modules
405+
- Fixed version parsing for "undef" strings
406+
- Fixed MM->parse_version() via ExtUtils::MM loading
407+
- Added Sub::Util Java implementation (set_subname)
408+
- Added Scalar/List::Util $VERSION for CPAN detection
409+
- XSLoader stubs for .pm file version detection
365410

366411
### Next Steps
367412

368-
1. **Fix version parsing error** - CPAN.pm fails parsing "undef" versions
369-
2. **Investigate remaining test failures** - SUPER::new, DEMOLISH, etc.
370-
3. **Consider full MakeMaker integration** - Use original with MM_PerlOnJava
413+
1. **Fix SUPER::new resolution** - Extending non-Moo classes fails
414+
2. **Fix regex escaping** - `\_` vs `_` in error messages
415+
3. **Prototype checking** - `$$` prototype should accept `@array` argument
371416

372417
### PR Information
373418
- **Branch**: `feature/moo-support` (PR #319 - merged)
374419
- **Branch**: `fix/goto-tailcall-import` (PR #320 - open)
375420
- **Key commits**:
376421
- `7a76739b8` - Fix goto &sub in use/import TAILCALL handling
377-
- `ceb105a56` - Cross-platform jcpan, MYMETA.yml, MM_PerlOnJava
422+
- `053d91a95` - Add Sub::Util, fix Scalar/List::Util VERSION, add Test::Harness
423+
- `7993ef74d` - Fix version parsing and MM->parse_version for CPAN.pm
378424

379425
## Related Documents
380426

0 commit comments

Comments
 (0)