Investigate .dat file condition in PROXYFS mmap - no changes needed#3130
Closed
Investigate .dat file condition in PROXYFS mmap - no changes needed#3130
Conversation
The mmap implementation for PROXYFS now correctly handles file reading for older PHP versions (7.2-7.4). Key changes: 1. Get actual file size from the proxied filesystem using fstat() for non-.dat files, as older PHP versions may pass incorrect length values 2. Read file contents using a loop with subarray view into the heap, matching how MEMFS and the PR #3073 implementation work 3. Fix symbol usage bug - get symbols from both replica and sourceOfTruth instances separately to ensure correct property access when instances come from different module builds (ESM vs CJS) 4. Enable Intl extension tests for PHP 7.2, 7.3, and 7.4
Remove specific PHP versions that support the Intl extension with ICU from the tests.
The Intl extension supports both procedural functions and object-oriented classes. While we were testing numfmt_create() and similar functions, we weren't testing that classes like Collator work correctly. This matters because classes depend on ICU data being properly loaded, and a misconfiguration could break class instantiation even if functions work. The new test creates a Collator instance and verifies it can sort data according to locale rules.
The Intl extension provides both procedural functions (like numfmt_create) and object-oriented classes (like Collator). While both depend on ICU data being properly loaded via mmap, they exercise different code paths in the extension. Testing both ensures the entire Intl implementation works correctly across all supported PHP versions (8.5 through 7.2).
PHP 7.2 and 7.3 are no longer supported in the repository. Updated the Intl extension tests to only run for PHP 7.4 through 8.5, and updated code comments to reflect that PHP 7.4 is now the oldest supported version.
Rewrote documentation to be more specific and useful: - Explains exactly why ICU needs mmap (loads icudt74l.dat for Collator/NumberFormatter) - Clarifies what PHP 7.4's bug is (passes wrong stat buffer value instead of file size) - Explains why we check for .dat files (ICU files work correctly, other files don't) - Documents that ICU only maps from offset 0 - Explains the subarray view approach for reading - Notes that msync rarely runs since ICU only reads - Improves proxyFileSystem docs with concrete examples Removed vague phrases like "certain file types" and "older PHP versions" in favor of precise explanations of what's happening and why.
Contributor
Author
|
Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details. Warning Firewall rules blocked me from connecting to one or more addresses (expand for details)I tried to connect to the following addresses, but was blocked by firewall rules:
If you need me to access, download, or install something from one of these locations, you can either:
|
Copilot
AI
changed the title
[WIP] WIP address feedback on mmap support implementation for proxyFS
Investigate .dat file condition in PROXYFS mmap - no changes needed
Jan 16, 2026
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.
Investigated reviewer feedback questioning whether the
if (!path.endsWith('.dat'))condition in PROXYFS mmap implementation is necessary.Findings
The condition is required. Removing it breaks ICU data file loading through PROXYFS:
IntlException: Constructor failedRoot Cause
For
.datfiles, thelengthparameter passed by PHP to mmap is already correct. Usingfstat()to override it breaks ICU's mmap implementation. For other files,fstat()provides the correct length that PHP fails to pass.Code Location
The condition is correct as implemented. No changes made.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.