| Crates.io | timelord |
| lib.rs | timelord |
| version | 3.0.2 |
| created_at | 2025-03-22 12:14:37.777646+00 |
| updated_at | 2025-03-22 15:23:21.098354+00 |
| description | A Rust library to preserve file timestamps (mtime) between builds, even with fresh git checkouts |
| homepage | |
| repository | https://github.com/fasterthanlime/timelord |
| max_upload_size | |
| id | 1601759 |
| size | 48,039 |
A Rust library to preserve file timestamps (mtime) between builds, even with fresh git checkouts.
Timelord provides the sync function to preserve file timestamps between builds:
use timelord::sync;
fn main() -> Result<(), Box<dyn std::error::Error>> {
sync("path/to/source", "path/to/cache")?;
Ok(())
}
The sync function takes two arguments:
source_dir: Directory containing files to preserve timestamps forcache_dir: Persistent directory to store the timestamp database across buildsTimelord stores a database of file sizes and hashes, and restores old timestamps if file contents remain unchanged.
For CLI usage, see the timelord-cli crate.
To ensure Timelord works properly, especially in CI environments, it's important to use the -Zremap-cwd-prefix rustc flag. This flag helps maintain consistent paths across different build environments.
Licensed under either of
at your option.