Repository navigation
fix: fall back when macOS bulk directory reads are unavailable - #418
Merged
Merged
Conversation
…ble (#417) The new implementation can have a performance impact if the bulk reads are turned off, but this can be controlled with configuration so shouldn't be a problem. Also, it's for old systems. <!-- agent --> PowerPC and macOS before 10.10 do not provide getattrlistbulk, so unconditional native directory enumeration leaves dua-core consumers with an undefined symbol at link time. Select bulk reads from the target architecture and deployment version in build.rs. Respect MACOSX_DEPLOYMENT_TARGET, otherwise query the target compiler's default; unknown versions and architectures use ordinary directory reads. Keep the existing macOS entry/metadata API and preserve requested APFS clone metadata in the fallback. Review identified an unused 64 KiB allocation per directory in fallback builds. Make that buffer zero-sized, avoiding the heap allocation while keeping the shared reader layout and fallback behavior. Also omit clock_gettime before macOS 10.12, leaving the metadata probe's existing missing-clock behavior in place. Assisted-by: GPT 6.1 Sol Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Byron
force-pushed
the
conditional-bulk-macos
branch
from
October 25, 2026 10:36
fc7caf9 to
67c8576
Compare
Byron
marked this pull request as ready for review
October 25, 2026 11:39
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.
Tasks
This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here.
Everything below this line was generated by
Codex GPT-6.Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
Fixes #417.
dua-coreunconditionally linkedgetattrlistbulk, which is unavailable on PowerPC and macOS before 10.10. A build script now checks the target architecture andMACOSX_DEPLOYMENT_TARGET, querying the target compiler's default when the environment variable is absent. Older targets and unknown compiler defaults use the existing ordinary-directory fallback while retaining the macOS entry/metadata API. The fallback also honors requested APFS clone metadata.clock_gettimeis separately excluded before macOS 10.12; the existing metadata probe already handles an unavailable CPU clock.Fallback builds use a zero-sized bulk buffer to avoid an unused 64 KiB allocation per directory, as identified by the commit review.
Validation:
_getattrlistbulkand_clock_gettime.clock_gettimeremains absent, including build-script reruns when the deployment target changes.The legacy deployment tests run on modern macOS. Modern Rust raises these binaries' effective minimum OS version to its own supported floor; CI validates the selected backend's behavior and absence of unavailable dua-core symbols, rather than end-to-end legacy OS runtime compatibility. Actual legacy macOS/PowerPC hardware and mrustc were unavailable, and this does not lower the supported OS version of Rust's standard library or other dependencies.