fix(chunked_fuse): lazy fallback to st_ctime for macOS crtime field#3196
Open
jackd wants to merge 1 commit intometa-pytorch:mainfrom
Open
fix(chunked_fuse): lazy fallback to st_ctime for macOS crtime field#3196jackd wants to merge 1 commit intometa-pytorch:mainfrom
jackd wants to merge 1 commit intometa-pytorch:mainfrom
Conversation
Author
|
@cpuhrsch possibly most relevant? |
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.
Full disclosure: I'm not a rust guy, nor am I a mac person. An agent proposed this to resolve a build failure I was having, other agents agreed, and having made the change the build now succeeds. Below is a summary generated by one such agent.
Summary
On macOS, fuse3's FileAttr struct requires two extra fields not present on Linux: crtime (file creation time) and flags. This PR adds both.
For crtime, the implementation prefers st_birthtime from the Python stat dict when available (e.g. on real macOS filesystems), and falls back to st_ctime when the key is absent (e.g. when the remote filesystem or Python stat implementation doesn't populate it). This avoids panics/errors when mounting a FUSE filesystem on macOS against a remote that doesn't expose birthtime.
flags is set to 0 as there are no relevant BSD file flags to propagate.
Both fields are gated with #[cfg(target_os = "macos")] so Linux builds are unaffected.
Changes
chunked_fuse.rs: In extract_attr, conditionally populate crtime (with lazy st_ctime fallback) and flags on macOS.
Testing
Compile-tested on macOS. The fallback path handles filesystems that don't expose st_birthtime without returning an error.
Note:
USE_TENSOR_ENGINE=0 uv syncresulted in an updateduv.lockpackage entry forname = "py-spy". I assume this is unrelated to these changes and is down to an outdateduv.lockfile in the repo.