Phase 11: DateTime dependency fixes and map/grep @_ access - #342
Merged
Conversation
Changes: - BHooksEndOfScope: Implement file-level callback tracking instead of runtime scope-based defer. Callbacks now fire when the file that called on_scope_end finishes loading (via doFile/require). - ModuleOperators: Call beginFileLoad/endFileLoad to track file loading and trigger on_scope_end callbacks at the right time. - B.pm: Add perlstring() function and Exporter support for modules like Specio that need to convert strings to Perl source representation. This fixes namespace::clean not working properly with PerlOnJava because callbacks were firing when import() returned instead of when the calling module finished loading. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Document B::Hooks::EndOfScope rewrite and namespace::clean fixes. Note remaining DateTime dependency chain issues. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
In Perl, dereferencing a glob reference as a scalar returns the glob itself, not the scalar slot. This fixes Role::Tiny's _install_methods which uses this pattern to extract overload method names. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Mark Role::Tiny issue as FIXED - Add IO::Dir/File::stat bytecode issue as remaining blocker - Document Perl semantics for glob vs glob reference dereferencing Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- map { $_[0] } now correctly accesses the outer subroutine's @_
- grep { $_[0] } and other list operators (all, any) also fixed
- Scalar::Util::blessed now returns undef for unblessed refs
The fix passes the enclosing subroutine's @_ to the map/grep block
code, so that $_[0], $_[1] etc. refer to the outer @_ rather than
an empty array. This matches Perl's semantics where blocks are not
full subroutines and share the caller's @_.
Generated with [Devin](https://cli.devin.ai/docs)
Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- B::CV::GV now uses Sub::Util::subname to get the real sub name - B::CV::STASH also uses Sub::Util::subname for package information - This enables namespace::autoclean and other introspection modules to correctly identify where code references were defined Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Document map/grep @_ access fix - Document B module introspection improvements - Document DateTime pure Perl mode working with patches - Document remaining namespace::autoclean issues Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Step 1: Investigate namespace::autoclean behavior difference vs system Perl - Step 2: Enable XS fallback to DateTime.java implementation Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Reduced from 884 lines to 172 lines - Condensed phases 1-9 into summary table - Kept module availability reference tables - Kept Safe/Opcode limitation explanation - Preserved Phase 11 (active) with full details and next steps Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
- Add null checks in beginFileLoad/endFileLoad for cases where fileName is null (e.g., loading from filehandles via @inc hooks) - Simplify B::CV->GV and B::CV->STASH to always return __ANON__/main since Sub::Util::subname cannot reliably track installed names Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
When code is installed via glob assignment (*pkg::name = $code), update the RuntimeCode's packageName/subName fields to reflect the installed name. This fixes namespace::autoclean incorrectly removing methods installed via symbolic glob assignment. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…king - Document that Sub::Util::subname now returns installed glob name - Mark DateTime core functionality as working (no PERL_DATETIME_PP needed) - Document remaining issue: Try::Tiny needed for timezone support Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…orts still broken - Glob assignment fix works for DateTime::PP methods - Exporter imports still cleaned because aliases share RuntimeCode - Document why we can't easily fix Exporter case - Next steps: investigate Perl behavior, consider namespace::autoclean stub Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
…ginal" This reverts commit 8bc1e45.
The fix to update packageName/subName on glob assignment broke mro/next_edgecases.t - Perl's behavior is that glob assignment does NOT change subname, and next::method relies on this. Generated with [Devin](https://cli.devin.ai/docs) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR continues Phase 11 of CPAN client support, focusing on DateTime module dependencies.
Fixes
map { $_[0] }inside a subroutine now correctly accesses the outer @_ instead of an empty array$$globrefnow returns the glob itself (from previous commits)DateTime Status
DateTime now works in pure Perl mode with manual patches:
Design Doc Updates
Test plan
makepasses all unit testsGenerated with Devin