You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
On MacOS std::fs::copy does not modify the timestamp of the destination #115982
I was just debugging different behavior between Linux and MacOS builds in our CI, and it turns out, it came to sqlite-sys crate using build.rs script that uses std::fs::copy, which on MacOS seems to be using fcopyfile call which preserves the modification, access, and creation timestamps from the source file to the destination file by default.
This is an inconsistency with implementations on other platforms, I believe.
It seems that COPYFILE_STAT flag could be turned off on that call, but that will also prevent mode from being copied, which seems copied on other implementations. So AFAICT making behavior consistent would cost an extra syscall.
Unless I'm mistaken somewhere altogether (happens a lot), at very least this should be explicitly documented.
Personally, I would prefer this being made consistent. As unreliable as they can sometimes be mtimes are often used for things like caching, and it's no fun to hunt down weird caching bugs etc. that happen only on one platform.
The implementation should simply start using clonefile when #104385 lands. I believe the mtime behavior of clonefile is correct here. And if it's not: CoW file copying still goes brrr.
Activity
workingjubilee commentedon Sep 20, 2023
The implementation should simply start using
clonefilewhen #104385 lands. I believe the mtime behavior ofclonefileis correct here. And if it's not: CoW file copying still goes brrr.alexandru0-dev commentedon Mar 31, 2024
any updates?
perf(nix): collapse the Crane artifact layers into a linear chain
perf(rust): split the workspace into independently cached crates (#1428)
bardiharborow commentedon Aug 24, 2026
@rustbot label +A-filesystem +O-apple